From 9548105324e0d1e8d440a1e1d83faf37ebcf1c08 Mon Sep 17 00:00:00 2001 From: Vivien Delmon Date: Wed, 14 Dec 2011 14:18:40 +0100 Subject: [PATCH] Adapt CMakeLists to include it from other projects --- CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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) -- 2.47.1