Skip to content

Commit

Permalink
Merge pull request #1184 from paullouisageneau/cmake-enhancements
Browse files Browse the repository at this point in the history
CMake enhancements
  • Loading branch information
paullouisageneau authored May 14, 2024
2 parents 66b95ae + 864525c commit 529611d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
28 changes: 15 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ set(LIBDATACHANNEL_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/h265rtppacketizer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/h265nalunit.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/av1rtppacketizer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/nalunit.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rtcpnackresponder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rtp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/capi.cpp
Expand Down Expand Up @@ -120,7 +119,6 @@ set(LIBDATACHANNEL_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/h265rtppacketizer.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/h265nalunit.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/av1rtppacketizer.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/nalunit.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/rtcpnackresponder.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/utils.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/rtc/plihandler.hpp
Expand Down Expand Up @@ -474,20 +472,24 @@ install(
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LibDataChannel
)

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

# Export config version
include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibDataChannelConfig.cmake.in
${CMAKE_BINARY_DIR}/LibDataChannelConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LibDataChannel
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
write_basic_package_version_file(
${CMAKE_BINARY_DIR}/LibDataChannelConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
# Export config and version files
install(FILES
${CMAKE_BINARY_DIR}/LibDataChannelConfig.cmake
${CMAKE_BINARY_DIR}/LibDataChannelConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
install(FILES ${CMAKE_BINARY_DIR}/LibDataChannelConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LibDataChannel)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LibDataChannel)

# Tests
if(NOT NO_TESTS)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/LibDataChannelTargets.cmake")

0 comments on commit 529611d

Please sign in to comment.