3 MACRO(CREA_FIND_AND_USE_LIBRARIES)
5 #-----------------------------------------------------------------------------
6 # If one can invoke this macro then crea has already been found !!
7 # However if one whishes to link against crea and crea was built
8 # with wx or vtk then we have to find them.
9 # This USE_CREA var is made to resolve this dependency.
11 IF(CREA_BUILT_WITH_WX)
13 ENDIF(CREA_BUILT_WITH_WX)
14 IF(CREA_BUILT_WITH_VTK)
16 ENDIF(CREA_BUILT_WITH_VTK)
18 #-----------------------------------------------------------------------------
21 #-----------------------------------------------------------------------------
25 INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseQt.cmake)
26 #FIND_PACKAGE(Qt4 REQUIRED)
29 MESSAGE ( STATUS "=======================================")
30 MESSAGE ( STATUS "Looking for QT4... found")
31 MESSAGE ( STATUS "* Inc Dir = ${QT_INCLUDE_DIR}")
32 MESSAGE ( STATUS "* Version = ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
33 INCLUDE(${QT_USE_FILE})
39 # MARK_AS_ADVANCED(Qt4_DIR)
43 #-----------------------------------------------------------------------------
45 #-----------------------------------------------------------------------------
47 INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseVTK.cmake)
48 CREA_FIND_AND_USE_VTK()
50 #-----------------------------------------------------------------------------
52 #-----------------------------------------------------------------------------
54 IF(NOT KWWidgets_FOUND)
56 FIND_PACKAGE(KWWidgets)
59 MESSAGE ( STATUS "=======================================")
60 MESSAGE ( STATUS "Looking for KWWidgets... found")
61 MESSAGE ( STATUS "* Dir = ${KWWidgets_DIR}")
62 MESSAGE ( STATUS "* Version = ${KWWidgets_MAJOR_VERSION}.${KWWidgets_MINOR_VERSION}.${KWWidgets_BUILD_VERSION}")
64 # KWWidgets must not search again for vtk !
65 SET(KWWidgets_NO_USE_VTK ON)
68 INCLUDE(${KWWidgets_USE_FILE})
69 CREA_DEFINE( USE_KWWIDGETS )
70 SET(KWWIDGETS_LIBRARIES
71 ${KWWidgets_LIBRARIES}
73 MARK_AS_ADVANCED(KWWidgets_DIR)
75 message(FATAL_ERROR "KWWidgets_DIR not found")
76 ENDIF(KWWidgets_FOUND)
77 ENDIF(NOT KWWidgets_FOUND)
79 #-----------------------------------------------------------------------------
83 #-----------------------------------------------------------------------------
90 MESSAGE ( STATUS "=======================================")
91 MESSAGE ( STATUS "Looking for ITK... found")
92 MESSAGE ( STATUS "* Dir = ${ITK_DIR}")
93 MESSAGE ( STATUS "* Version = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}")
94 SET(SKIP_ITK_BUILD_SETTINGS_FILE ON)
95 INCLUDE(${ITK_USE_FILE})
96 CREA_DEFINE( USE_ITK )
97 CREA_DEFINE( _USE_ITK_ )
99 ITKCommon ITKIO ITKBasicFilters ITKAlgorithms
101 MARK_AS_ADVANCED(ITK_DIR)
103 message(FATAL_ERROR "ITK_DIR not found")
107 #-----------------------------------------------------------------------------
110 #-----------------------------------------------------------------------------
113 MESSAGE(ERROR "CANNOT USE BOTH gdcm AND gdcm2 !")
121 INCLUDE(${GDCM_USE_FILE})
122 CREA_DEFINE( USE_GDCM )
124 MESSAGE ( STATUS "=======================================")
125 MESSAGE ( STATUS "Looking for GDCM... found")
126 MESSAGE ( STATUS "* Dir = ${GDCM_DIR}")
127 MESSAGE ( STATUS "* Version = ${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
128 MESSAGE ( STATUS "* Namespace = ${GDCM_NAME_SPACE}")
130 # Test that GDCM_NAME_SPACE is **NOT** "gdcm" or will conflict with
131 # embedded gdcm in ITK and will result in hard seg faults !
133 IF (GDCM_NAME_SPACE STREQUAL "gdcm")
134 MESSAGE(FATAL_ERROR "GDCM_NAME_SPACE value is 'gdcm' which conflicts with ITK embededd gdcm namespace : rebuild gdcm with another GDCM_NAME_SPACE value")
135 ENDIF (GDCM_NAME_SPACE STREQUAL "gdcm")
138 MARK_AS_ADVANCED(GDCM_DIR)
144 # TODO : Test that GDCM was built with option "vtkgdcm"
155 ENDIF(NOT GDCM_FOUND)
158 #-----------------------------------------------------------------------------
160 #-----------------------------------------------------------------------------
167 INCLUDE(${GDCM_USE_FILE})
169 IF(NOT ${GDCM_MAJOR_VERSION} EQUAL 2)
170 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")
171 ENDIF(NOT ${GDCM_MAJOR_VERSION} EQUAL 2)
173 CREA_DEFINE( USE_GDCM2 )
174 CREA_DEFINE_WITH_VAL( GDCM_NAME_SPACE gdcm )
176 MESSAGE ( STATUS "=======================================")
177 MESSAGE ( STATUS "Looking for GDCM2... found")
178 MESSAGE ( STATUS "* Dir = ${GDCM_DIR}")
179 MESSAGE ( STATUS "* Version = ${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
180 MESSAGE ( STATUS "* Namespace = ${GDCM_NAME_SPACE}")
182 # Test that GDCM_NAME_SPACE is **NOT** "gdcm" or will conflict with
183 # embedded gdcm in ITK and will result in hard seg faults !
185 IF (GDCM_NAME_SPACE STREQUAL "gdcm")
186 MESSAGE(FATAL_ERROR "GDCM_NAME_SPACE value is 'gdcm' which conflicts with ITK embededd gdcm namespace : rebuild gdcm with another GDCM_NAME_SPACE value")
187 ENDIF (GDCM_NAME_SPACE STREQUAL "gdcm")
190 MARK_AS_ADVANCED(GDCM_DIR)
196 # TODO : Test that GDCM was built with option "vtkgdcm"
207 ENDIF(NOT GDCM_FOUND)
210 #-----------------------------------------------------------------------------
212 #-----------------------------------------------------------------------------
214 IF(NOT wxWidgets_FOUND)
215 INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseWxWidgets.cmake)
216 CREA_FIND_WXWIDGETS()
218 ENDIF(NOT wxWidgets_FOUND)
220 #-----------------------------------------------------------------------------
224 #-----------------------------------------------------------------------------
227 MESSAGE ( STATUS "=======================================")
228 FIND_PACKAGE(Doxygen REQUIRED)
229 # MESSAGE(STATUS "Looking for doxygen... - found ${DOXYGEN}")
233 # MESSAGE(FATAL_ERROR "Doxygen not found. Required to build the doxygen documentation")
236 #-----------------------------------------------------------------------------
239 #-----------------------------------------------------------------------------
241 IF (NOT LATEX_COMPILER)
242 FIND_PACKAGE(LATEX REQUIRED)
243 MESSAGE ( STATUS "=======================================")
244 MESSAGE(STATUS "Looking for latex... - found ${LATEX_COMPILER}")
245 ENDIF (NOT LATEX_COMPILER)
247 #-----------------------------------------------------------------------------
249 #-----------------------------------------------------------------------------
251 IF (NOT TTH_EXECUTABLE)
252 FIND_FILE( TTH_EXECUTABLE NAME tth tth.exe PATHS . $ENV{CREATIS}/tth_exe/ ~/Creatis/tth ~/Creatis/tth_linux $ENV{TTH})
254 IF (NOT TTH_EXECUTABLE)
255 MESSAGE(FATAL_ERROR "TTH not found (LATEX_tth_CONVERTER). Required to build the HTML documentation from tex source")
256 ELSE (NOT TTH_EXECUTABLE)
257 MESSAGE ( STATUS "=======================================")
258 MESSAGE ( STATUS "Looking for tth... - found ${TTH_EXECUTABLE}")
259 ENDIF(NOT TTH_EXECUTABLE)
260 MARK_AS_ADVANCED( TTH_EXECUTABLE )
261 ENDIF(NOT TTH_EXECUTABLE)
263 #-----------------------------------------------------------------------------
265 #-----------------------------------------------------------------------------
268 FIND_PACKAGE(Boost REQUIRED)
270 MESSAGE ( STATUS "=======================================")
271 MESSAGE ( STATUS "Looking for boost C++ library... - found in ${Boost_INCLUDE_DIR}")
272 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
273 LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
275 CREA_DEFINE( USE_BOOST )
278 LINK_DIRECTORIES( ${Boost_INCLUDE_DIRS}/stage/lib) #JCP 01/10/2009
279 #LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS})
280 #MESSAGE ("EED " ${Boost_LIBRARY_DIRS})
281 #libboost_signals-vc71-mt-1_37
282 #libboost_filesystem-vc71-mt-1_37
283 #boost_date_time-vc71-mt-1_37
285 #message("creamacro find and use lib = ${Boost_SIGNALS_LIBRARY}")
287 boost_signals-vc90-mt-1_40
288 boost_filesystem-vc90-mt-1_40
289 boost_date_time-vc90-mt-1_40
291 #what about boost_thread? JPR
300 boost_program_options
310 boost_program_options-mt
317 MARK_AS_ADVANCED(Boost_INCLUDE_DIR)
319 MESSAGE(FATAL_ERROR "boost C++ library not found - Set Boost_INCLUDE_DIR to the directory containing boost headers")
321 ENDIF(NOT Boost_FOUND)
323 #-----------------------------------------------------------------------------
326 ENDMACRO(CREA_FIND_AND_USE_LIBRARIES)