X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=cmake%2FCREAMacro_FindAndUseLibraries.cmake;h=d5d4aca330aa031b1eb1f1cee0c4e583b0935d9d;hb=c71406c4f316b505b659df7e78ace9bf470ed158;hp=a363495e5fa5fe58c2fb71d331ebb1dd8bab897f;hpb=dcab8273ee1401287fab043f09b308fb2d765f44;p=crea.git diff --git a/cmake/CREAMacro_FindAndUseLibraries.cmake b/cmake/CREAMacro_FindAndUseLibraries.cmake index a363495..d5d4aca 100644 --- a/cmake/CREAMacro_FindAndUseLibraries.cmake +++ b/cmake/CREAMacro_FindAndUseLibraries.cmake @@ -2,6 +2,46 @@ MACRO(CREA_FIND_AND_USE_LIBRARIES) +#----------------------------------------------------------------------------- +# If one can invoke this macro then crea has already been found !! +# However if one whishes to link against crea and crea was built +# with wx or vtk then we have to find them. +# This USE_CREA var is made to resolve this dependency. +IF(USE_CREA) + IF(CREA_BUILT_WITH_WX) + SET(USE_WXWIDGETS ON) + ENDIF(CREA_BUILT_WITH_WX) + IF(CREA_BUILT_WITH_VTK) + SET(USE_VTK ON) + ENDIF(CREA_BUILT_WITH_VTK) +ENDIF(USE_CREA) +#----------------------------------------------------------------------------- + + +#----------------------------------------------------------------------------- +IF(USE_QT4) + IF(NOT QT_FOUND) + + INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseQt.cmake) + #FIND_PACKAGE(Qt4 REQUIRED) + + IF(QT_FOUND) + MESSAGE ( STATUS "=======================================") + MESSAGE ( STATUS "Looking for QT4... found") + MESSAGE ( STATUS "* Inc Dir = ${QT_INCLUDE_DIR}") + MESSAGE ( STATUS "* Version = ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}") + 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) +#----------------------------------------------------------------------------- + #----------------------------------------------------------------------------- IF(USE_VTK) INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseVTK.cmake) @@ -51,6 +91,7 @@ IF(USE_ITK) MESSAGE ( STATUS "Looking for ITK... found") MESSAGE ( STATUS "* Dir = ${ITK_DIR}") MESSAGE ( STATUS "* Version = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}") + SET(SKIP_ITK_BUILD_SETTINGS_FILE ON) INCLUDE(${ITK_USE_FILE}) CREA_DEFINE( USE_ITK ) CREA_DEFINE( _USE_ITK_ ) @@ -196,7 +237,7 @@ ENDIF(USE_DOXYGEN) #----------------------------------------------------------------------------- -IF(USE_LATEX) +IF(USE_LATEX) IF (NOT LATEX_COMPILER) FIND_PACKAGE(LATEX REQUIRED) MESSAGE ( STATUS "=======================================") @@ -208,7 +249,8 @@ ENDIF(USE_LATEX) #----------------------------------------------------------------------------- IF(USE_TTH) IF (NOT TTH_EXECUTABLE) - FIND_FILE( TTH_EXECUTABLE NAME tth tth.exe PATHS . $ENV{CREATIS}/tth_exe/ ~/Creatis/tth ~/Creatis/tth_linux) + FIND_FILE( TTH_EXECUTABLE NAME tth tth.exe PATHS . $ENV{CREATIS}/tth_exe/ ~/Creatis/tth ~/Creatis/tth_linux $ENV{TTH}) + IF (NOT TTH_EXECUTABLE) MESSAGE(FATAL_ERROR "TTH not found (LATEX_tth_CONVERTER). Required to build the HTML documentation from tex source") ELSE (NOT TTH_EXECUTABLE) @@ -227,15 +269,51 @@ IF(USE_BOOST) IF(Boost_FOUND) MESSAGE ( STATUS "=======================================") MESSAGE ( STATUS "Looking for boost C++ library... - found in ${Boost_INCLUDE_DIR}") - INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) + 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 + + #message("creamacro find and use lib = ${Boost_SIGNALS_LIBRARY}") + SET(BOOST_LIBRARIES + boost_signals-vc90-mt-1_40 + boost_filesystem-vc90-mt-1_40 + boost_date_time-vc90-mt-1_40 + + #what about boost_thread? JPR + ) + ENDIF(WIN32) IF(NOT WIN32) - SET(BOOST_LIBRARIES - boost_signals - boost_filesystem - ) + IF(NOT 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_program_options-mt + boost_regex-mt + boost_thread-mt + ) + ENDIF(NOT 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")