]> Creatis software - clitk.git/blob - cmake/dependencies.cmake
Add a way to deactivate libstatgrab when installed.
[clitk.git] / cmake / dependencies.cmake
1 #=========================================================
2 # Find ITK (required)
3 FIND_PACKAGE(ITK)
4 IF(ITK_FOUND)
5   INCLUDE("${ITK_USE_FILE}")
6 ELSE(ITK_FOUND)
7   MESSAGE(FATAL_ERROR "Cannot build without ITK.  Please set ITK_DIR.")
8 ENDIF(ITK_FOUND)
9 #=========================================================
10
11 #=========================================================
12 # Find VTK (required)
13 FIND_PACKAGE(VTK REQUIRED)
14 IF(VTK_FOUND)
15   INCLUDE("${VTK_USE_FILE}")
16   IF(VTK_VERSION VERSION_LESS 5.8.0)
17     SET ( VTK_LIBRARIES
18       vtkCommon
19       vtkRendering
20       vtkIO
21       vtkFiltering
22       vtkGraphics
23       vtkWidgets
24       vtkImaging
25       vtkHybrid
26       )
27   ENDIF(VTK_VERSION VERSION_LESS 5.8.0)
28   IF(VTK_VERSION VERSION_LESS 5.6.0)
29     SET ( VTK_LIBRARIES
30       ${VTK_LIBRARIES}
31       vtkQVTK
32     )
33   ENDIF(VTK_VERSION VERSION_LESS 5.6.0)
34 ELSE(VTK_FOUND)
35   MESSAGE(FATAL_ERROR "Please set VTK_DIR.")
36 ENDIF(VTK_FOUND)
37 #=========================================================
38
39 #=========================================================
40 # Find gengetopt, will create a target exe if not found
41 SET(CMAKE_MODULE_PATH "${CLITK_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
42 FIND_PACKAGE(Gengetopt)
43 #=========================================================
44
45 #=========================================================
46 # Find libstatgrab is installed, add clitkMemoryUsage.cxx in the library
47 IF (NOT DEFINED CLITK_MEMORY_INFO OR CLITK_MEMORY_INFO)
48   FIND_LIBRARY(LIBSTATGRAB NAMES statgrab PATHS)
49   IF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
50 #  MESSAGE("Install libstatgrab (http://www.i-scream.org/libstatgrab/) for memory usage information")
51     SET(CLITK_MEMORY_INFO OFF)
52   ELSE (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
53     SET(CLITK_MEMORY_INFO ON)
54   ENDIF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")  
55 ENDIF()
56 #=========================================================