Skip to content

Commit

Permalink
fixup! CMakeLists.txt: fix CMAKE_INSTALL_PREFIX for non-Unix and MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
DDvO committed Mar 14, 2024
1 parent 0990b6c commit 359b829
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 359b829

Please sign in to comment.