X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=cmake%2Fcommon.cmake;h=226064867e3e23cc3563abcc4b5b87c394af33fb;hb=3679ae18afeecb43cc9deab389723e69a64c5daf;hp=3239e966efa3e5dd121bfdfc4baa97fcbb1b4d55;hpb=91eacd1b09351ab508c9688f1071c5ea1e2b01b8;p=clitk.git diff --git a/cmake/common.cmake b/cmake/common.cmake index 3239e96..2260648 100644 --- a/cmake/common.cmake +++ b/cmake/common.cmake @@ -1,22 +1,42 @@ #========================================================= -MACRO (DD in) - MESSAGE(${in}=${${in}}) -ENDMACRO(DD) +macro(DD in) + message(${in}=${${in}}) +endmacro(DD) #========================================================= - #========================================================= #Set a reasonable build mode default if the user hasn't set any if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_BUILD_TYPE) + +#========================================================= +include_directories(${CLITK_SOURCE_DIR}/itk + ${CLITK_SOURCE_DIR}/filters + ${CLITK_SOURCE_DIR}/segmentation + ${CLITK_SOURCE_DIR}/registration + ${CLITK_SOURCE_DIR}/tools + ${CLITK_SOURCE_DIR}/common + ${PROJECT_BINARY_DIR}) +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) +set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) +link_directories(${PROJECT_BINARY_DIR}/lib) +include_directories(${PROJECT_BINARY_DIR}/tools) #For _ggo.h includes from other directories +include_directories(${PROJECT_BINARY_DIR}/segmentation) #For _ggo.h includes from other directories +include_directories(${PROJECT_BINARY_DIR}/registration) #For _ggo.h includes from other directories +#========================================================= + +#========================================================= +# Building in the source tree is forbidden +if(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) + message(FATAL_ERROR "Building in the source tree is not allowed ! Quit; remove the file 'CMakeCache.txt' and the folder 'CMakeFiles' an +d build outside the sources (for example 'mkdir build ; cmake '.") +endif(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) +#========================================================= + #========================================================= -SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) -SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) -LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lib) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/common) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/tools) -INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/tools) #For _ggo.h includes from other directories -INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/segmentation) #For _ggo.h includes from other directories -INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/registration) #For _ggo.h includes from other directories +# Remove some MS Visual c++ flags +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS) +endif(MSVC) #=========================================================