cmake: add `-F <SDL3-framework-parent-folder>` compile option in CMakeLists.txt

Anonymous Maarten 2023-02-13 05:14:40 +01:00
parent d0b39890d2
commit 236d26b480
2 changed files with 6 additions and 5 deletions

View File

@ -3159,7 +3159,12 @@ target_include_directories(SDL3_Headers
if(SDL_FRAMEWORK) if(SDL_FRAMEWORK)
target_include_directories(SDL3_Headers target_include_directories(SDL3_Headers
INTERFACE INTERFACE
"$<INSTALL_INTERFACE:SDL3.framework/Headers>" "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/SDL3.framework/Headers>"
)
# Add `-F <parent folder of SDL3.framework>` to make sure `#include "SDL3/..."` works.
target_compile_options(SDL3_Headers
INTERFACE
"$<INSTALL_INTERFACE:SHELL:-F $<INSTALL_PREFIX>>"
) )
else() else()
target_include_directories(SDL3_Headers target_include_directories(SDL3_Headers

View File

@ -14,10 +14,6 @@ set(_sdl3_framework @SDL_FRAMEWORK@)
# Find SDL3::Headers # Find SDL3::Headers
if(NOT TARGET SDL3::Headers) if(NOT TARGET SDL3::Headers)
include("${CMAKE_CURRENT_LIST_DIR}/SDL3headersTargets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/SDL3headersTargets.cmake")
# Manually add `-F <parent folder of SDL3.framework>` to make sure `#include "SDL3/..."` works.
if(_sdl3_framework)
set_property(TARGET SDL3::Headers APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "SHELL:-F \"@PACKAGE_CMAKE_INSTALL_PREFIX@\"")
endif()
endif() endif()
set(SDL3_Headers_FOUND TRUE) set(SDL3_Headers_FOUND TRUE)