]> Creatis software - crea.git/blob - cmake/CREAMacro_FindAndUseLibraries.cmake
59fcb7a776bd963c0107c9b31d4773ca492b0dfb
[crea.git] / cmake / CREAMacro_FindAndUseLibraries.cmake
1
2
3 MACRO(CREA_FIND_AND_USE_LIBRARIES)
4
5 IF(INCLUDE_CTEST)
6         include(CTest) 
7 ENDIF(INCLUDE_CTEST)
8
9
10 set(USE_DEBUG_LIB "" CACHE BOOL "Use Debug Libraries" )
11
12 #-----------------------------------------------------------------------------
13 # If one can invoke this macro then crea has already been found !!
14 # However if one whishes to link against crea and crea was built 
15 # with wx or vtk then we have to find them.
16 # This USE_CREA var is made to resolve this dependency.
17 IF(USE_CREA)
18   IF(CREA_BUILT_WITH_WX)
19     SET(USE_WXWIDGETS ON)
20   ENDIF(CREA_BUILT_WITH_WX)
21   IF(CREA_BUILT_WITH_VTK)
22     SET(USE_VTK ON)
23   ENDIF(CREA_BUILT_WITH_VTK)
24 ENDIF(USE_CREA)
25 #-----------------------------------------------------------------------------
26
27 #-----------------------------------------------------------------------------
28
29 IF(USE_QT4)
30   IF(NOT QT_FOUND)      
31         INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseQt.cmake)
32         #FIND_PACKAGE(Qt4 REQUIRED)     
33     IF(QT_FOUND)
34       MESSAGE ( STATUS "=======================================")
35       MESSAGE ( STATUS "Looking for QT4... found")
36       MESSAGE ( STATUS "* Inc Dir = ${QT_INCLUDE_DIR}")
37       MESSAGE ( STATUS "* Version = ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
38       INCLUDE(${QT_USE_FILE})
39       CREA_DEFINE( USE_QT )
40    ENDIF(QT_FOUND)
41   ENDIF(NOT QT_FOUND)
42 ENDIF(USE_QT4)
43
44 #JFGA Pruebas WT
45 #MESSAGE (  "======================================= SET CMAKE USE_WT JFGA CREAMacro_FindAndUseLibraries.cmake")   
46 #SET(USE_WT OFF)
47
48
49 #-----------------------------------------------------------------------------
50
51 #-----------------------------------------------------------------------------
52 IF(USE_VTK)
53   INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseVTK.cmake)
54   CREA_FIND_AND_USE_VTK()  
55 ENDIF(USE_VTK)
56 #-----------------------------------------------------------------------------
57
58 #-----------------------------------------------------------------------------
59 IF(USE_OPENMP)
60   IF(APPLE)
61     set(CMAKE_THREAD_LIBS_INIT "-lpthread")
62     set(CMAKE_HAVE_THREADS_LIBRARY 1)
63     set(CMAKE_USE_WIN32_THREADS_INIT 0)
64     set(CMAKE_USE_PTHREADS_INIT 1)
65     set(THREADS_PREFER_PTHREAD_FLAG ON)
66   ENDIF()
67   find_package(Threads REQUIRED)
68
69 ### Find OpenMP
70 if(APPLE )
71     if(CMAKE_C_COMPILER_ID MATCHES "Clang")
72         set(OpenMP_C "${CMAKE_C_COMPILER}")
73         set(OpenMP_C_FLAGS "-Xclang -fopenmp=libomp -Wno-unused-command-line-argument")
74         set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5")
75         set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES})
76         set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES})
77         set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES})
78     endif()
79     if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
80       set(OpenMP_CXX "${CMAKE_CXX_COMPILER}")
81 #      set(OpenMP_CXX_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
82       set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -Wno-unused-command-line-argument")
83       set(OpenMP_CXX_LIB_NAMES "libomp" "libgomp" "libiomp5")
84       set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
85 #EED 2022/05/15
86       set(OpenMP_libomp_LIBRARY_crea libomp.dylib )      
87 #      set(OpenMP_libiomp5_LIBRARY ${OpenMP_CXX_LIB_NAMES})
88     endif()
89 endif()
90   find_package(OpenMP REQUIRED)
91 if (OPENMP_FOUND)
92 #    include_directories("${OPENMP_INCLUDES}")
93
94     link_directories( /opt/local/lib/libomp  ) 
95     set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
96     set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
97     # set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
98 endif(OPENMP_FOUND)
99
100
101 ENDIF(USE_OPENMP)
102
103 #-----------------------------------------------------------------------------
104
105
106
107 #-----------------------------------------------------------------------------
108 IF(USE_KWWIDGETS)
109   IF(NOT KWWidgets_FOUND)
110     # Search KWWidgets
111     FIND_PACKAGE(KWWidgets)
112     # If found
113     IF(KWWidgets_FOUND)
114       MESSAGE ( STATUS "=======================================")
115       MESSAGE ( STATUS "Looking for KWWidgets... found")
116       MESSAGE ( STATUS "* Dir     = ${KWWidgets_DIR}")
117       MESSAGE ( STATUS "* Version = ${KWWidgets_MAJOR_VERSION}.${KWWidgets_MINOR_VERSION}.${KWWidgets_BUILD_VERSION}")
118       IF (USE_VTK)
119          # KWWidgets must not search again for vtk !
120         SET(KWWidgets_NO_USE_VTK ON)
121       ENDIF (USE_VTK)
122
123       INCLUDE(${KWWidgets_USE_FILE})
124       CREA_DEFINE( USE_KWWIDGETS )
125       SET(KWWIDGETS_LIBRARIES
126         ${KWWidgets_LIBRARIES}
127         ) 
128       MARK_AS_ADVANCED(KWWidgets_DIR)
129     ELSE(KWWidgets_FOUND)
130       message(FATAL_ERROR "KWWidgets_DIR not found")
131     ENDIF(KWWidgets_FOUND)
132   ENDIF(NOT KWWidgets_FOUND)
133 ENDIF(USE_KWWIDGETS)
134 #-----------------------------------------------------------------------------
135
136 #  --- W A R N I N G :
137 #  Always let ITK *BEFORE* GDCM
138 #  It allows to use 'system installed gdcm' instead of 'itk embedded gdcm'
139 #
140
141 #-----------------------------------------------------------------------------
142
143 IF(USE_ITK)
144   IF(NOT ITK_FOUND)
145     # Search ITK
146     FIND_PACKAGE(ITK)
147     # If itk found
148     IF(ITK_FOUND)
149       MESSAGE ( STATUS "=======================================")
150       MESSAGE ( STATUS "Looking for ITK... found")
151       MESSAGE ( STATUS "* Dir     = ${ITK_DIR}")
152       MESSAGE ( STATUS "* Version = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}")
153       SET(SKIP_ITK_BUILD_SETTINGS_FILE ON)
154       INCLUDE(${ITK_USE_FILE})
155       CREA_DEFINE( USE_ITK )
156       CREA_DEFINE( _USE_ITK_ )
157                 If (${ITK_VERSION_MAJOR} MATCHES "4"  OR  ${ITK_VERSION_MAJOR} MATCHES "5"  )
158                         MESSAGE ( STATUS "* Version = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}")
159                         SET(ITK_LIBRARIES ${ITK_LIBRARIES}) 
160                         MESSAGE ( STATUS "${ITK_LIBRARIES}")
161                 ELSEIF()
162                         SET(ITK_LIBRARIES ITKCommon ITKIO ITKBasicFilters ITKAlgorithms)
163                 ENDIF()
164       MARK_AS_ADVANCED(ITK_DIR)
165     ELSE(ITK_FOUND)
166       message(FATAL_ERROR "ITK_DIR not found")
167     ENDIF(ITK_FOUND)
168   ENDIF(NOT ITK_FOUND)
169 ENDIF(USE_ITK)
170 #-----------------------------------------------------------------------------
171
172
173 #-----------------------------------------------------------------------------
174
175 IF(USE_GDCM)
176   IF (USE_GDCM2)
177     MESSAGE(ERROR "CANNOT USE BOTH gdcm AND gdcm2 !")
178   ENDIF (USE_GDCM2)
179
180   IF(NOT GDCM_FOUND)
181     # Search GDCM
182     FIND_PACKAGE(GDCM)
183     # If gdcm found
184     IF(GDCM_FOUND)
185       INCLUDE(${GDCM_USE_FILE})
186       CREA_DEFINE( USE_GDCM )
187
188       MESSAGE ( STATUS "=======================================")
189       MESSAGE ( STATUS "Looking for GDCM... found")
190       MESSAGE ( STATUS "* Dir       = ${GDCM_DIR}")
191       MESSAGE ( STATUS "* Version   = ${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
192       MESSAGE ( STATUS "* Namespace = ${GDCM_NAME_SPACE}")
193
194       # Test that GDCM_NAME_SPACE is **NOT** "gdcm" or will conflict with 
195       # embedded gdcm in ITK and will result in hard seg faults !
196       IF(USE_ITK)
197         IF (GDCM_NAME_SPACE STREQUAL "gdcm")
198           MESSAGE(FATAL_ERROR "GDCM_NAME_SPACE value is 'gdcm' which conflicts with ITK embededd gdcm namespace : rebuild gdcm with another GDCM_NAME_SPACE value")
199         ENDIF (GDCM_NAME_SPACE STREQUAL "gdcm")
200       ENDIF(USE_ITK)
201
202       MARK_AS_ADVANCED(GDCM_DIR)
203
204       SET(GDCM_LIBRARIES
205         ${GDCM_LIBRARIES} 
206         )
207
208       # TODO : Test that GDCM was built with option "vtkgdcm"
209       IF(USE_GDCM_VTK)
210         IF(USE_VTK)
211           SET(GDCM_LIBRARIES
212             ${GDCM_LIBRARIES}
213             vtkgdcm  
214             )
215         ENDIF(USE_VTK)
216       ENDIF(USE_GDCM_VTK)
217
218     ELSE(GDCM_FOUND)     
219           MESSAGE(FATAL_ERROR "GDCM not found....")
220     ENDIF(GDCM_FOUND)
221
222   ENDIF(NOT GDCM_FOUND)
223 ENDIF(USE_GDCM)
224
225 #-----------------------------------------------------------------------------
226
227 IF(USE_GDCM2)
228   IF (USE_GDCM)
229     MESSAGE(ERROR "CANNOT USE BOTH gdcm AND gdcm2 !")
230   ENDIF (USE_GDCM)
231
232 #  IF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break)
233     # Search GDCM2
234
235     FIND_PACKAGE(GDCM REQUIRED)
236     INCLUDE(${GDCM_USE_FILE})
237
238       IF(NOT ${GDCM_MAJOR_VERSION} EQUAL 2)
239         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")
240       ENDIF(NOT ${GDCM_MAJOR_VERSION} EQUAL 2)
241       
242       CREA_DEFINE( USE_GDCM2 )
243           MARK_AS_ADVANCED(GDCM_DIR)
244       CREA_DEFINE_WITH_VAL( GDCM_NAME_SPACE gdcm )
245       
246       MESSAGE ( STATUS "=======================================")
247       MESSAGE ( STATUS "Looking for GDCM2... found")
248       MESSAGE ( STATUS "* Dir       = ${GDCM_DIR}")
249       MESSAGE ( STATUS "* Version   = ${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
250       MESSAGE ( STATUS "* Namespace = ${GDCM_NAME_SPACE}")
251       
252       # Test that GDCM_NAME_SPACE is **NOT** "gdcm" or will conflict with 
253       # embedded gdcm in ITK and will result in hard seg faults !
254                    INCLUDE_DIRECTORIES(${GDCM_INCLUDE_DIRS})     
255                         LINK_DIRECTORIES( ${GDCM_LIBRARY_DIRS}) 
256                         
257       SET(GDCM2_LIBRARIES
258         ${GDCM_LIBRARIES} 
259         )
260
261       IF(USE_GDCM_VTK)
262         IF(USE_VTK)
263                 IF(WIN32)
264                   SET(GDCM_LIBRARIES
265                         ${GDCM_LIBRARIES}
266                         vtkgdcm
267                         gdcmIOD
268                         gdcmMSFF
269                         gdcmexpat
270                         gdcmCommon
271                         gdcmMEXD
272                         gdcmexpat
273                         gdcmDSED
274                         gdcmDICT
275                         gdcmjpeg8
276                         gdcmjpeg12
277                         gdcmjpeg16
278                         socketxx
279                         gdcmopenjpeg
280                         gdcmcharls
281                      )
282                 ELSE(WIN32)
283                     SET(GDCM_LIBRARIES
284                         ${GDCM_LIBRARIES}
285                         vtkgdcm
286                         gdcmIOD
287                         )
288                 ENDIF(WIN32)
289                 
290         ENDIF(USE_VTK)
291       ENDIF(USE_GDCM_VTK)
292  # ENDIF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break)
293
294 ENDIF(USE_GDCM2)
295
296 #-----------------------------------------------------------------------------
297
298 #-----------------------------------------------------------------------------
299
300 #-------------------- JFGA ---
301 IF(USE_WT)
302         MESSAGE (  "======================================= JFGA ------------USE WT CREAMacro_FindAndUseLibraries.cmake")
303         INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseWt.cmake)
304         CREA_FINDANDUSEWT()
305 ENDIF(USE_WT)
306
307 #-----------------------------------------------------------------------------
308 IF(USE_WXWIDGETS)
309   IF(NOT wxWidgets_FOUND)
310         
311     INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_FindAndUseWxWidgets.cmake)
312     CREA_FIND_WXWIDGETS(${USE_DEBUG_LIB})
313     CREA_USE_WXWIDGETS()
314         
315                 
316  
317   ENDIF(NOT wxWidgets_FOUND)
318 ENDIF(USE_WXWIDGETS)
319 #-----------------------------------------------------------------------------
320
321
322
323 #-----------------------------------------------------------------------------
324 IF(USE_DOXYGEN) 
325   IF(NOT DOXYGEN)
326     MESSAGE ( STATUS "=======================================")
327     FIND_PACKAGE(Doxygen REQUIRED)
328     #  MESSAGE(STATUS "Looking for doxygen... - found ${DOXYGEN}")
329     #  IF(DOXYGEN)
330     #    
331     #  ELSE(DOXYGEN)
332     #    MESSAGE(FATAL_ERROR "Doxygen not found. Required to build the doxygen documentation")
333   ENDIF(NOT DOXYGEN)
334 ENDIF(USE_DOXYGEN)
335 #-----------------------------------------------------------------------------
336
337
338 #-----------------------------------------------------------------------------
339 IF(USE_LATEX)
340         IF (NOT LATEX_COMPILER)
341                 FIND_PACKAGE(LATEX REQUIRED)
342                 MESSAGE ( STATUS "=======================================")
343                 MESSAGE(STATUS "Looking for latex... - found ${LATEX_COMPILER}")
344                 IF (NOT LATEX_FOUND)
345                    MESSAGE(FATAL_ERROR "LATEX_COMPILER NOT FOUND. Example:latex  (MacOS:/opt/local/bin/latex)")
346                 ENDIF (NOT LATEX_FOUND)
347         ENDIF (NOT LATEX_COMPILER)
348   
349 ENDIF(USE_LATEX) 
350 #-----------------------------------------------------------------------------
351
352 #-----------------------------------------------------------------------------
353 IF(USE_TTH) 
354   IF (NOT TTH_EXECUTABLE)
355     FIND_FILE( TTH_EXECUTABLE NAME tth tth.exe PATHS . $ENV{CREATIS}/tth_exe/ ~/Creatis/tth ~/Creatis/tth_linux $ENV{TTH}) 
356
357     IF (NOT TTH_EXECUTABLE)
358       MESSAGE(FATAL_ERROR "TTH not found (LATEX_tth_CONVERTER). Required to build the HTML documentation from tex source")
359     ELSE (NOT  TTH_EXECUTABLE)
360       MESSAGE ( STATUS "=======================================")
361       MESSAGE ( STATUS "Looking for tth... - found ${TTH_EXECUTABLE}")
362     ENDIF(NOT TTH_EXECUTABLE)
363     MARK_AS_ADVANCED( TTH_EXECUTABLE )
364   ENDIF(NOT TTH_EXECUTABLE)
365 ENDIF(USE_TTH)
366 #-----------------------------------------------------------------------------
367 #-----------------------------------------------------------------------------
368 IF(USE_BOOST)
369   IF(NOT Boost_FOUND)
370         add_definitions( -DBOOST_ALL_NO_LIB )
371         add_definitions( -DBOOST_ALL_DYN_LINK )
372         IF (MINGW)
373                 IF(APPLE)
374                         FIND_PACKAGE(Boost COMPONENTS filesystem-mgw71 system-mgw71 signals-mgw71 date_time-mgw71 thread-mgw71 regex-mgw71 program_options-mgw71 REQUIRED)
375                 ELSE(APPLE)
376                         set( Boost_INCLUDE_DIR $ENV{BOOST_ROOT}/include/boost-1_69)
377                         FIND_PACKAGE(Boost COMPONENTS filesystem-mgw85-mt-x64-1_69  system-mgw85-mt-x64-1_69  date_time-mgw85-mt-x64-1_69 thread-mgw85-mt-x64-1_69 regex-mgw85-mt-x64-1_69 program_options-mgw85-mt-x64-1_69  REQUIRED)
378                 ENDIF(APPLE)
379         ELSE (MINGW)
380 #               FIND_PACKAGE(Boost COMPONENTS filesystem system signals date_time thread regex program_options REQUIRED)
381 #EED 2022-07-23
382 #               FIND_PACKAGE(Boost COMPONENTS filesystem system  date_time thread regex program_options REQUIRED)
383                 FIND_PACKAGE(Boost COMPONENTS filesystem system  date_time  regex program_options REQUIRED)
384         ENDIF(MINGW)
385     IF(Boost_FOUND) 
386           ADD_DEFINITIONS(-DBOOST_FILESYSTEM_VERSION=3)
387           ADD_DEFINITIONS(-DBOOST_MAYOR_VERSION=${Boost_MAJOR_VERSION})
388           ADD_DEFINITIONS(-DBOOST_MINOR_VERSION=${Boost_MINOR_VERSION})
389       MESSAGE ( STATUS "=======================================")
390       MESSAGE ( STATUS "Looking for boost C++ library... - found in ${Boost_INCLUDE_DIR}")
391       INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})         
392           LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS})
393           IF(WIN32)
394                 CREA_DEFINE( USE_BOOST )
395                 ADD_DEFINITIONS(-DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
396                 SET(BOOST_LIBRARIES
397                         ${Boost_LIBRARIES}
398                         )
399                         
400 # FCY with cmake boost, it's useless. 
401 # But if it is not working, uncomment   
402 #
403 #       IF(USE_DEBUG_LIB)
404 #                       SET(BOOST_LIBRARIES
405 #                               boost_signals-vc90-mt-gd-1_40
406 #                               boost_filesystem-vc90-mt-gd-1_40
407 #                               boost_date_time-vc90-mt-gd-1_40                    
408 #                          #what about boost_thread? JPR
409 #                       )
410 #               ELSE(NOT USE_DEBUG_LIB)
411 #                       SET(BOOST_LIBRARIES
412 #                               boost_signals-vc90-mt-1_40
413 #                               boost_filesystem-vc90-mt-1_40
414 #                               boost_date_time-vc90-mt-1_40
415 #                       )
416 #               ENDIF(USE_DEBUG_LIB)    
417           ENDIF(WIN32)
418       IF(NOT WIN32)
419 message("EED 2021 CREAMacro_FindAndUseLibraries " ${Boost_LIBRARIES} )
420
421                   SET(BOOST_LIBRARIES
422
423                         ${Boost_LIBRARIES}
424 #EED 10 Fev 2014
425 #EED                    boost_system-mt
426 #EED                    boost_thread-mt     
427 #EED                    boost_program_options-mt
428
429 #EED 03 mars 2011
430 #EED                    boost_signals-mt
431 #EED                    boost_filesystem-mt
432 #EED                    boost_date_time-mt
433 #EED                    boost_system-mt
434 #EED                    boost_program_options-mt
435 #EED                    boost_regex-mt
436 #EED                    boost_thread-mt     
437
438                         )
439       ENDIF(NOT WIN32)
440
441           MARK_AS_ADVANCED(Boost_INCLUDE_DIR)
442           MARK_AS_ADVANCED(Boost_LIBRARY_DIRS)
443      
444     ELSE(Boost_FOUND)
445       MESSAGE( STATUS "boost C++ library not found - Set Boost_INCLUDE_DIR to the directory containing boost headers")
446     ENDIF(Boost_FOUND)
447   ENDIF(NOT Boost_FOUND)
448  
449
450 ENDIF(USE_BOOST)
451 #-----------------------------------------------------------
452
453 IF(USE_XERCES)
454
455         # FIND xerces
456         IF(WIN32)
457         
458                 SET(XERCES_LIB_DIR $ENV{XERCES_DIR})
459         
460                 IF(NOT XERCES_LIB_DIR)  
461                   MESSAGE(FATAL_ERROR "XERCES_DIR not found")  
462                 ELSE(NOT XERCES_LIB_DIR)
463                   
464                 INCLUDE_DIRECTORIES( ${XERCES_LIB_DIR}/include )                
465                 LINK_DIRECTORIES(  ${XERCES_LIB_DIR}/lib )
466                   
467                 ENDIF(NOT XERCES_LIB_DIR)       
468                 
469                 IF(APPLE)
470                         IF(USE_DEBUG_LIB)
471                                 set(XERCES_LIBRARIES  xerces-c_3D)
472                         ELSE(USE_DEBUG_LIB)
473                                 set(XERCES_LIBRARIES  xerces-c_3)
474                         ENDIF(USE_DEBUG_LIB)
475                 ELSEIF(APPLE)
476                         IF(USE_DEBUG_LIB)
477                                 #EED 2019-07-03                 set(XERCES_LIBRARIES  xerces-c_3D)
478                                 set(XERCES_LIBRARIES  xerces-c)
479                         ELSE(USE_DEBUG_LIB)
480                                 #EED 2019-07-03                 set(XERCES_LIBRARIES  xerces-c_3)
481                                 set(XERCES_LIBRARIES  xerces-c)
482                         ENDIF(USE_DEBUG_LIB)
483                 ENDIF(APPLE)
484                 
485                 MARK_AS_ADVANCED(XERCES_LIB_DIR)
486         ENDIF(WIN32)
487
488
489         IF(UNIX)
490                 IF(APPLE)
491                         SET(XERCES_LIBRARIES xerces-c )
492                          INCLUDE_DIRECTORIES( /opt/local/include )
493                          LINK_DIRECTORIES(  /opt/local/lib ) 
494 #JCP 10/01/11                    
495                 ELSE(NOT APPLE) 
496                         SET(XERCES_LIBRARIES xerces-c )
497                          INCLUDE_DIRECTORIES( /usr/local/include )
498                          LINK_DIRECTORIES(  /usr/local/lib /usr/lib) 
499                         #FIND_PACKAGE(Xerces)
500                         # Use if found
501                         #IF(Xerces_FOUND)
502                          #  INCLUDE_DIRECTORIES( ${XERCES_INCLUDE_DIR} ) 
503                         #ENDIF(Xerces_FOUND)            
504                 ENDIF(APPLE)
505         ENDIF(UNIX)     
506   
507 ENDIF(USE_XERCES)
508
509 IF(WIN32)
510     # dlfcn.h
511         INCLUDE_DIRECTORIES(  $ENV{CREATIS_THIRDPARTYDLLS_DIRS}/../include )
512 ENDIF(WIN32)
513
514
515 ENDMACRO(CREA_FIND_AND_USE_LIBRARIES)