]> Creatis software - clitk.git/commitdiff
compilation issues
authorRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Thu, 8 Nov 2012 08:27:00 +0000 (09:27 +0100)
committerRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Thu, 8 Nov 2012 08:27:00 +0000 (09:27 +0100)
- simplification of RPATH assignment when make-installing
- handling the use of ITK with USE_SYSTEM_GDCM

CMakeLists.txt
common/CMakeLists.txt
registration/CMakeLists.txt
segmentation/CMakeLists.txt
tools/CMakeLists.txt
vv/CMakeLists.txt

index edc780a9de429ab3bdd73c04fee78ba1688874f7..ca68aa390d608473f6c1968e34bc54242c7385d3 100644 (file)
@@ -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)
index 76c19e6802bac93807ac73e3230f93118a6b7b0c..d895560cd6e273c31a0811f5e0345f6b44d6fda0 100644 (file)
@@ -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)
index 480fddb603d53c8b9166420579ce6a7a1bd243d4..64b55dccfa0e71a6b33e3be2e333980bf52db9a9 100644 (file)
@@ -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)
index f26ec74c203d0ee38e5df3dba5192b250d459a44..2e1ddac611cb2cf9ce1aef94770b71509641cd6d 100644 (file)
@@ -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)
index 7145cb20e85afa7bbd14865d25aa07fe24819c2e..9df72e16716cef85164834183d5d5b779ab735c0 100644 (file)
@@ -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)
index 5bb6f00af7acfca49429624343abfefc91fc82fe..dbb360c6085f2a235ad89444e2d8c022498da6af 100644 (file)
@@ -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 .)