diff --git a/CMakeLists.txt b/CMakeLists.txt index bcf29eb7..2997ca42 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,13 @@ message(STATUS "generic CMP client version " ${GENCMPCLIENT_VERSION}) # set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # needed for sonarCloud scanner +#if(UNIX AND NOT APPLE) + set(CMAKE_INSTALL_PREFIX "/usr") +#else() +# set(CMAKE_INSTALL_PREFIX "tmp") +#endif() +include(GNUInstallDirs) # CMAKE_INSTALL_PREFIX must be set before + # https://cmake.org/cmake/help/v3.6/module/FindOpenSSL.html if(NOT "$ENV{OPENSSL_DIR}" STREQUAL "") set(OPENSSL_ROOT_DIR $ENV{OPENSSL_DIR}) @@ -62,10 +69,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") # help CPackDeb please dpkg-shlibdeps if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20.0") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS - "../lib/${CMAKE_INSTALL_FULL_LIBDIR}") + tmp${CMAKE_INSTALL_FULL_LIBDIR} "../lib/${CMAKE_INSTALL_LIBDIR}") else() set(CMAKE_INSTALL_RPATH # must be done before add_executable() - "../lib/${CMAKE_INSTALL_FULL_LIBDIR}") + tmp/{CMAKE_INSTALL_FULL_LIBDIR} "../lib/${CMAKE_INSTALL_LIBDIR}") endif() endif() @@ -186,15 +193,9 @@ endif() # installation and uninstall -#if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR (UNIX AND NOT APPLE)) - set(CMAKE_INSTALL_PREFIX "/usr") -#else() -# set(CMAKE_INSTALL_PREFIX "tmp") -#endif() if(DEFINED ENV{ROOTFS}) set(CMAKE_INSTALL_PREFIX $ENV{ROOTFS} CACHE PATH "comment" FORCE) endif() -include(GNUInstallDirs) # CMAKE_INSTALL_PREFIX must be set before install(FILES doc/Generic_CMP_client_API.pdf DESTINATION ${CMAKE_INSTALL_DOCDIR}-dev