X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=cmake%2FcpPlgDefinitions.cmake;fp=cmake%2FcpPlgDefinitions.cmake;h=1293f11c0fc6125573bd798ba85ac3fc7ed9f617;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=0000000000000000000000000000000000000000;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/cmake/cpPlgDefinitions.cmake b/cmake/cpPlgDefinitions.cmake new file mode 100644 index 0000000..1293f11 --- /dev/null +++ b/cmake/cpPlgDefinitions.cmake @@ -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$