]> Creatis software - cpPlugins.git/blob - cmake/cpPlgDefinitions.cmake
Moved to version 1.0
[cpPlugins.git] / cmake / cpPlgDefinitions.cmake
1 ## =========================================================================
2 ## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 ## =========================================================================
4
5 ## == If working on a MacOSX, activate the use of RPATH's
6 ## == Furthermore: prepare the type of executables
7 set(APP_TYPE "" CACHE STRING "Executable linking." FORCE)
8 if(APPLE)
9   set(APP_TYPE "MACOSX_BUNDLE" CACHE STRING "Executable linking." FORCE)
10   set(CMAKE_MACOSX_RPATH true CACHE BOOL "Use RPATH's on MacOSX." FORCE)
11   mark_as_advanced(CMAKE_MACOSX_RPATH)
12 elseif(WIN32)
13   set(APP_TYPE "WIN32" CACHE STRING "Executable linking." FORCE)
14 endif(APPLE)
15 mark_as_advanced(APP_TYPE)
16
17 ## == Force c++17
18 set(CMAKE_CXX_STANDARD 17)
19
20 ## == Prepare header generator to build shared libs
21 include(GenerateExportHeader)
22
23 ## == Do not allow to build inside the source tree
24 if(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
25   message(FATAL_ERROR "Building in the source tree is not allowed.")
26 endif(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
27
28 ## == Where to put targets (executables and libs)
29 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
30 set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
31 mark_as_advanced(
32   CMAKE_BACKWARDS_COMPATIBILITY
33   EXECUTABLE_OUTPUT_PATH
34   LIBRARY_OUTPUT_PATH
35   )
36
37 ## eof - $RCSfile$