Skip to content

Commit

Permalink
Use GNUInstallDirs.
Browse files Browse the repository at this point in the history
  • Loading branch information
damaestro authored and christian-rauch committed May 20, 2024
1 parent a29c8a4 commit 9d8fef7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake @ONLY IMMEDIATE )
#######################################################
## Install headers / targets

include(GNUInstallDirs)
# This relative path allows installed files to be relocatable.
set( CMAKECONFIG_INSTALL_DIR lib/cmake/${PROJECT_NAME} )
set( CMAKECONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} )
file( RELATIVE_PATH REL_INCLUDE_DIR
"${CMAKE_INSTALL_PREFIX}/${CMAKECONFIG_INSTALL_DIR}"
"${CMAKE_INSTALL_PREFIX}/include"
Expand All @@ -140,10 +141,10 @@ file( RELATIVE_PATH REL_INCLUDE_DIR
install(
TARGETS ${component_list}
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(
Expand Down

0 comments on commit 9d8fef7

Please sign in to comment.