project(${prj_NAME} VERSION "${prj_MAJ}.${prj_MIN}.${prj_REL}")
## == Project policies
-set(_policies CMP0015 CMP0020 CMP0042 CMP0053)
-foreach(_p ${_policies})
+set(_new_policies CMP0015 CMP0020 CMP0042 CMP0053)
+set(_old_policies CMP0006)
+foreach(_p ${_new_policies})
if(POLICY ${_p})
cmake_policy(SET ${_p} NEW)
endif(POLICY ${_p})
endforeach(_p)
+foreach(_p ${_old_policies})
+ if(POLICY ${_p})
+ cmake_policy(SET ${_p} OLD)
+ endif(POLICY ${_p})
+endforeach(_p)
## == Some general configuration
-include(cmake/Definitions.cmake)
-include(cmake/Functions.cmake)
-
-## == Find ITK
-find_package(ITK CONFIG REQUIRED)
-include(${ITK_USE_FILE})
-
-## == Find VTK, only if linked against ITK
-set(cpPlugins_USE_VTK 0)
-if(ITKVtkGlue_LOADED)
- find_package(VTK CONFIG REQUIRED)
- include(${VTK_USE_FILE})
- set(cpPlugins_USE_VTK 1)
-endif(ITKVtkGlue_LOADED)
-
-## == Find Qt5, only if linked against VTK
-set(cpPlugins_USE_Qt5 0)
-if(VTK_FOUND)
- if(Qt5_DIR)
- find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets)
- set(CMAKE_INCLUDE_CURRENT_DIR ON)
- set(CMAKE_AUTOMOC ON)
- set(cpPlugins_USE_Qt5 1)
- endif(Qt5_DIR)
-endif(VTK_FOUND)
-
-## == Build packages
-subdirs(lib)
+include(cmake/cpPlgDefinitions.cmake)
+include(cmake/cpPlgFunctions.cmake)
+
+## == User could choose not to build
+option(cpPlugins_BUILD "Build targets." OFF)
+if(cpPlugins_BUILD)
+
+ ## == Find ITK
+ find_package(ITK CONFIG REQUIRED)
+ include(${ITK_USE_FILE})
+
+ ## == Find VTK, only if linked against ITK
+ set(cpPlugins_USE_VTK 0)
+ if(ITKVtkGlue_LOADED)
+ find_package(VTK CONFIG REQUIRED)
+ include(${VTK_USE_FILE})
+ set(cpPlugins_USE_VTK 1)
+ endif(ITKVtkGlue_LOADED)
+
+ ## == Find Qt5, only if linked against VTK
+ set(cpPlugins_USE_Qt5 0)
+ if(VTK_FOUND)
+ if(Qt5_DIR)
+ find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets)
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ set(CMAKE_AUTOMOC ON)
+ set(cpPlugins_USE_Qt5 1)
+ endif(Qt5_DIR)
+ endif(VTK_FOUND)
+
+ ## == Build packages
+ subdirs(appli lib)
+
+endif(cpPlugins_BUILD)
## == Installation commands
-## include(cmake/InstallCommands.cmake)
+include(cmake/cpPlgInstallCommands.cmake)
+
+## == CMake scripts
+subdirs(cmake)
## eof - $RCSfile$
+