]> Creatis software - FrontAlgorithms.git/blobdiff - CMakeLists.txt
...
[FrontAlgorithms.git] / CMakeLists.txt
index e652e5bd96773dc08b03a8a94fa87ae8216f466a..f0fe19b1a9e849fcdfa333382f65de3c6f954398 100644 (file)
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-
-# for CMake 2.6 corrected behaviour (see "cmake --help-policy CMP0003")
-IF(
-    COMMAND cmake_policy AND
-    ${CMAKE_MAJOR_VERSION} EQUAL 2 AND
-    ${CMAKE_MINOR_VERSION} GREATER 4
-    )
-  CMAKE_POLICY(SET CMP0003 NEW)
-  CMAKE_POLICY(SET CMP0005 NEW)
-  CMAKE_POLICY(SET CMP0011 NEW)
-  CMAKE_POLICY(SET CMP0012 NEW)
-ENDIF(
-  COMMAND cmake_policy AND
-  ${CMAKE_MAJOR_VERSION} EQUAL 2 AND
-  ${CMAKE_MINOR_VERSION} GREATER 4
-  )
-
-## ================
-## = Project name =
-## ================
-
-PROJECT(FrontAlgorithms)
-SET(FrontAlgorithms_MAJOR_VERSION   "0")
-SET(FrontAlgorithms_MINOR_VERSION   "0")
-SET(FrontAlgorithms_RELEASE_VERSION "1")
-SET(FrontAlgorithms_VERSION "${FrontAlgorithms_MAJOR_VERSION}.${FrontAlgorithms_MINOR_VERSION}.${FrontAlgorithms_RELEASE_VERSION}")
-
-## ===========
-## = Options =
-## ===========
-
-OPTION(BUILD_EXAMPLES "Build examples" OFF)
-OPTION(BUILD_SHARED_LIBS "Build shared libs" OFF)
-
-IF(BUILD_SHARED_LIBS)
-  SET(LIB_TYPE SHARED)
-ELSE(BUILD_SHARED_LIBS)
-  SET(LIB_TYPE STATIC)
-ENDIF(BUILD_SHARED_LIBS)
-
-## ============
-## = Packages =
-## ============
-
-INCLUDE(GenerateExportHeader)
-
-FIND_PACKAGE(VTK REQUIRED)
-FIND_PACKAGE(ITK REQUIRED)
-INCLUDE(${ITK_USE_FILE})
-
-## Check for required modules
-IF(NOT ITKVtkGlue_LOADED)
-  MESSAGE(FATAL_ERROR "ITKVtkGlue module is required but not available.")
-ENDIF(NOT ITKVtkGlue_LOADED)
-
-OPTION(USE_cpPlugins "Build cpPlugins based stuff" OFF)
-IF(USE_cpPlugins)
-  FIND_PACKAGE(cpPlugins REQUIRED)
-ENDIF(USE_cpPlugins)
-
-## ================================================
-## = Do not allow to build inside the source tree =
-## ================================================
-
-IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
-  MESSAGE(FATAL_ERROR "Building in the source tree is not allowed")
-ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
-
-## =====================================
-## = Where to put executables and libs =
-## =====================================
-
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
-SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
-MARK_AS_ADVANCED(
-  CMAKE_BACKWARDS_COMPATIBILITY
-  EXECUTABLE_OUTPUT_PATH
-  LIBRARY_OUTPUT_PATH
-  )
-
-## ==============================
-## = Subdirs containing headers =
-## ==============================
-
-INCLUDE_DIRECTORIES(
-  ${PROJECT_SOURCE_DIR}/lib
-  ${PROJECT_BINARY_DIR}/lib
-  )
-
-## ===========================
-## = Subdirs containing code =
-## ===========================
-
-SUBDIRS(
-  cmake
-  lib
-  appli
-  )
+## =========================================================================
+## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+## =========================================================================
+
+cmake_minimum_required(VERSION 3.0)
+
+## == Basic project configuration
+set(prj_NAME fpa)
+set(prj_MAJ 1)
+set(prj_MIN 0)
+set(prj_REL 0)
+
+## == Project definition
+project(${prj_NAME} VERSION "${prj_MAJ}.${prj_MIN}.${prj_REL}")
+
+## == Project 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)
+
+## == Find cpPlugins
+find_package(cpPlugins CONFIG REQUIRED)
+
+## == Find eigen3 (http://eigen.tuxfamily.org)
+find_package(Eigen3 QUIET CONFIG)
+if(Eigen3_FOUND)
+  include(${EIGEN3_USE_FILE})
+endif(Eigen3_FOUND)
+
+## == Build packages
+set(fpa_BUILD 1)
+subdirs(lib examples appli)
+
+## == Installation commands
+include(${cpPlugins_INSTALL_FILE})
 
 ## eof - $RCSfile$
+