From 90842181926d00bcdfd2e26060b4a4af8a66b610 Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Tue, 14 Apr 2020 10:34:35 +0200 Subject: [PATCH] install targets to version-specific locations --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5439c33..afabc83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,10 +69,10 @@ write_basic_package_version_file( install( TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets - LIBRARY DESTINATION lib COMPONENT Runtime - ARCHIVE DESTINATION lib COMPONENT Development + LIBRARY DESTINATION lib/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Runtime + ARCHIVE DESTINATION lib/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Development RUNTIME DESTINATION bin COMPONENT Runtime - PUBLIC_HEADER DESTINATION include COMPONENT Development + PUBLIC_HEADER DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Development BUNDLE DESTINATION bin COMPONENT Runtime ) @@ -81,12 +81,12 @@ include(CMakePackageConfigHelpers) configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" - INSTALL_DESTINATION lib/cmake/${PROJECT_NAME} + INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION} ) install( EXPORT ${PROJECT_NAME}Targets - DESTINATION lib/cmake/${PROJECT_NAME} + DESTINATION lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION} ) install( @@ -94,10 +94,10 @@ install( "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" DESTINATION - lib/cmake/${PROJECT_NAME} + lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION} ) install( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ - DESTINATION include + DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION} )