From 43a49dca47344a5170159ef99b86b97f90d4e4ad Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Tue, 9 Aug 2022 23:50:38 +0200 Subject: [PATCH] cmake: Fix CMake package export templates for CMake 3.24 CMake 3.24 implemented changes that break dependency discovery of the exported libraries built by OBS. --- deps/w32-pthreads/cmake/w32-pthreadsConfig.cmake.in | 2 -- libobs/cmake/libobsConfig.cmake.in | 13 +++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/deps/w32-pthreads/cmake/w32-pthreadsConfig.cmake.in b/deps/w32-pthreads/cmake/w32-pthreadsConfig.cmake.in index 40afeeefe..38bbde7b3 100644 --- a/deps/w32-pthreads/cmake/w32-pthreadsConfig.cmake.in +++ b/deps/w32-pthreads/cmake/w32-pthreadsConfig.cmake.in @@ -2,5 +2,3 @@ include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") check_required_components("@PROJECT_NAME@") - -set(LIBOBS_LIBRARIES w32-pthreads) diff --git a/libobs/cmake/libobsConfig.cmake.in b/libobs/cmake/libobsConfig.cmake.in index 40f49f88a..8e3c31c2e 100644 --- a/libobs/cmake/libobsConfig.cmake.in +++ b/libobs/cmake/libobsConfig.cmake.in @@ -1,14 +1,15 @@ @PACKAGE_INIT@ +include(CMakeFindDependencyMacro) + +if(MSVC) + find_dependency(w32-pthreads REQUIRED) +endif() +find_dependency(Threads REQUIRED) + include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") check_required_components("@PROJECT_NAME@") -if(MSVC) - find_package(w32-pthreads REQUIRED) -endif() - -find_package(Threads REQUIRED) - set(LIBOBS_PLUGIN_DESTINATION "@PACKAGE_OBS_PLUGIN_DESTINATION@") set(LIBOBS_PLUGIN_DATA_DESTINATION "@PACKAGE_OBS_DATA_DESTINATION@/obs-plugins")