]> Creatis software - clitk.git/commitdiff
Adapt CMakeLists to include it from other projects
authorVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Wed, 14 Dec 2011 13:18:40 +0000 (14:18 +0100)
committerVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Wed, 14 Dec 2011 13:18:40 +0000 (14:18 +0100)
CMakeLists.txt

index 75f52c44af3ac5c5e3af2b0b07c5c7df068f541b..4cd0dc9de7c8d8e4a4a27038a2d10f64e5fd8175 100644 (file)
@@ -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)