]> Creatis software - cpPlugins.git/blobdiff - cmake/cpPlgDefinitions.cmake
Moved to version 1.0
[cpPlugins.git] / cmake / cpPlgDefinitions.cmake
diff --git a/cmake/cpPlgDefinitions.cmake b/cmake/cpPlgDefinitions.cmake
new file mode 100644 (file)
index 0000000..1293f11
--- /dev/null
@@ -0,0 +1,37 @@
+## =========================================================================
+## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+## =========================================================================
+
+## == If working on a MacOSX, activate the use of RPATH's
+## == Furthermore: prepare the type of executables
+set(APP_TYPE "" CACHE STRING "Executable linking." FORCE)
+if(APPLE)
+  set(APP_TYPE "MACOSX_BUNDLE" CACHE STRING "Executable linking." FORCE)
+  set(CMAKE_MACOSX_RPATH true CACHE BOOL "Use RPATH's on MacOSX." FORCE)
+  mark_as_advanced(CMAKE_MACOSX_RPATH)
+elseif(WIN32)
+  set(APP_TYPE "WIN32" CACHE STRING "Executable linking." FORCE)
+endif(APPLE)
+mark_as_advanced(APP_TYPE)
+
+## == Force c++17
+set(CMAKE_CXX_STANDARD 17)
+
+## == Prepare header generator to build shared libs
+include(GenerateExportHeader)
+
+## == 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 targets (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
+  )
+
+## eof - $RCSfile$