X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=cmake%2FCREAMacro_FindAndUseLibraries.cmake;h=ff0a41be67d0fd5cba5d1e1ffc6df1f10d27d808;hb=72a6140565ccd0905f822c7bf17ea471762a9301;hp=ba9f33466ea8fa2cbbcfbf79620632f351bbc905;hpb=2a697011e9f49d1b394665cf956a2fdf4bb88100;p=crea.git diff --git a/cmake/CREAMacro_FindAndUseLibraries.cmake b/cmake/CREAMacro_FindAndUseLibraries.cmake index ba9f334..ff0a41b 100644 --- a/cmake/CREAMacro_FindAndUseLibraries.cmake +++ b/cmake/CREAMacro_FindAndUseLibraries.cmake @@ -85,7 +85,10 @@ IF(USE_KWWIDGETS) ENDIF(USE_KWWIDGETS) #----------------------------------------------------------------------------- - +# --- W A R N I N G : +# Always let ITK *BEFORE* GDCM +# It allows to use 'system installed gdcm' instead of 'itk embedded gdcm' +# #----------------------------------------------------------------------------- IF(USE_ITK) @@ -102,9 +105,15 @@ IF(USE_ITK) INCLUDE(${ITK_USE_FILE}) CREA_DEFINE( USE_ITK ) CREA_DEFINE( _USE_ITK_ ) - SET(ITK_LIBRARIES - ITKCommon ITKIO ITKBasicFilters ITKAlgorithms - ) + If (${ITK_VERSION_MAJOR} MATCHES "4") + MESSAGE ( STATUS "* Version = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}") + SET(ITK_LIBRARIES + ${ITK_LIBRARIES}) + MESSAGE ( STATUS "${ITK_LIBRARIES}") + ELSEIF() + SET(ITK_LIBRARIES + ITKCommon ITKIO ITKBasicFilters ITKAlgorithms) + ENDIF() MARK_AS_ADVANCED(ITK_DIR) ELSE(ITK_FOUND) message(FATAL_ERROR "ITK_DIR not found") @@ -115,6 +124,7 @@ ENDIF(USE_ITK) #----------------------------------------------------------------------------- + IF(USE_GDCM) IF (USE_GDCM2) MESSAGE(ERROR "CANNOT USE BOTH gdcm AND gdcm2 !") @@ -172,8 +182,9 @@ IF(USE_GDCM2) MESSAGE(ERROR "CANNOT USE BOTH gdcm AND gdcm2 !") ENDIF (USE_GDCM) - IF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break) +# IF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break) # Search GDCM2 + FIND_PACKAGE(GDCM REQUIRED) INCLUDE(${GDCM_USE_FILE}) @@ -193,9 +204,9 @@ IF(USE_GDCM2) # Test that GDCM_NAME_SPACE is **NOT** "gdcm" or will conflict with # embedded gdcm in ITK and will result in hard seg faults ! - INCLUDE_DIRECTORIES(${GDCM_INCLUDE_DIR}) - LINK_DIRECTORIES( ${GDCM_LIBRARY_DIR}) - + INCLUDE_DIRECTORIES(${GDCM_INCLUDE_DIRS}) + LINK_DIRECTORIES( ${GDCM_LIBRARY_DIRS}) + SET(GDCM2_LIBRARIES ${GDCM_LIBRARIES} ) @@ -206,18 +217,32 @@ IF(USE_GDCM2) SET(GDCM_LIBRARIES ${GDCM_LIBRARIES} vtkgdcm - #gdcm2vtk + gdcmIOD + gdcmMSFF + gdcmexpat + gdcmCommon + gdcmMEXD + gdcmexpat + gdcmDSED + gdcmDICT + gdcmjpeg8 + gdcmjpeg12 + gdcmjpeg16 + socketxx + gdcmopenjpeg + gdcmcharls ) ELSE(WIN32) SET(GDCM_LIBRARIES ${GDCM_LIBRARIES} vtkgdcm + gdcmIOD ) ENDIF(WIN32) ENDIF(USE_VTK) ENDIF(USE_GDCM_VTK) - ENDIF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break) + # ENDIF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break) ENDIF(USE_GDCM2) @@ -284,15 +309,15 @@ ENDIF(USE_TTH) #----------------------------------------------------------------------------- IF(USE_BOOST) IF(NOT Boost_FOUND) - FIND_PACKAGE(Boost COMPONENTS filesystem signals date_time regex REQUIRED) + FIND_PACKAGE(Boost COMPONENTS filesystem system signals date_time regex REQUIRED) IF(Boost_FOUND) MESSAGE ( STATUS "=======================================") MESSAGE ( STATUS "Looking for boost C++ library... - found in ${Boost_INCLUDE_DIR}") INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) - LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS}) + LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS}) IF(WIN32) CREA_DEFINE( USE_BOOST ) - + ADD_DEFINITIONS(-DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED) SET(BOOST_LIBRARIES ${Boost_LIBRARIES} ) @@ -317,13 +342,21 @@ IF(USE_BOOST) IF(NOT WIN32) SET(BOOST_LIBRARIES - boost_signals-mt - boost_filesystem-mt - boost_date_time-mt + + ${Boost_LIBRARIES} boost_system-mt - boost_program_options-mt - boost_regex-mt boost_thread-mt + boost_program_options-mt + +#EED 03 mars 2011 +#EED boost_signals-mt +#EED boost_filesystem-mt +#EED boost_date_time-mt +#EED boost_system-mt +#EED boost_program_options-mt +#EED boost_regex-mt +#EED boost_thread-mt + ) ENDIF(NOT WIN32)