]> Creatis software - cpPlugins.git/blobdiff - CMakeLists.txt
Moved to version 1.0
[cpPlugins.git] / CMakeLists.txt
index 6c7e166e8a4cc417b242ff2e47cb207ecc2f6c6a..99c90f499abfd253228b7950fbf9f40a1f7cce92 100644 (file)
@@ -1,76 +1,41 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+## =========================================================================
+## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+## =========================================================================
 
-## ========================
-## == Project definition ==
-## ========================
+## == Base project configuration
+cmake_minimum_required(VERSION 3.0)
+set(prj_NAME cpPlugins)
+set(prj_MAJ 1)
+set(prj_MIN 0)
+set(prj_REL 0)
 
-SET(prj_NAME cpPlugins)
-SET(prj_MAJOR_VERSION   0)
-SET(prj_MINOR_VERSION   1)
-SET(prj_RELEASE_VERSION 0)
+## == Project definiton
+project(${prj_NAME} VERSION "${prj_MAJ}.${prj_MIN}.${prj_REL}")
+include(cmake/cpPlgDefinitions.cmake)
+include(cmake/cpPlgFunctions.cmake)
 
-## ==========================
-## == Some useful policies ==
-## ==========================
+## == User could want only cmake scripts
+option(cpPlugins_BUILD "Build targets?" OFF)
+if(cpPlugins_BUILD)
 
-SET(_policies CMP0015 CMP0020 CMP0042)
-FOREACH(_p ${_policies})
-  IF(POLICY ${_p})
-    CMAKE_POLICY(SET ${_p} NEW)
-  ENDIF(POLICY ${_p})
-ENDFOREACH(_p)
+  ## == Options
+  option(BUILD_PLUGINS_cpPluginsBase "Build base plugins?" OFF)
 
-## ===========================
-## == Project configuration ==
-## ===========================
+  ## == Find Boost
+  find_package(Boost REQUIRED COMPONENTS filesystem program_options)
 
-PROJECT(${prj_NAME})
-SET(
-  prj_VERSION
-  "${prj_MAJOR_VERSION}.${prj_MINOR_VERSION}.${prj_RELEASE_VERSION}"
-  )
-SET(prj_SHORT_VERSION "${prj_MAJOR_VERSION}")
+  ## == Find Qt5
+  find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets)
+  set(CMAKE_INCLUDE_CURRENT_DIR ON)
+  set(CMAKE_AUTOMOC ON)
 
-## =====================================
-## == Functions, packages and options ==
-## =====================================
+  ## == Process subdirs
+  subdirs(appli lib)
 
-INCLUDE(cmake/DetectOS.cmake)
-INCLUDE(cmake/Restrictions.cmake)
-INCLUDE(cmake/Options.cmake)
-INCLUDE(cmake/Functions.cmake)
-INCLUDE(cmake/KitwareTools.cmake)
-OPTION(USE_QT4 "Build Qt4-based code" OFF)
-INCLUDE(cmake/Qt4Tools.cmake)
-IF(USE_QT4)
-  SET(
-    cpPlugins_Qt4_VTKWidget QVTKWidget
-    CACHE STRING "Base Qt4-based vtkRenderWindow"
-    )
-ENDIF(USE_QT4)
+endif(cpPlugins_BUILD)
+include(cmake/cpPlgInstallCommands.cmake)
 
-## ===========================
-## == Use all valid subdirs ==
-## ===========================
-
-SET(
-  _include_dirs
-  .
-  lib
-  lib/Itk2Vtk
-  lib/Instances
-  )
-FOREACH(_dir ${_include_dirs})
-  INCLUDE_DIRECTORIES(
-    ${PROJECT_SOURCE_DIR}/${_dir}
-    ${PROJECT_BINARY_DIR}/${_dir}
-    )
-ENDFOREACH(_dir)
-
-## ===========================
-## == Build different parts ==
-## ===========================
-
-SUBDIRS(appli cmake lib plugins)
+## == Prepare CMake scripts
+subdirs(cmake)
 
 ## eof - $RCSfile$