Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Use GNUInstallDirs to install files to the correct paths #975

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project(libdatachannel
LANGUAGES CXX)
set(PROJECT_DESCRIPTION "C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets")

include(GNUInstallDirs)

# Options
option(USE_MBEDTLS "Use Mbed TLS instead of OpenSSL" OFF)
option(USE_GNUTLS "Use GnuTLS instead of OpenSSL" OFF)
Expand Down Expand Up @@ -445,27 +447,27 @@ if(WARNINGS_AS_ERRORS)
endif()

install(TARGETS datachannel EXPORT LibDataChannelTargets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

install(FILES ${LIBDATACHANNEL_HEADERS}
DESTINATION include/rtc
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rtc
)

# Export targets
install(
EXPORT LibDataChannelTargets
FILE LibDataChannelTargets.cmake
NAMESPACE LibDataChannel::
DESTINATION lib/cmake/LibDataChannel
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LibDataChannel
)

# Export config
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibDataChannelConfig.cmake
DESTINATION lib/cmake/LibDataChannel
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LibDataChannel
)

# Export config version
Expand All @@ -475,7 +477,7 @@ write_basic_package_version_file(
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
install(FILES ${CMAKE_BINARY_DIR}/LibDataChannelConfigVersion.cmake
DESTINATION lib/cmake/LibDataChannel)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LibDataChannel)

# Tests
if(NOT NO_TESTS)
Expand Down
Loading