From: Vivien Delmon Date: Wed, 14 Dec 2011 13:18:40 +0000 (+0100) Subject: Adapt CMakeLists to include it from other projects X-Git-Tag: v1.3.0~137 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9548105324e0d1e8d440a1e1d83faf37ebcf1c08;p=clitk.git Adapt CMakeLists to include it from other projects --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 75f52c4..4cd0dc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,18 +6,20 @@ if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) PROJECT(clitk) -SET(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR}) +IF(NOT DEFINED CLITK_SOURCE_DIR) + SET(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR}) +ENDIF(NOT DEFINED CLITK_SOURCE_DIR) #========================================================= #========================================================= -INCLUDE(cmake/common.cmake) -INCLUDE(cmake/dependencies.cmake) -INCLUDE(cmake/build_opt.cmake) +INCLUDE(${CLITK_SOURCE_DIR}/cmake/common.cmake) +INCLUDE(${CLITK_SOURCE_DIR}/cmake/dependencies.cmake) +INCLUDE(${CLITK_SOURCE_DIR}/cmake/build_opt.cmake) #========================================================= #========================================================= # Select what is compiled -ADD_SUBDIRECTORY(common) -ADD_SUBDIRECTORY(tools) -ADD_SUBDIRECTORY(segmentation) -ADD_SUBDIRECTORY(registration) +ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/common ${PROJECT_BINARY_DIR}/common) +ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) +ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/segmentation ${PROJECT_BINARY_DIR}/segmentation) +ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/registration ${PROJECT_BINARY_DIR}/registration)