]> Creatis software - cpPlugins.git/blob - CMakeLists.txt
...
[cpPlugins.git] / CMakeLists.txt
1 ## =========================================================================
2 ## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 ## =========================================================================
4
5 cmake_minimum_required(VERSION 3.0)
6
7 ## == Basic project configuration
8 set(prj_NAME cpPlugins)
9 set(prj_MAJ 1)
10 set(prj_MIN 0)
11 set(prj_REL 0)
12
13 ## == Project definition
14 project(${prj_NAME} VERSION "${prj_MAJ}.${prj_MIN}.${prj_REL}")
15
16 ## == Project policies
17 set(_new_policies CMP0015 CMP0020 CMP0042 CMP0053)
18 set(_old_policies CMP0006)
19 foreach(_p ${_new_policies})
20   if(POLICY ${_p})
21     cmake_policy(SET ${_p} NEW)
22   endif(POLICY ${_p})
23 endforeach(_p)
24 foreach(_p ${_old_policies})
25   if(POLICY ${_p})
26     cmake_policy(SET ${_p} OLD)
27   endif(POLICY ${_p})
28 endforeach(_p)
29
30 ## == Some general configuration
31 include(cmake/cpPlgDefinitions.cmake)
32 include(cmake/cpPlgFunctions.cmake)
33
34 ## == User could choose not to build
35 option(cpPlugins_BUILD "Build targets." OFF)
36 if(cpPlugins_BUILD)
37
38   ## == Find ITK
39   find_package(ITK CONFIG REQUIRED)
40   include(${ITK_USE_FILE})
41
42   ## == Find VTK, only if linked against ITK
43   set(cpPlugins_USE_VTK 0)
44   if(ITKVtkGlue_LOADED)
45     find_package(VTK CONFIG REQUIRED)
46     include(${VTK_USE_FILE})
47     set(cpPlugins_USE_VTK 1)
48   endif(ITKVtkGlue_LOADED)
49
50   ## == Find Qt5, only if linked against VTK
51   set(cpPlugins_USE_Qt5 0)
52   if(VTK_FOUND)
53     if(Qt5_DIR)
54       find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets)
55       set(CMAKE_INCLUDE_CURRENT_DIR ON)
56       set(CMAKE_AUTOMOC ON)
57       set(cpPlugins_USE_Qt5 1)
58     endif(Qt5_DIR)
59   endif(VTK_FOUND)
60
61   ## == Build packages
62   subdirs(appli lib)
63
64 endif(cpPlugins_BUILD)
65
66 ## == Installation commands
67 include(cmake/cpPlgInstallCommands.cmake)
68
69 ## == CMake scripts
70 subdirs(cmake)
71
72 ## eof - $RCSfile$
73