]> 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(_policies CMP0015 CMP0020 CMP0042 CMP0053)
18 foreach(_p ${_policies})
19   if(POLICY ${_p})
20     cmake_policy(SET ${_p} NEW)
21   endif(POLICY ${_p})
22 endforeach(_p)
23
24 ## == Some general configuration
25 include(cmake/cpPlgDefinitions.cmake)
26 include(cmake/cpPlgFunctions.cmake)
27
28 ## == User could choose not to build
29 option(cpPlugins_BUILD "Build targets." OFF)
30 if(cpPlugins_BUILD)
31
32   ## == Find ITK
33   find_package(ITK CONFIG REQUIRED)
34   include(${ITK_USE_FILE})
35
36   ## == Find VTK, only if linked against ITK
37   set(cpPlugins_USE_VTK 0)
38   if(ITKVtkGlue_LOADED)
39     find_package(VTK CONFIG REQUIRED)
40     include(${VTK_USE_FILE})
41     set(cpPlugins_USE_VTK 1)
42   endif(ITKVtkGlue_LOADED)
43
44   ## == Find Qt5, only if linked against VTK
45   set(cpPlugins_USE_Qt5 0)
46   if(VTK_FOUND)
47     if(Qt5_DIR)
48       find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets)
49       set(CMAKE_INCLUDE_CURRENT_DIR ON)
50       set(CMAKE_AUTOMOC ON)
51       set(cpPlugins_USE_Qt5 1)
52     endif(Qt5_DIR)
53   endif(VTK_FOUND)
54
55   ## == Build packages
56   subdirs(appli lib)
57
58 endif(cpPlugins_BUILD)
59
60 ## == CMake scripts
61 subdirs(cmake)
62
63 ## eof - $RCSfile$