mirror of https://github.com/google/snappy.git
Add GNUInstallDirs to CMake configuration.
This is modeled after https://github.com/google/googletest/pull/1160. The immediate benefit is fixing the library install paths on 64-bit Linux distributions, which tend to support running 32-bit and 64-bit code side by side by installing 32-bit libraries in /usr/lib and 64-bit libraries in /usr/lib64.
This commit is contained in:
parent
632cd0f128
commit
55924d1109
|
@ -140,14 +140,20 @@ if(SNAPPY_BUILD_TESTS)
|
||||||
COMMAND "${PROJECT_BINARY_DIR}/snappy_unittest")
|
COMMAND "${PROJECT_BINARY_DIR}/snappy_unittest")
|
||||||
endif(SNAPPY_BUILD_TESTS)
|
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(
|
install(
|
||||||
FILES
|
FILES
|
||||||
"${PROJECT_SOURCE_DIR}/snappy-c.h"
|
"${PROJECT_SOURCE_DIR}/snappy-c.h"
|
||||||
"${PROJECT_SOURCE_DIR}/snappy-sinksource.h"
|
"${PROJECT_SOURCE_DIR}/snappy-sinksource.h"
|
||||||
"${PROJECT_SOURCE_DIR}/snappy.h"
|
"${PROJECT_SOURCE_DIR}/snappy.h"
|
||||||
"${PROJECT_BINARY_DIR}/snappy-stubs-public.h"
|
"${PROJECT_BINARY_DIR}/snappy-stubs-public.h"
|
||||||
DESTINATION include
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
|
@ -155,10 +161,14 @@ write_basic_package_version_file(
|
||||||
"${PROJECT_BINARY_DIR}/SnappyConfigVersion.cmake"
|
"${PROJECT_BINARY_DIR}/SnappyConfigVersion.cmake"
|
||||||
COMPATIBILITY SameMajorVersion
|
COMPATIBILITY SameMajorVersion
|
||||||
)
|
)
|
||||||
install(EXPORT SnappyTargets NAMESPACE Snappy:: DESTINATION lib/cmake/Snappy)
|
install(
|
||||||
|
EXPORT SnappyTargets
|
||||||
|
NAMESPACE Snappy::
|
||||||
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Snappy"
|
||||||
|
)
|
||||||
install(
|
install(
|
||||||
FILES
|
FILES
|
||||||
"${PROJECT_SOURCE_DIR}/cmake/SnappyConfig.cmake"
|
"${PROJECT_SOURCE_DIR}/cmake/SnappyConfig.cmake"
|
||||||
"${PROJECT_BINARY_DIR}/SnappyConfigVersion.cmake"
|
"${PROJECT_BINARY_DIR}/SnappyConfigVersion.cmake"
|
||||||
DESTINATION lib/cmake/Snappy
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Snappy"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue