]> Creatis software - clitk.git/blob - cmake/common.cmake
Debug clitkNormalizeImage
[clitk.git] / cmake / common.cmake
1 #=========================================================
2 macro(DD in)
3     message(${in}=${${in}})
4 endmacro(DD)
5 #=========================================================
6
7 #=========================================================
8 #Set a reasonable build mode default if the user hasn't set any
9 if (NOT CMAKE_BUILD_TYPE)
10   set(CMAKE_BUILD_TYPE Release)
11 endif (NOT CMAKE_BUILD_TYPE)
12
13 #=========================================================
14 include_directories(${CLITK_SOURCE_DIR}/itk
15   ${CLITK_SOURCE_DIR}/filters
16   ${CLITK_SOURCE_DIR}/segmentation
17   ${CLITK_SOURCE_DIR}/registration
18   ${CLITK_SOURCE_DIR}/tools
19   ${CLITK_SOURCE_DIR}/common
20   ${PROJECT_BINARY_DIR})
21 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
22 set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
23 link_directories(${PROJECT_BINARY_DIR}/lib)
24 include_directories(${PROJECT_BINARY_DIR}/tools)         #For _ggo.h includes from other directories
25 include_directories(${PROJECT_BINARY_DIR}/segmentation)  #For _ggo.h includes from other directories
26 include_directories(${PROJECT_BINARY_DIR}/registration)  #For _ggo.h includes from other directories
27 #=========================================================
28
29 #=========================================================
30 # Building in the source tree is forbidden
31 if(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
32   message(FATAL_ERROR "Building in the source tree is not allowed ! Quit; remove the file 'CMakeCache.txt' and the folder 'CMakeFiles' an
33 d build outside the sources (for example 'mkdir build ; cmake <CLITK_DIR>'.")
34 endif(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
35 #=========================================================
36
37 #=========================================================
38 # Remove some MS Visual c++ flags
39 if(MSVC)
40   add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
41 endif(MSVC)
42 #=========================================================