Changeset 406 for library/CMakeLists.txt

Show
Ignore:
Timestamp:
07/02/09 22:16:09 (15 years ago)
Author:
smidl
Message:

Build system restructuring

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/CMakeLists.txt

    r384 r406  
    1212set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}\\system\\") 
    1313 
    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 "\system\WIN32\LOCAL_PATHS.TXT" WITH  
    19 # COPIES OF THE TWO FOLLOWING LINES AND THEN CORECT ALL THE INVOLVED PATHS 
    20         SET(ITPP_DIR "${BDM_SOURCE_DIR}\\system\\win32\\itpp-4.0.6") 
    21         SET(ACML_DIR "${BDM_SOURCE_DIR}\\system\\win32\\acml3.6.0") 
     14INCLUDE(SetBdmEnv) 
    2215 
    23         INCLUDE(\\system\\win32\\local_paths.txt OPTIONAL)       
    24         ADD_DEFINITIONS(-DHAVE_ACML) 
    25 ENDIF(WIN32) 
    26 IF(APPLE) 
    27         SET(ITPP_DIR "${BDM_SOURCE_DIR}\\macosx\\itpp-4.0.6") 
    28         FIND_LIBRARY(FRAMEWORK_VECLIB vecLib) 
    29         ADD_DEFINITIONS(-DHAVE_XLOCALE_H) 
    30 ENDIF(APPLE) 
    31 IF(UNIX) 
    32         #This is for UNIX makefile which does only one release at a time. 
    33         SET(CMAKE_BUILD_TYPE Debug) 
    34         SET(CMAKE_CXX_FLAGS "-Wall -pipe  -Wno-unknown-pragmas -fPIC") 
    35         SET(CMAKE_C_FLAGS "-Wall -pipe  -Wno-unknown-pragmas -fPIC") 
    36         SET(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG -O2") 
    37         SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0") 
    38         #ADD_DEFINITIONS(-DNDEBUG) 
    39          
    40         SET(MATLAB_ROOT ~/bin/matlab2008a) 
    41         # MATLAB_ROOT can be setup in Local 
    42 ENDIF(UNIX) 
    43  
    44 # Local ettings should be written to file called CMakeLists.local 
    45 # Use this option for machine-specific options, such as prallel architectures 
    46 INCLUDE(CMakeLists.local OPTIONAL)       
    47  
    48 FIND_PACKAGE(ITPP REQUIRED) 
    49 FIND_PACKAGE(ACML COMPONENTS) 
    50 FIND_PACKAGE(Matlab COMPONENTS) 
    51 FIND_PROGRAM(MEX_COMPILER mex) 
    52  
    53 IF(ITPP_FOUND) 
    54         INCLUDE_DIRECTORIES(${ITPP_INCLUDE_DIR}) 
    55         LINK_DIRECTORIES(${NATIVE_ITPP_LIB_PATH}) 
    56 ENDIF(ITPP_FOUND) 
    57  
    58 IF(ACML_FOUND) 
    59         INCLUDE_DIRECTORIES(${ACML_INCLUDE_DIR}) 
    60         LINK_DIRECTORIES(${NATIVE_ACML_LIB_PATH}) 
    61 ENDIF(ACML_FOUND) 
    62  
    63 ## 
    64 ## PREPARE MACROS for building executables 
    65 ## 
    66  
    67 MACRO(EXEC FN) 
    68         add_executable (${FN} ${FN}.cpp) 
    69         IF(WIN32) 
    70                 target_link_libraries (${FN} debug itpp_debug) 
    71                 target_link_libraries (${FN} optimized itpp) 
    72                 target_link_libraries (${FN} libacml_dll) 
    73         ELSE(WIN32) 
    74                 IF(APPLE) 
    75                         target_link_libraries (${FN} ${FRAMEWORK_VECLIB}) 
    76                 ENDIF(APPLE) 
    77 #               target_link_libraries (${FN} itpp)       
    78                 target_link_libraries (${FN} debug itpp_debug) 
    79                 target_link_libraries (${FN} optimized itpp) 
    80         ENDIF(WIN32) 
    81         target_link_libraries (${FN} bdm) 
    82         target_link_libraries (${FN} ${ARGN}) ## Additional libraries can be added to a macro 
    83 ENDMACRO(EXEC) 
    84          
    85  
    86  
    87 # Recurse into the "dbm" and "tests" subdirectories.  This does not actually 
     16# Recurse into the "bdm" and "tests" subdirectories.  This does not actually 
    8817# cause another cmake executable to run.  The same process will walk through 
    8918# the project's entire directory structure.