1 | # Compulsory line |
---|
2 | cmake_minimum_required(VERSION 2.6) |
---|
3 | |
---|
4 | # The name of our project is "BDM". CMakeLists files in this project can |
---|
5 | # refer to the root source directory of the project as ${BDM_SOURCE_DIR} and |
---|
6 | # to the root binary directory of the project as ${BDM_BINARY_DIR}. |
---|
7 | project (BDM) |
---|
8 | |
---|
9 | # In order to be able to use the newly written FindXXX package, the |
---|
10 | # location of the FindXXX.cmake file must be added to the cmake modules |
---|
11 | # list from within a CMakeLists.txt file as follows: |
---|
12 | set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}\\CMake_modules\\") |
---|
13 | |
---|
14 | ###################### |
---|
15 | #Platform specific |
---|
16 | IF(WIN32) |
---|
17 | # IF YOU WANT TO USE YOUR OWN INSTALLATION OF THE NEXT EXTERNAL LIBRARIES, |
---|
18 | # THEN IT IS NECESSARY TO CREATE TEXT FILE "\WIN32\LOCAL_PATHS.TXT" WITH |
---|
19 | # COPIES OF THE TWO FOLLOWING LINES AND THEN CORECT ALL INVOLVED PATHS |
---|
20 | SET(ITPP_DIR "${BDM_SOURCE_DIR}\\win32\\itpp-4.0.6") |
---|
21 | SET(ACML_DIR "${BDM_SOURCE_DIR}\\win32\\acml3.6.0") |
---|
22 | SET(XERCES_DIR "${BDM_SOURCE_DIR}\\win32\\xerces-c_2_8_0-x86") |
---|
23 | |
---|
24 | INCLUDE(\\win32\\local_paths.txt OPTIONAL) |
---|
25 | ADD_DEFINITIONS(-DHAVE_ACML) |
---|
26 | ELSE() |
---|
27 | #This is for UNIX makefile which does only one release at a time. |
---|
28 | SET(CMAKE_BUILD_TYPE Release) |
---|
29 | SET(CMAKE_CXX_FLAGS "-Wall -pipe -Wno-unknown-pragmas") |
---|
30 | SET(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG -O2") |
---|
31 | SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0") |
---|
32 | #ADD_DEFINITIONS(-DNDEBUG) |
---|
33 | INCLUDE(CMakeLocal.txt OPTIONAL) |
---|
34 | ENDIF(WIN32) |
---|
35 | |
---|
36 | FIND_PACKAGE(ITPP REQUIRED) |
---|
37 | FIND_PACKAGE(ACML COMPONENTS) |
---|
38 | #FIND_PACKAGE(XERCES COMPONENTS) |
---|
39 | |
---|
40 | IF(ITPP_FOUND) |
---|
41 | INCLUDE_DIRECTORIES(${ITPP_INCLUDE_DIR}) |
---|
42 | LINK_DIRECTORIES(${NATIVE_ITPP_LIB_PATH}) |
---|
43 | ENDIF(ITPP_FOUND) |
---|
44 | |
---|
45 | IF(ACML_FOUND) |
---|
46 | INCLUDE_DIRECTORIES(${ACML_INCLUDE_DIR}) |
---|
47 | LINK_DIRECTORIES(${NATIVE_ACML_LIB_PATH}) |
---|
48 | ENDIF(ACML_FOUND) |
---|
49 | |
---|
50 | ## |
---|
51 | ## PREPARE MACROS for building executables |
---|
52 | ## |
---|
53 | |
---|
54 | MACRO(EXEC FN) |
---|
55 | add_executable (${FN} ${FN}.cpp) |
---|
56 | target_link_libraries (${FN} debug itpp_debug) |
---|
57 | target_link_libraries (${FN} optimized itpp) |
---|
58 | IF(WIN32) |
---|
59 | target_link_libraries (${FN} libacml_dll) |
---|
60 | # ELSE(WIN32) |
---|
61 | # target_link_libraries (${FN} itpp) |
---|
62 | ENDIF(WIN32) |
---|
63 | target_link_libraries (${FN} bdm) |
---|
64 | target_link_libraries (${FN} ${ARGN}) ## Additional libraries can be added to a macro |
---|
65 | ENDMACRO(EXEC) |
---|
66 | |
---|
67 | |
---|
68 | # Local ettings should be written to file called CMakeLists.local |
---|
69 | # Use this option for machine-specific options, such as prallel architectures |
---|
70 | INCLUDE(CMakeLists.local OPTIONAL) |
---|
71 | |
---|
72 | # Recurse into the "dbm" and "tests" subdirectories. This does not actually |
---|
73 | # cause another cmake executable to run. The same process will walk through |
---|
74 | # the project's entire directory structure. |
---|
75 | add_subdirectory (bdm) |
---|
76 | add_subdirectory (tests) |
---|
77 | add_subdirectory (pmsm) |
---|
78 | #add_subdirectory (mpdm) |
---|
79 | add_subdirectory (library) |
---|
80 | #add_subdirectory (doprava) |
---|