From 9fbed3a31913043e3d9989ad893b90f9e6375479 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 20 Aug 2022 07:50:19 +0200 Subject: [PATCH] cmake: Workaround for missing INTERFACE_INCLUDE_DIRECTORIES (MacOS) This work-around adds the necessary include directories, as the 'libobs' target does not export any include directories visible without BUILD_INTERFACE evaluating to TRUE. Hopefully the true cause for this problem can be identified and fixed later. --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 649d1005..31172958 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -684,6 +684,21 @@ elseif(NOT TARGET OBS::libobs) # Add the missing OBS::libobs alias target if possible. add_library(OBS::libobs ALIAS libobs) endif() +if(D_PLATFORM_MAC) + # We may need to reconstruct the include directories on MacOS. + get_target_property(libobs_INTERFACE_INCLUDE_DIRECTORIES OBS::libobs INTERFACE_INCLUDE_DIRECTORIES) + if("${libobs_INTERFACE_INCLUDE_DIRECTORIES}" STREQUAL "libobs_INTERFACE_INCLUDE_DIRECTORIES-NOTFOUND") + get_target_property(libobs_IMPORTED_LOCATION_RELEASE OBS::libobs IMPORTED_LOCATION_RELEASE) + get_filename_component(libobs_IMPORTED_LOCATION_RELEASE "${libobs_IMPORTED_LOCATION_RELEASE}" DIRECTORY) + get_filename_component(libobs_IMPORTED_LOCATION_RELEASE "${libobs_IMPORTED_LOCATION_RELEASE}" DIRECTORY) + get_filename_component(libobs_IMPORTED_LOCATION_RELEASE "${libobs_IMPORTED_LOCATION_RELEASE}" DIRECTORY) + set(libobs_IMPORTED_LOCATION_RELEASE "${libobs_IMPORTED_LOCATION_RELEASE}/Headers") + set_target_properties(OBS::libobs PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES + "${libobs_IMPORTED_LOCATION_RELEASE}" + ) + endif() +endif() #- OBS: Front-End API set(obs-frontend-api_FOUND OFF)