1 | # Compulsory line |
---|
2 | cmake_minimum_required(VERSION 2.6) |
---|
3 | |
---|
4 | SET(BDM_SOURCE_DIR "/home/smidl/work/git/mixpp/library") |
---|
5 | SET(CMAKE_MODULE_PATH "${BDM_SOURCE_DIR}/system/") |
---|
6 | SET(ITPP_DIR "${BDM_SOURCE_DIR}/system/linux/") |
---|
7 | |
---|
8 | #MESSAGE(${CMAKE_MODULE_PATH}) |
---|
9 | |
---|
10 | # copy settings from library |
---|
11 | IF(WIN32) |
---|
12 | # IF YOU WANT TO USE YOUR OWN INSTALLATION OF THE NEXT EXTERNAL LIBRARIES, |
---|
13 | # THEN IT IS NECESSARY TO CREATE TEXT FILE "\system\WIN32\LOCAL_PATHS.TXT" WITH |
---|
14 | # COPIES OF THE TWO FOLLOWING LINES AND THEN CORECT ALL THE INVOLVED PATHS |
---|
15 | SET(ITPP_DIR "${BDM_SOURCE_DIR}\\system\\win32\\itpp-4.0.6") |
---|
16 | SET(ACML_DIR "${BDM_SOURCE_DIR}\\system\\win32\\acml3.6.0") |
---|
17 | |
---|
18 | INCLUDE(\\system\\win32\\local_paths.txt OPTIONAL) |
---|
19 | ADD_DEFINITIONS(-DHAVE_ACML) |
---|
20 | ENDIF(WIN32) |
---|
21 | IF(APPLE) |
---|
22 | SET(ITPP_DIR "${BDM_SOURCE_DIR}\\macosx\\itpp-4.0.6") |
---|
23 | FIND_LIBRARY(FRAMEWORK_VECLIB vecLib) |
---|
24 | ADD_DEFINITIONS(-DHAVE_XLOCALE_H) |
---|
25 | ENDIF(APPLE) |
---|
26 | IF(UNIX) |
---|
27 | #This is for UNIX makefile which does only one release at a time. |
---|
28 | SET(CMAKE_BUILD_TYPE Debug) |
---|
29 | SET(CMAKE_CXX_FLAGS "-Wall -pipe -Wno-unknown-pragmas -fPIC") |
---|
30 | SET(CMAKE_C_FLAGS "-Wall -pipe -Wno-unknown-pragmas -fPIC") |
---|
31 | SET(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG -O2") |
---|
32 | SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0") |
---|
33 | #ADD_DEFINITIONS(-DNDEBUG) |
---|
34 | |
---|
35 | SET(MATLAB_ROOT ~/bin/matlab2008a) |
---|
36 | # MATLAB_ROOT can be setup in Local |
---|
37 | ENDIF(UNIX) |
---|
38 | |
---|
39 | # Local ettings should be written to file called CMakeLists.local |
---|
40 | # Use this option for machine-specific options, such as prallel architectures |
---|
41 | INCLUDE(CMakeLists.local OPTIONAL) |
---|
42 | |
---|
43 | FIND_PACKAGE(ITPP REQUIRED) |
---|
44 | FIND_PACKAGE(ACML COMPONENTS) |
---|
45 | FIND_PACKAGE(Matlab COMPONENTS) |
---|
46 | FIND_PROGRAM(MEX_COMPILER mex) |
---|
47 | |
---|
48 | IF(ITPP_FOUND) |
---|
49 | INCLUDE_DIRECTORIES(${ITPP_INCLUDE_DIR}) |
---|
50 | LINK_DIRECTORIES(${NATIVE_ITPP_LIB_PATH}) |
---|
51 | ENDIF(ITPP_FOUND) |
---|
52 | |
---|
53 | IF(ACML_FOUND) |
---|
54 | INCLUDE_DIRECTORIES(${ACML_INCLUDE_DIR}) |
---|
55 | LINK_DIRECTORIES(${NATIVE_ACML_LIB_PATH}) |
---|
56 | ENDIF(ACML_FOUND) |
---|
57 | |
---|
58 | ## |
---|
59 | ## PREPARE MACROS for building executables |
---|
60 | ## |
---|
61 | |
---|
62 | MACRO(EXEC FN) |
---|
63 | add_executable (${FN} ${FN}.cpp) |
---|
64 | IF(WIN32) |
---|
65 | target_link_libraries (${FN} debug itpp_debug) |
---|
66 | target_link_libraries (${FN} optimized itpp) |
---|
67 | target_link_libraries (${FN} libacml_dll) |
---|
68 | ELSE(WIN32) |
---|
69 | IF(APPLE) |
---|
70 | target_link_libraries (${FN} ${FRAMEWORK_VECLIB}) |
---|
71 | ENDIF(APPLE) |
---|
72 | # target_link_libraries (${FN} itpp) |
---|
73 | target_link_libraries (${FN} debug itpp_debug) |
---|
74 | target_link_libraries (${FN} optimized itpp) |
---|
75 | ENDIF(WIN32) |
---|
76 | target_link_libraries (${FN} bdm) |
---|
77 | target_link_libraries (${FN} ${ARGN}) ## Additional libraries can be added to a macro |
---|
78 | ENDMACRO(EXEC) |
---|
79 | |
---|
80 | |
---|
81 | add_subdirectory (pmsm) |
---|
82 | add_subdirectory (mpdm) |
---|
83 | add_subdirectory (doprava) |
---|
84 | add_subdirectory (bdmtoolbox) |
---|