]> Creatis software - clitk.git/blob - cmake/dependencies.cmake
Add 2 options to clitkImage2Dicom
[clitk.git] / cmake / dependencies.cmake
1 #=========================================================
2 # Find ITK (required)
3 find_package(ITK)
4 if(ITK_FOUND)
5   include("${ITK_USE_FILE}")
6   if(ITK_VERSION VERSION_GREATER 5.0.0 OR ITK_VERSION VERSION_EQUAL 5.0.0)
7     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
8   endif(ITK_VERSION VERSION_GREATER 5.0.0 OR ITK_VERSION VERSION_EQUAL 5.0.0)
9 else(ITK_FOUND)
10   message(FATAL_ERROR "Cannot build without ITK.  Please set ITK_DIR.")
11 endif(ITK_FOUND)
12 #=========================================================
13
14 #=========================================================
15 # Find VTK (required)
16 find_package(VTK REQUIRED)
17 if(VTK_FOUND)
18   include("${VTK_USE_FILE}")
19   if(VTK_VERSION VERSION_LESS 5.8.0)
20     set( VTK_LIBRARIES
21       vtkCommon
22       vtkRendering
23       vtkIO
24       vtkFiltering
25       vtkGraphics
26       vtkWidgets
27       vtkImaging
28       vtkHybrid
29       )
30   endif(VTK_VERSION VERSION_LESS 5.8.0)
31   if(VTK_VERSION VERSION_LESS 5.6.0)
32     set( VTK_LIBRARIES
33       ${VTK_LIBRARIES}
34       vtkQVTK
35     )
36   endif(VTK_VERSION VERSION_LESS 5.6.0)
37 else(VTK_FOUND)
38   message(FATAL_ERROR "Please set VTK_DIR.")
39 endif(VTK_FOUND)
40 #=========================================================
41
42 #=========================================================
43 # Find gengetopt, will create a target exe if not found
44 set(CMAKE_MODULE_PATH "${CLITK_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
45 find_package(Gengetopt)
46 #=========================================================
47
48 #=========================================================
49 # Find libstatgrab is installed, add clitkMemoryUsage.cxx in the library
50 if(NOT DEFINED CLITK_MEMORY_INFO OR CLITK_MEMORY_INFO)
51   find_library(LIBSTATGRAB NAMES statgrab PATHS)
52   if(${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
53 #  message("Install libstatgrab (http://www.i-scream.org/libstatgrab/) for memory usage information")
54     set(CLITK_MEMORY_INFO OFF)
55   else(${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
56     set(CLITK_MEMORY_INFO ON)
57   endif(${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
58 endif()
59 #=========================================================
60
61
62 #=========================================================
63 ### Check if ITK was compiled with SYSTEM_GDCM = ON (Not possible anymore with ITK 4.13)
64 ### Add option to activate external GDCM in clitk
65 set(CLITK_USE_SYSTEM_GDCM FALSE)
66 if(CLITK_EXTERNAL_GDCM)
67   message("Be sure to use external GDCM with ITK")
68   set(CLITK_USE_SYSTEM_GDCM TRUE)
69 endif()
70
71