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)
28 MESSAGE ( STATUS "=======================================")
29 MESSAGE ( STATUS "Looking for QT4... found")
30 MESSAGE ( STATUS "* Inc Dir = ${QT_INCLUDE_DIR}")
31 MESSAGE ( STATUS "* Version = ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
32 INCLUDE(${QT_USE_FILE})
38 # MARK_AS_ADVANCED(Qt4_DIR)
42 #-----------------------------------------------------------------------------
44 #-----------------------------------------------------------------------------
46 INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseVTK.cmake)
47 CREA_FIND_AND_USE_VTK()
49 #-----------------------------------------------------------------------------
51 #-----------------------------------------------------------------------------
53 IF(NOT KWWidgets_FOUND)
55 FIND_PACKAGE(KWWidgets)
58 MESSAGE ( STATUS "=======================================")
59 MESSAGE ( STATUS "Looking for KWWidgets... found")
60 MESSAGE ( STATUS "* Dir = ${KWWidgets_DIR}")
61 MESSAGE ( STATUS "* Version = ${KWWidgets_MAJOR_VERSION}.${KWWidgets_MINOR_VERSION}.${KWWidgets_BUILD_VERSION}")
63 # KWWidgets must not search again for vtk !
64 SET(KWWidgets_NO_USE_VTK ON)
67 INCLUDE(${KWWidgets_USE_FILE})
68 CREA_DEFINE( USE_KWWIDGETS )
69 SET(KWWIDGETS_LIBRARIES
70 ${KWWidgets_LIBRARIES}
72 MARK_AS_ADVANCED(KWWidgets_DIR)
74 message(FATAL_ERROR "KWWidgets_DIR not found")
75 ENDIF(KWWidgets_FOUND)
76 ENDIF(NOT KWWidgets_FOUND)
78 #-----------------------------------------------------------------------------
82 #-----------------------------------------------------------------------------
89 MESSAGE ( STATUS "=======================================")
90 MESSAGE ( STATUS "Looking for ITK... found")
91 MESSAGE ( STATUS "* Dir = ${ITK_DIR}")
92 MESSAGE ( STATUS "* Version = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}")
93 SET(SKIP_ITK_BUILD_SETTINGS_FILE ON)
94 INCLUDE(${ITK_USE_FILE})
95 CREA_DEFINE( USE_ITK )
96 CREA_DEFINE( _USE_ITK_ )
98 ITKCommon ITKIO ITKBasicFilters ITKAlgorithms
100 MARK_AS_ADVANCED(ITK_DIR)
102 message(FATAL_ERROR "ITK_DIR not found")
106 #-----------------------------------------------------------------------------
109 #-----------------------------------------------------------------------------
112 MESSAGE(ERROR "CANNOT USE BOTH gdcm AND gdcm2 !")
120 INCLUDE(${GDCM_USE_FILE})
121 CREA_DEFINE( USE_GDCM )
123 MESSAGE ( STATUS "=======================================")
124 MESSAGE ( STATUS "Looking for GDCM... found")
125 MESSAGE ( STATUS "* Dir = ${GDCM_DIR}")
126 MESSAGE ( STATUS "* Version = ${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
127 MESSAGE ( STATUS "* Namespace = ${GDCM_NAME_SPACE}")
129 # Test that GDCM_NAME_SPACE is **NOT** "gdcm" or will conflict with
130 # embedded gdcm in ITK and will result in hard seg faults !
132 IF (GDCM_NAME_SPACE STREQUAL "gdcm")
133 MESSAGE(FATAL_ERROR "GDCM_NAME_SPACE value is 'gdcm' which conflicts with ITK embededd gdcm namespace : rebuild gdcm with another GDCM_NAME_SPACE value")
134 ENDIF (GDCM_NAME_SPACE STREQUAL "gdcm")
137 MARK_AS_ADVANCED(GDCM_DIR)
143 # TODO : Test that GDCM was built with option "vtkgdcm"
154 ENDIF(NOT GDCM_FOUND)
157 #-----------------------------------------------------------------------------
159 #-----------------------------------------------------------------------------
166 INCLUDE(${GDCM_USE_FILE})
168 IF(NOT ${GDCM_MAJOR_VERSION} EQUAL 2)
169 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")
170 ENDIF(NOT ${GDCM_MAJOR_VERSION} EQUAL 2)
172 CREA_DEFINE( USE_GDCM2 )
173 CREA_DEFINE_WITH_VAL( GDCM_NAME_SPACE gdcm )
175 MESSAGE ( STATUS "=======================================")
176 MESSAGE ( STATUS "Looking for GDCM2... found")
177 MESSAGE ( STATUS "* Dir = ${GDCM_DIR}")
178 MESSAGE ( STATUS "* Version = ${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
179 MESSAGE ( STATUS "* Namespace = ${GDCM_NAME_SPACE}")
181 # Test that GDCM_NAME_SPACE is **NOT** "gdcm" or will conflict with
182 # embedded gdcm in ITK and will result in hard seg faults !
184 IF (GDCM_NAME_SPACE STREQUAL "gdcm")
185 MESSAGE(FATAL_ERROR "GDCM_NAME_SPACE value is 'gdcm' which conflicts with ITK embededd gdcm namespace : rebuild gdcm with another GDCM_NAME_SPACE value")
186 ENDIF (GDCM_NAME_SPACE STREQUAL "gdcm")
189 MARK_AS_ADVANCED(GDCM_DIR)
195 # TODO : Test that GDCM was built with option "vtkgdcm"
206 ENDIF(NOT GDCM_FOUND)
209 #-----------------------------------------------------------------------------
211 #-----------------------------------------------------------------------------
213 IF(NOT wxWidgets_FOUND)
214 INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseWxWidgets.cmake)
215 CREA_FIND_WXWIDGETS()
217 ENDIF(NOT wxWidgets_FOUND)
219 #-----------------------------------------------------------------------------
223 #-----------------------------------------------------------------------------
226 MESSAGE ( STATUS "=======================================")
227 FIND_PACKAGE(Doxygen REQUIRED)
228 # MESSAGE(STATUS "Looking for doxygen... - found ${DOXYGEN}")
232 # MESSAGE(FATAL_ERROR "Doxygen not found. Required to build the doxygen documentation")
235 #-----------------------------------------------------------------------------
238 #-----------------------------------------------------------------------------
240 IF (NOT LATEX_COMPILER)
241 FIND_PACKAGE(LATEX REQUIRED)
242 MESSAGE ( STATUS "=======================================")
243 MESSAGE(STATUS "Looking for latex... - found ${LATEX_COMPILER}")
244 ENDIF (NOT LATEX_COMPILER)
246 #-----------------------------------------------------------------------------
248 #-----------------------------------------------------------------------------
250 IF (NOT TTH_EXECUTABLE)
251 FIND_FILE( TTH_EXECUTABLE NAME tth tth.exe PATHS . $ENV{CREATIS}/tth_exe/ ~/Creatis/tth ~/Creatis/tth_linux $ENV{CREATIS}/tth/)
252 IF (NOT TTH_EXECUTABLE)
253 MESSAGE(FATAL_ERROR "TTH not found (LATEX_tth_CONVERTER). Required to build the HTML documentation from tex source")
254 ELSE (NOT TTH_EXECUTABLE)
255 MESSAGE ( STATUS "=======================================")
256 MESSAGE ( STATUS "Looking for tth... - found ${TTH_EXECUTABLE}")
257 ENDIF(NOT TTH_EXECUTABLE)
258 MARK_AS_ADVANCED( TTH_EXECUTABLE )
259 ENDIF(NOT TTH_EXECUTABLE)
261 #-----------------------------------------------------------------------------
263 #-----------------------------------------------------------------------------
266 FIND_PACKAGE(Boost REQUIRED)
268 MESSAGE ( STATUS "=======================================")
269 MESSAGE ( STATUS "Looking for boost C++ library... - found in ${Boost_INCLUDE_DIR}")
270 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
271 LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
273 CREA_DEFINE( USE_BOOST )
275 LINK_DIRECTORIES( ${Boost_INCLUDE_DIRS}/stage/lib)
276 #MESSAGE ("EED " ${Boost_LIBRARY_DIRS})
277 #libboost_signals-vc71-mt-1_37
278 #libboost_filesystem-vc71-mt-1_37
279 #boost_date_time-vc71-mt-1_37
281 boost_signals-vc90-mt
282 boost_filesystem-vc90-mt
283 boost_date_time-vc90-mt
285 #what about boost_thread? JPR
294 boost_program_options
304 boost_program_options-mt
311 MARK_AS_ADVANCED(Boost_INCLUDE_DIR)
313 MESSAGE(FATAL_ERROR "boost C++ library not found - Set Boost_INCLUDE_DIR to the directory containing boost headers")
315 ENDIF(NOT Boost_FOUND)
317 #-----------------------------------------------------------------------------
320 ENDMACRO(CREA_FIND_AND_USE_LIBRARIES)