Skip to content

Commit

Permalink
[CMake] Set CMAKE_INSTALL_FULL_LIBEXECDIR only for Linux
Browse files Browse the repository at this point in the history
On FreeBSD, it breaks the port's packaging under Poudriere, refer to freebsd/freebsd-ports@eb6c9c8.
Related to #360
  • Loading branch information
TheTumultuousUnicornOfDarkness committed Nov 27, 2024
1 parent 83d84ac commit 1025090
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ project(cpu-x
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(GNUInstallDirs)
if(NOT EXISTS ${CMAKE_INSTALL_FULL_LIBEXECDIR})
# Avoid to put files under /usr/libexec or /usr/local/libexec on Linux when the path does not exist
# On FreeBSD, /usr/local/libexec is missing under Poudriere (https://gitlab.com/FreeBSD/freebsd-ports/-/commit/eb6c9c8c4aa5981078c6b9b69527ecdaee5f22c9)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT EXISTS ${CMAKE_INSTALL_FULL_LIBEXECDIR})
set(CMAKE_INSTALL_LIBEXECDIR lib/${CMAKE_PROJECT_NAME})
set(CMAKE_INSTALL_FULL_LIBEXECDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR})
endif(NOT EXISTS ${CMAKE_INSTALL_FULL_LIBEXECDIR})
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT EXISTS ${CMAKE_INSTALL_FULL_LIBEXECDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/bin/)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/lib/)
set(CMAKE_DATA_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/data/)
Expand Down

0 comments on commit 1025090

Please sign in to comment.