]> Creatis software - FrontAlgorithms.git/blobdiff - CMakeLists.txt
...
[FrontAlgorithms.git] / CMakeLists.txt
index 5b0669ec9a7e0b8e0bb751421f5c25083d94d79c..4aa96867e0c75bb107a4b87c004ae2857ff73210 100644 (file)
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
 
 ## ========================
 ## == Project definition ==
@@ -8,12 +8,13 @@ SET(prj_NAME FrontAlgorithms)
 SET(prj_MAJOR_VERSION   0)
 SET(prj_MINOR_VERSION   1)
 SET(prj_RELEASE_VERSION 0)
+SET(_subdirs lib plugins examples)
+SET(_policies CMP0015 CMP0020 CMP0042)
 
 ## ==========================
 ## == Some useful policies ==
 ## ==========================
 
-SET(_policies CMP0015 CMP0020 CMP0042)
 FOREACH(_p ${_policies})
   IF(POLICY ${_p})
     CMAKE_POLICY(SET ${_p} NEW)
@@ -35,38 +36,22 @@ SET(prj_SHORT_VERSION "${prj_MAJOR_VERSION}")
 ## == Functions, packages and options ==
 ## =====================================
 
-INCLUDE(cmake/DetectOS.cmake)
-INCLUDE(cmake/Restrictions.cmake)
-INCLUDE(cmake/Functions.cmake)
+INCLUDE(cmake/BaseConfig.cmake)
+OPTION(USE_cpPlugins "Build cpPlugins-based code" OFF)
+IF(USE_cpPlugins)
+  FIND_PACKAGE(cpPlugins)
+  MARK_AS_ADVANCED(CLEAR cpPlugins_DIR)
+ENDIF(USE_cpPlugins)
 INCLUDE(cmake/KitwareTools.cmake)
-INCLUDE(cmake/Options.cmake)
+INCLUDE(cmake/QtTools.cmake)
+INCLUDE(cmake/Functions.cmake)
 
 ## ===========================
-## == Use all valid subdirs ==
+## == Build different parts ==
 ## ===========================
 
-SET(
-  _include_dirs
-  .
-  lib
-  )
-IF(USE_cpPlugins)
-  LIST(APPEND _include_dirs lib/Instances)
-ENDIF(USE_cpPlugins)
-FOREACH(_dir ${_include_dirs})
-  INCLUDE_DIRECTORIES(
-    ${PROJECT_SOURCE_DIR}/${_dir}
-    ${PROJECT_BINARY_DIR}/${_dir}
-    )
-ENDFOREACH(_dir)
-
-## ========================
-## == Manage source code ==
-## ========================
-
-SUBDIRS(lib)
-IF(USE_cpPlugins)
-  SUBDIRS(plugins)
-ENDIF(USE_cpPlugins)
+FOREACH(_s ${_subdirs})
+  SUBDIRS(${_s})
+ENDFOREACH(_s)
 
 ## eof - $RCSfile$