diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a90a08..035f862 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,14 +140,20 @@ if(SNAPPY_BUILD_TESTS) COMMAND "${PROJECT_BINARY_DIR}/snappy_unittest") endif(SNAPPY_BUILD_TESTS) -install(TARGETS snappy EXPORT SnappyTargets DESTINATION lib) +include(GNUInstallDirs) +install(TARGETS snappy + EXPORT SnappyTargets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) install( FILES "${PROJECT_SOURCE_DIR}/snappy-c.h" "${PROJECT_SOURCE_DIR}/snappy-sinksource.h" "${PROJECT_SOURCE_DIR}/snappy.h" "${PROJECT_BINARY_DIR}/snappy-stubs-public.h" - DESTINATION include + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) include(CMakePackageConfigHelpers) @@ -155,10 +161,14 @@ write_basic_package_version_file( "${PROJECT_BINARY_DIR}/SnappyConfigVersion.cmake" COMPATIBILITY SameMajorVersion ) -install(EXPORT SnappyTargets NAMESPACE Snappy:: DESTINATION lib/cmake/Snappy) +install( + EXPORT SnappyTargets + NAMESPACE Snappy:: + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Snappy" +) install( FILES "${PROJECT_SOURCE_DIR}/cmake/SnappyConfig.cmake" "${PROJECT_BINARY_DIR}/SnappyConfigVersion.cmake" - DESTINATION lib/cmake/Snappy + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Snappy" )