From: Romulo Pinho Date: Thu, 8 Nov 2012 08:27:00 +0000 (+0100) Subject: compilation issues X-Git-Tag: v1.4.0~239^2~13^2~6 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=04be889e60bbc55d8db64d426d48aa51b6a688f1;p=clitk.git compilation issues - simplification of RPATH assignment when make-installing - handling the use of ITK with USE_SYSTEM_GDCM --- diff --git a/CMakeLists.txt b/CMakeLists.txt index edc780a..ca68aa3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,11 @@ #========================================================= # CLITK = Command Line ITK +PROJECT(clitk) cmake_minimum_required(VERSION 2.8) cmake_policy(VERSION 2.8) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) -PROJECT(clitk) IF(NOT DEFINED CLITK_SOURCE_DIR) SET(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR}) ENDIF(NOT DEFINED CLITK_SOURCE_DIR) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 76c19e6..d895560 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -51,7 +51,24 @@ IF(NOT ${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND") TARGET_LINK_LIBRARIES(clitkCommon statgrab) ENDIF(NOT ${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND") -TARGET_LINK_LIBRARIES(clitkCommon vtkCommon vtkImaging ${ITK_LIBRARIES}) +### Check if ITK was compiled with SYSTEM_GDCM = ON and set the gdcm libraries accordingly +SET(CLITK_USE_SYSTEM_GDCM FALSE) +IF(ITK_VERSION_MAJOR LESS "4") + IF(ITK_USE_SYSTEM_GDCM) + SET(CLITK_USE_SYSTEM_GDCM TRUE) + ENDIF(ITK_USE_SYSTEM_GDCM) +ELSE(ITK_VERSION_MAJOR LESS "4") + SET(GDCM_INCLUDE ".*include/gdcm-.*") + IF(ITKGDCM_INCLUDE_DIRS MATCHES ${GDCM_INCLUDE}) + SET(CLITK_USE_SYSTEM_GDCM TRUE) + ENDIF(ITKGDCM_INCLUDE_DIRS MATCHES ${GDCM_INCLUDE}) +ENDIF(ITK_VERSION_MAJOR LESS "4") + +IF(CLITK_USE_SYSTEM_GDCM) + SET(CLITK_GDCM_LIBRARIES gdcmDSED) +ENDIF(CLITK_USE_SYSTEM_GDCM) + +TARGET_LINK_LIBRARIES(clitkCommon vtkCommon vtkImaging ${ITK_LIBRARIES} ${CLITK_GDCM_LIBRARIES}) ADD_LIBRARY(clitkDicomRTStruct STATIC clitkDicomRT_Contour.cxx @@ -60,7 +77,7 @@ ADD_LIBRARY(clitkDicomRTStruct STATIC clitkDicomRTStruct2ImageFilter.cxx ) -TARGET_LINK_LIBRARIES(clitkDicomRTStruct vtkHybrid) +TARGET_LINK_LIBRARIES(clitkDicomRTStruct vtkHybrid ${CLITK_GDCM_LIBRARIES}) #ADD_LIBRARY(clitkCommonShared SHARED ${clitkCommon_SRC}) #SET_TARGET_PROPERTIES(clitkCommonShared PROPERTIES COMPILE_FLAGS -fPIC) diff --git a/registration/CMakeLists.txt b/registration/CMakeLists.txt index 480fddb..64b55dc 100644 --- a/registration/CMakeLists.txt +++ b/registration/CMakeLists.txt @@ -44,7 +44,7 @@ IF(CLITK_BUILD_REGISTRATION) TARGET_LINK_LIBRARIES(clitkConvertBSplineDeformableTransformToVF clitkCommon ${ITK_LIBRARIES}) SET(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkConvertBSplineDeformableTransformToVF) - SET_TARGET_PROPERTIES(${REGISTRATION_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" ) +# SET_TARGET_PROPERTIES(${REGISTRATION_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" ) INSTALL (TARGETS ${REGISTRATION_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) ENDIF(CLITK_BUILD_REGISTRATION) diff --git a/segmentation/CMakeLists.txt b/segmentation/CMakeLists.txt index f26ec74..2e1ddac 100644 --- a/segmentation/CMakeLists.txt +++ b/segmentation/CMakeLists.txt @@ -50,7 +50,7 @@ IF(CLITK_BUILD_SEGMENTATION) ADD_EXECUTABLE(clitkRegionGrowing clitkRegionGrowing.cxx ${clitkRegionGrowing_GGO_C} ${clitkRelativePosition_GGO_C}) TARGET_LINK_LIBRARIES(clitkRegionGrowing clitkCommon ${ITK_LIBRARIES}) - SET_TARGET_PROPERTIES(${SEGMENTATION_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" ) +# SET_TARGET_PROPERTIES(${SEGMENTATION_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" ) INSTALL (TARGETS ${SEGMENTATION_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) ENDIF(CLITK_BUILD_SEGMENTATION) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 7145cb2..9df72e1 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -256,7 +256,7 @@ IF (CLITK_BUILD_TOOLS) SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicomRTPlan2Gate) ENDIF(ITK_VERSION_MAJOR VERSION_LESS 4) - SET_TARGET_PROPERTIES(${TOOLS_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" ) +# SET_TARGET_PROPERTIES(${TOOLS_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" ) INSTALL (TARGETS ${TOOLS_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) ENDIF(CLITK_BUILD_TOOLS) diff --git a/vv/CMakeLists.txt b/vv/CMakeLists.txt index 5bb6f00..dbb360c 100644 --- a/vv/CMakeLists.txt +++ b/vv/CMakeLists.txt @@ -236,8 +236,8 @@ TARGET_LINK_LIBRARIES(vv vvLib) #========================================================= # Install options (also used by CPack) IF(UNIX OR APPLE) - SET_TARGET_PROPERTIES(vv - PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}") +# SET_TARGET_PROPERTIES(vv +# PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}") INSTALL (TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) # INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/ducky.png DESTINATION .)