X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=cmake%2FCREAMacro_FindAndUseLibraries.cmake;h=b6935c28d3f12416099c405e0a8ea2bccde63149;hb=41e6b6003e71b53e28c72925442eaec6469c736e;hp=33499da1f9980e03db97ee2faa9bdc60750dd2cc;hpb=251ef0d5fc2bf01a1860939a81070091007a278a;p=crea.git diff --git a/cmake/CREAMacro_FindAndUseLibraries.cmake b/cmake/CREAMacro_FindAndUseLibraries.cmake index 33499da..b6935c2 100644 --- a/cmake/CREAMacro_FindAndUseLibraries.cmake +++ b/cmake/CREAMacro_FindAndUseLibraries.cmake @@ -1,7 +1,7 @@ MACRO(CREA_FIND_AND_USE_LIBRARIES) - +#MESSAGE(ERROR "EED CREAMacrp_FindAndUseLibraries") set(USE_DEBUG_LIB "" CACHE BOOL "Use Debug Libraries" ) #----------------------------------------------------------------------------- @@ -84,8 +84,7 @@ ENDIF(USE_KWWIDGETS) #----------------------------------------------------------------------------- IF(USE_ITK) - IF(NOT ITK_FOUND) - + IF(NOT ITK_FOUND) # Search ITK FIND_PACKAGE(ITK) # If itk found @@ -123,13 +122,13 @@ IF(USE_GDCM) IF(GDCM_FOUND) INCLUDE(${GDCM_USE_FILE}) CREA_DEFINE( USE_GDCM ) - + MESSAGE ( STATUS "=======================================") MESSAGE ( STATUS "Looking for GDCM... found") MESSAGE ( STATUS "* Dir = ${GDCM_DIR}") MESSAGE ( STATUS "* Version = ${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}") MESSAGE ( STATUS "* Namespace = ${GDCM_NAME_SPACE}") - + # Test that GDCM_NAME_SPACE is **NOT** "gdcm" or will conflict with # embedded gdcm in ITK and will result in hard seg faults ! IF(USE_ITK) @@ -137,13 +136,13 @@ IF(USE_GDCM) MESSAGE(FATAL_ERROR "GDCM_NAME_SPACE value is 'gdcm' which conflicts with ITK embededd gdcm namespace : rebuild gdcm with another GDCM_NAME_SPACE value") ENDIF (GDCM_NAME_SPACE STREQUAL "gdcm") ENDIF(USE_ITK) - + MARK_AS_ADVANCED(GDCM_DIR) - + SET(GDCM_LIBRARIES ${GDCM_LIBRARIES} ) - + # TODO : Test that GDCM was built with option "vtkgdcm" IF(USE_GDCM_VTK) IF(USE_VTK) @@ -158,22 +157,18 @@ IF(USE_GDCM) ENDIF(NOT GDCM_FOUND) ENDIF(USE_GDCM) -#----------------------------------------------------------------------------- - #----------------------------------------------------------------------------- IF(USE_GDCM2) - IF(NOT GDCM_FOUND) # Search GDCM2 - FIND_PACKAGE(GDCM) - # If gdcm found - IF(GDCM_FOUND) - INCLUDE(${GDCM_USE_FILE}) - + FIND_PACKAGE(GDCM REQUIRED) + INCLUDE(${GDCM_USE_FILE}) + IF(NOT ${GDCM_MAJOR_VERSION} EQUAL 2) MESSAGE(FATAL_ERROR "gdcm version 2 needed. found ${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}. Set GDCM_DIR to the gdcm version 2 directory") ENDIF(NOT ${GDCM_MAJOR_VERSION} EQUAL 2) CREA_DEFINE( USE_GDCM2 ) + MARK_AS_ADVANCED(GDCM_DIR) CREA_DEFINE_WITH_VAL( GDCM_NAME_SPACE gdcm ) MESSAGE ( STATUS "=======================================") @@ -184,32 +179,29 @@ 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 ! - IF(USE_ITK) - IF (GDCM_NAME_SPACE STREQUAL "gdcm") - MESSAGE(FATAL_ERROR "GDCM_NAME_SPACE value is 'gdcm' which conflicts with ITK embededd gdcm namespace : rebuild gdcm with another GDCM_NAME_SPACE value") - ENDIF (GDCM_NAME_SPACE STREQUAL "gdcm") - ENDIF(USE_ITK) - - MARK_AS_ADVANCED(GDCM_DIR) - - SET(GDCM_LIBRARIES + + + SET(GDCM2_LIBRARIES ${GDCM_LIBRARIES} ) - - # TODO : Test that GDCM was built with option "vtkgdcm" + IF(USE_GDCM_VTK) IF(USE_VTK) SET(GDCM_LIBRARIES ${GDCM_LIBRARIES} - vtkgdcm + vtkgdcm + gdcm2vtk ) ENDIF(USE_VTK) ENDIF(USE_GDCM_VTK) - ENDIF(GDCM_FOUND) - ENDIF(NOT GDCM_FOUND) + ENDIF(USE_GDCM2) + + +#----------------------------------------------------------------------------- + #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- @@ -240,11 +232,14 @@ ENDIF(USE_DOXYGEN) #----------------------------------------------------------------------------- -IF(USE_LATEX) +IF(USE_LATEX) IF (NOT LATEX_COMPILER) FIND_PACKAGE(LATEX REQUIRED) MESSAGE ( STATUS "=======================================") MESSAGE(STATUS "Looking for latex... - found ${LATEX_COMPILER}") + IF (NOT LATEX_FOUND) + MESSAGE(FATAL_ERROR "LATEX_COMPILER NOT FOUND. Example:latex (MacOS:/opt/local/bin/latex)") + ENDIF (NOT LATEX_FOUND) ENDIF (NOT LATEX_COMPILER) ENDIF(USE_LATEX) @@ -275,17 +270,11 @@ IF(USE_BOOST) MESSAGE ( STATUS "Looking for boost C++ library... - found in ${Boost_INCLUDE_DIR}") INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} ) - + CREA_DEFINE( USE_BOOST ) IF(WIN32) - LINK_DIRECTORIES( ${Boost_INCLUDE_DIRS}/stage/lib) #JCP 01/10/2009 - #LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS}) - #MESSAGE ("EED " ${Boost_LIBRARY_DIRS}) - #libboost_signals-vc71-mt-1_37 - #libboost_filesystem-vc71-mt-1_37 - #boost_date_time-vc71-mt-1_37 - + LINK_DIRECTORIES( ${Boost_INCLUDE_DIRS}/Bin/lib) #message("creamacro find and use lib = ${Boost_SIGNALS_LIBRARY}") IF(USE_DEBUG_LIB) SET(BOOST_LIBRARIES @@ -303,28 +292,17 @@ IF(USE_BOOST) ENDIF(USE_DEBUG_LIB) ENDIF(WIN32) IF(NOT WIN32) - IF(APPLE) - SET(BOOST_LIBRARIES - boost_signals - boost_filesystem - boost_date_time - boost_program_options - boost_regex - boost_thread - ) - ELSE(NOT APPLE) SET(BOOST_LIBRARIES boost_signals-mt boost_filesystem-mt boost_date_time-mt - boost_system-mt + boost_system-mt boost_program_options-mt boost_regex-mt boost_thread-mt ) - ENDIF(APPLE) ENDIF(NOT WIN32) - + MARK_AS_ADVANCED(Boost_INCLUDE_DIR) ELSE(Boost_FOUND) MESSAGE(FATAL_ERROR "boost C++ library not found - Set Boost_INCLUDE_DIR to the directory containing boost headers")