root/CMakeLists.txt @ 260

Revision 260, 2.7 kB (checked in by smidl, 15 years ago)

working UI example

  • 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
[143]19# COPIES OF THE TWO FOLLOWING LINES AND THEN CORECT ALL 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)
[118]26ELSE()
[113]27        #This is for UNIX makefile which does only one release at a time.
[256]28        SET(CMAKE_BUILD_TYPE Debug)
[218]29        SET(CMAKE_CXX_FLAGS "-Wall -pipe  -Wno-unknown-pragmas")
30        SET(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG -O2")
[260]31        SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
32        SET(CMAKE_CXX_FLAGS "-Wall -Wno-unknown-pragmas")
[247]33        ADD_DEFINITIONS(-DNDEBUG)
[180]34        INCLUDE(CMakeLocal.txt OPTIONAL)       
[113]35ENDIF(WIN32)
[35]36
[113]37FIND_PACKAGE(ITPP REQUIRED)
38FIND_PACKAGE(ACML COMPONENTS)
[235]39FIND_PACKAGE(XERCES COMPONENTS)
[25]40
[113]41IF(ITPP_FOUND)
42        INCLUDE_DIRECTORIES(${ITPP_INCLUDE_DIR})
43        LINK_DIRECTORIES(${NATIVE_ITPP_LIB_PATH})
44ENDIF(ITPP_FOUND)
[25]45
[113]46IF(ACML_FOUND)
47        INCLUDE_DIRECTORIES(${ACML_INCLUDE_DIR})
48        LINK_DIRECTORIES(${NATIVE_ACML_LIB_PATH})
49ENDIF(ACML_FOUND)
[25]50
[113]51IF(XERCES_FOUND)
52        INCLUDE_DIRECTORIES(${XERCES_INCLUDE_DIR})
53        LINK_DIRECTORIES(${NATIVE_XERCES_LIB_PATH})
54ENDIF(XERCES_FOUND)
[111]55
[222]56##
57## PREPARE MACROS for building executables
58##
59
60IF(WIN32)
61        SET(AddLib libacml_dll)
62ENDIF(WIN32)
63
64MACRO(EXEC FN)
65        add_executable (${FN} ${FN}.cpp)
66        target_link_libraries (${FN} debug itpp_debug)
67        target_link_libraries (${FN} optimized itpp)
68        target_link_libraries (${FN} bdm ${AddLib})
69        target_link_libraries (${FN} ${ARGN}) ## Additional libraries can be added to a macro
70ENDMACRO(EXEC)
71
72
[129]73# Local ettings should be written to file called CMakeLists.local
74# Use this option for machine-specific options, such as prallel architectures
75INCLUDE(CMakeLists.local OPTIONAL)     
[68]76
[19]77# Recurse into the "dbm" and "tests" subdirectories.  This does not actually
78# cause another cmake executable to run.  The same process will walk through
79# the project's entire directory structure.
80add_subdirectory (bdm)
[134]81add_subdirectory (tests)
[73]82add_subdirectory (pmsm)
[161]83add_subdirectory (mpdm)
[195]84add_subdirectory (doprava)
Note: See TracBrowser for help on using the browser.