diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f1158b6c..fbeab2268 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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 @@ -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) diff --git a/cmake/LibDataChannelConfig.cmake b/cmake/LibDataChannelConfig.cmake.in similarity index 80% rename from cmake/LibDataChannelConfig.cmake rename to cmake/LibDataChannelConfig.cmake.in index cb2b884f9..6485e324f 100644 --- a/cmake/LibDataChannelConfig.cmake +++ b/cmake/LibDataChannelConfig.cmake.in @@ -1,2 +1,4 @@ +@PACKAGE_INIT@ + include("${CMAKE_CURRENT_LIST_DIR}/LibDataChannelTargets.cmake")