Skip to content

Commit

Permalink
cmake: Workaround for missing INTERFACE_INCLUDE_DIRECTORIES (MacOS)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Xaymar committed Apr 5, 2023
1 parent 1d066ca commit 9fbed3a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9fbed3a

Please sign in to comment.