X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=cmake%2FCREAMacro_FindAndUseLibraries.cmake;h=52919c30b4c978cc78ceddf5ea20d15023fcfe86;hb=65a9959ce9e9bb6271544527094ee6dcadcb17ce;hp=1a4f02189df72ee286918018ecfaec576ae5d1e9;hpb=8426ba07aa7aced7b0c4ab7d693e9b50e83b36d6;p=crea.git diff --git a/cmake/CREAMacro_FindAndUseLibraries.cmake b/cmake/CREAMacro_FindAndUseLibraries.cmake index 1a4f021..52919c3 100644 --- a/cmake/CREAMacro_FindAndUseLibraries.cmake +++ b/cmake/CREAMacro_FindAndUseLibraries.cmake @@ -1,9 +1,9 @@ MACRO(CREA_FIND_AND_USE_LIBRARIES) -#MESSAGE(ERROR "EED CREAMacrp_FindAndUseLibraries") + IF(INCLUDE_CTEST) - include(CTEST) + include(CTest) ENDIF(INCLUDE_CTEST) @@ -26,6 +26,7 @@ ENDIF(USE_CREA) #----------------------------------------------------------------------------- + IF(USE_QT4) IF(NOT QT_FOUND) @@ -40,13 +41,17 @@ IF(USE_QT4) INCLUDE(${QT_USE_FILE}) CREA_DEFINE( USE_QT ) - # SET(QT_LIBRARIES - # ${QT_LIBRARIES} - # ) - # MARK_AS_ADVANCED(Qt4_DIR) + ENDIF(QT_FOUND) ENDIF(NOT QT_FOUND) ENDIF(USE_QT4) + + +#JFGA Pruebas WT +#MESSAGE ( "======================================= SET CMAKE USE_WT JFGA CREAMacro_FindAndUseLibraries.cmake") +#SET(USE_WT OFF) + + #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- @@ -85,7 +90,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 +110,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 +129,7 @@ ENDIF(USE_ITK) #----------------------------------------------------------------------------- + IF(USE_GDCM) IF (USE_GDCM2) MESSAGE(ERROR "CANNOT USE BOTH gdcm AND gdcm2 !") @@ -166,8 +181,15 @@ IF(USE_GDCM) ENDIF(USE_GDCM) #----------------------------------------------------------------------------- + IF(USE_GDCM2) + IF (USE_GDCM) + MESSAGE(ERROR "CANNOT USE BOTH gdcm AND gdcm2 !") + ENDIF (USE_GDCM) + +# IF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break) # Search GDCM2 + FIND_PACKAGE(GDCM REQUIRED) INCLUDE(${GDCM_USE_FILE}) @@ -187,8 +209,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_DIRS}) + LINK_DIRECTORIES( ${GDCM_LIBRARY_DIRS}) + SET(GDCM2_LIBRARIES ${GDCM_LIBRARIES} ) @@ -197,35 +220,58 @@ IF(USE_GDCM2) IF(USE_VTK) IF(WIN32) SET(GDCM_LIBRARIES - ${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} + ${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(USE_GDCM2) - - #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- +#-------------------- JFGA --- +IF(USE_WT) + MESSAGE ( "======================================= JFGA ------------USE WT CREAMacro_FindAndUseLibraries.cmake") + INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseWt.cmake) + CREA_FINDANDUSEWT() +ENDIF(USE_WT) + #----------------------------------------------------------------------------- IF(USE_WXWIDGETS) IF(NOT wxWidgets_FOUND) + INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseWxWidgets.cmake) CREA_FIND_WXWIDGETS(${USE_DEBUG_LIB}) CREA_USE_WXWIDGETS() + + + ENDIF(NOT wxWidgets_FOUND) ENDIF(USE_WXWIDGETS) #----------------------------------------------------------------------------- @@ -278,24 +324,29 @@ ENDIF(USE_TTH) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- IF(USE_BOOST) -message(STATUS "1") IF(NOT Boost_FOUND) - FIND_PACKAGE(Boost COMPONENTS filesystem signals date_time regex REQUIRED) - IF(Boost_FOUND) - message(STATUS "1 bis") + add_definitions( -DBOOST_ALL_NO_LIB ) + add_definitions( -DBOOST_ALL_DYN_LINK ) + IF (MINGW) + FIND_PACKAGE(Boost COMPONENTS filesystem-mgw71 system-mgw71 signals-mgw71 date_time-mgw71 thread-mgw71 regex-mgw71 program_options-mgw71 REQUIRED) + ELSE (MINGW) + FIND_PACKAGE(Boost COMPONENTS filesystem system signals date_time thread regex program_options REQUIRED) + ENDIF(MINGW) + IF(Boost_FOUND) + ADD_DEFINITIONS(-DBOOST_FILESYSTEM_VERSION=3) + ADD_DEFINITIONS(-DBOOST_MAYOR_VERSION=${Boost_MAJOR_VERSION}) + ADD_DEFINITIONS(-DBOOST_MINOR_VERSION=${Boost_MINOR_VERSION}) 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) - message("creamacro find and use lib = ${Boost_LIBRARIES}") - - CREA_DEFINE( USE_BOOST ) - + ADD_DEFINITIONS(-DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED) SET(BOOST_LIBRARIES ${Boost_LIBRARIES} ) + # FCY with cmake boost, it's useless. # But if it is not working, uncomment # @@ -317,13 +368,22 @@ message(STATUS "1") IF(NOT WIN32) SET(BOOST_LIBRARIES - boost_signals-mt - boost_filesystem-mt - boost_date_time-mt - boost_system-mt - boost_program_options-mt - boost_regex-mt - boost_thread-mt + + ${Boost_LIBRARIES} +#EED 10 Fev 2014 +#EED boost_system-mt +#EED boost_thread-mt +#EED 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) @@ -331,11 +391,9 @@ message(STATUS "1") MARK_AS_ADVANCED(Boost_LIBRARY_DIRS) ELSE(Boost_FOUND) - message(STATUS "2") - MESSAGE( "boost C++ library not found - Set Boost_INCLUDE_DIR to the directory containing boost headers") + MESSAGE( STATUS "boost C++ library not found - Set Boost_INCLUDE_DIR to the directory containing boost headers") ENDIF(Boost_FOUND) ENDIF(NOT Boost_FOUND) - message("${Boost_FOUND}") ENDIF(USE_BOOST) @@ -372,8 +430,9 @@ IF(USE_XERCES) SET(XERCES_LIBRARIES xerces-c ) INCLUDE_DIRECTORIES( /opt/local/include ) LINK_DIRECTORIES( /opt/local/lib ) - ELSEIF(APPLE) - SET(XERCES_LIBRARIES libxerces-c.so ) +#JCP 10/01/11 + ELSE(NOT APPLE) + SET(XERCES_LIBRARIES xerces-c ) INCLUDE_DIRECTORIES( /usr/local/include ) LINK_DIRECTORIES( /usr/local/lib /usr/lib) #FIND_PACKAGE(Xerces)