Skip to content

Commit

Permalink
Use GNUInstallDirs instead of hard wiring install directories
Browse files Browse the repository at this point in the history
On a multilib setup cmake files should go into lib64.
  • Loading branch information
antonblanchard authored and AzothAmmo committed Jan 17, 2022
1 parent ca9aeaa commit 107f8c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ endif()

option(CEREAL_INSTALL "Generate the install target" ${CEREAL_MASTER_PROJECT})
if(CEREAL_INSTALL)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)

install(TARGETS cereal EXPORT ${PROJECT_NAME}Targets)
install(DIRECTORY include/cereal DESTINATION include)
install(DIRECTORY include/cereal DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

set(configFile ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake)
set(versionFile ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake)
set(configInstallDestination lib/cmake/${PROJECT_NAME})
set(configInstallDestination ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
Expand Down

0 comments on commit 107f8c2

Please sign in to comment.