root/CMakeLists.txt @ 316

Revision 316, 3.0 kB (checked in by mido, 15 years ago)

v mych WIN XP bezi buildmex.bat! vyhledove to zobecnime na vsechny WIN XP/VS 9.0

  • Property svn:eol-style set to native
RevLine 
[168]1# Compulsory line
2cmake_minimum_required(VERSION 2.6)
3
[19]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}.
7project (BDM)
8
[25]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
[35]11# list from within a CMakeLists.txt file as follows:
12set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}\\CMake_modules\\")
[25]13
[20]14######################
15#Platform specific
16IF(WIN32)
[111]17# IF YOU WANT TO USE YOUR OWN INSTALLATION OF THE NEXT EXTERNAL LIBRARIES,
[35]18# THEN IT IS NECESSARY TO CREATE TEXT FILE "\WIN32\LOCAL_PATHS.TXT" WITH
[316]19# COPIES OF THE TWO FOLLOWING LINES AND THEN CORECT ALL THE INVOLVED PATHS
[208]20        SET(ITPP_DIR "${BDM_SOURCE_DIR}\\win32\\itpp-4.0.6")
[38]21        SET(ACML_DIR "${BDM_SOURCE_DIR}\\win32\\acml3.6.0")
[111]22        SET(XERCES_DIR "${BDM_SOURCE_DIR}\\win32\\xerces-c_2_8_0-x86")
[35]23
24        INCLUDE(\\win32\\local_paths.txt OPTIONAL)     
[208]25        ADD_DEFINITIONS(-DHAVE_ACML)
[303]26ENDIF(WIN32)
27IF(APPLE)
28        SET(ITPP_DIR "${BDM_SOURCE_DIR}\\macosx\\itpp-4.0.6")
29        FIND_LIBRARY(FRAMEWORK_VECLIB vecLib)
30        ADD_DEFINITIONS(-DHAVE_XLOCALE_H)
31ENDIF(APPLE)
32IF(UNIX)
[113]33        #This is for UNIX makefile which does only one release at a time.
[285]34        SET(CMAKE_BUILD_TYPE Debug)
[307]35        SET(CMAKE_CXX_FLAGS "-Wall -pipe  -Wno-unknown-pragmas -fPIC")
36        SET(CMAKE_C_FLAGS "-Wall -pipe  -Wno-unknown-pragmas -fPIC")
[218]37        SET(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG -O2")
[260]38        SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
[270]39        #ADD_DEFINITIONS(-DNDEBUG)
[180]40        INCLUDE(CMakeLocal.txt OPTIONAL)       
[303]41ENDIF(UNIX)
[35]42
[113]43FIND_PACKAGE(ITPP REQUIRED)
44FIND_PACKAGE(ACML COMPONENTS)
[270]45#FIND_PACKAGE(XERCES COMPONENTS)
[25]46
[113]47IF(ITPP_FOUND)
48        INCLUDE_DIRECTORIES(${ITPP_INCLUDE_DIR})
49        LINK_DIRECTORIES(${NATIVE_ITPP_LIB_PATH})
50ENDIF(ITPP_FOUND)
[25]51
[113]52IF(ACML_FOUND)
53        INCLUDE_DIRECTORIES(${ACML_INCLUDE_DIR})
54        LINK_DIRECTORIES(${NATIVE_ACML_LIB_PATH})
55ENDIF(ACML_FOUND)
[25]56
[222]57##
58## PREPARE MACROS for building executables
59##
60
61MACRO(EXEC FN)
62        add_executable (${FN} ${FN}.cpp)
[303]63        IF(WIN32)
[279]64                target_link_libraries (${FN} debug itpp_debug)
65                target_link_libraries (${FN} optimized itpp)
66                target_link_libraries (${FN} libacml_dll)
[303]67        ELSE(WIN32)
68                IF(APPLE)
69                        target_link_libraries (${FN} ${FRAMEWORK_VECLIB})
70                ENDIF(APPLE)
71                target_link_libraries (${FN} itpp)     
[280]72        ENDIF(WIN32)
[279]73        target_link_libraries (${FN} bdm)
[222]74        target_link_libraries (${FN} ${ARGN}) ## Additional libraries can be added to a macro
75ENDMACRO(EXEC)
76
77
[129]78# Local ettings should be written to file called CMakeLists.local
79# Use this option for machine-specific options, such as prallel architectures
80INCLUDE(CMakeLists.local OPTIONAL)     
[68]81
[19]82# Recurse into the "dbm" and "tests" subdirectories.  This does not actually
83# cause another cmake executable to run.  The same process will walk through
84# the project's entire directory structure.
85add_subdirectory (bdm)
[134]86add_subdirectory (tests)
[279]87add_subdirectory (pmsm)
[286]88add_subdirectory (mpdm)
[271]89add_subdirectory (library)
[283]90add_subdirectory (doprava)
Note: See TracBrowser for help on using the browser.