diff --git a/cmake/CPackSetup.cmake b/cmake/CPackSetup.cmake index 01929c1acd..f812f0ace6 100644 --- a/cmake/CPackSetup.cmake +++ b/cmake/CPackSetup.cmake @@ -1,9 +1,10 @@ include(GNUInstallDirs) set(DPP_EXPORT_NAME dpp) +set(DPP_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${DPP_EXPORT_NAME}) set(DPP_VERSIONED ${DPP_EXPORT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) set(DPP_VERSION_FILE ${PROJECT_BINARY_DIR}/${DPP_EXPORT_NAME}-config-version.cmake) -set(DPP_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${DPP_VERSIONED}) -set(DPP_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}/${DPP_VERSIONED}) +set(DPP_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}) +set(DPP_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}) ## Pack the binary output install(TARGETS dpp @@ -19,15 +20,11 @@ write_basic_package_version_file(${DPP_VERSION_FILE} VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) -## Package the include headers (the trailing slash is important, otherwise -## the include folder will be copied, instead of it's contents) -install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/" DESTINATION "${DPP_INSTALL_INCLUDE_DIR}") - ## Include the file which allows `find_package(libdpp)` to function. -install(FILES "${CMAKE_SOURCE_DIR}/cmake/libdpp-config.cmake" "${DPP_VERSION_FILE}" DESTINATION "${DPP_INSTALL_LIBRARY_DIR}") +install(FILES "${CMAKE_SOURCE_DIR}/cmake/libdpp-config.cmake" "${DPP_VERSION_FILE}" DESTINATION "${DPP_CMAKE_DIR}") ## Export the targets to allow other projects to easily include this project -install(EXPORT "${DPP_EXPORT_NAME}" DESTINATION "${DPP_INSTALL_LIBRARY_DIR}" NAMESPACE dpp::) +install(EXPORT "${DPP_EXPORT_NAME}" DESTINATION "${DPP_CMAKE_DIR}" NAMESPACE dpp::) # Prepare information for packaging into .zip, .deb, .rpm ## Project installation metadata