mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-22 20:05:30 +00:00
cmake+xcode: use IMPORTED SHARED framework target
This commit is contained in:
parent
ddac844034
commit
10c292b055
|
@ -31,8 +31,15 @@ endmacro()
|
|||
|
||||
set(SDL2_FOUND TRUE)
|
||||
|
||||
string(REGEX REPLACE "SDL2\\.framework.*" "SDL2.framework" SDL2_FRAMEWORK_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||
string(REGEX REPLACE "SDL2\\.framework.*" "" SDL2_FRAMEWORK_PARENT_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||
# Compute the installation prefix relative to this file.
|
||||
set(SDL2_FRAMEWORK_PATH "${CMAKE_CURRENT_LIST_DIR}") # > /SDL2.framework/Resources/CMake/
|
||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" REALPATH) # > /SDL2.framework/Versions/Current/Resources/CMake
|
||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" REALPATH) # > /SDL2.framework/Versions/A/Resources/CMake/
|
||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/Versions/A/Resources/
|
||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/Versions/A/
|
||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/Versions/
|
||||
get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/
|
||||
get_filename_component(SDL2_FRAMEWORK_PARENT_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /
|
||||
|
||||
# For compatibility with autotools sdl2-config.cmake, provide SDL2_* variables.
|
||||
|
||||
|
@ -49,12 +56,12 @@ set(SDL2_LIBRARIES "SDL2::SDL2")
|
|||
# This is done for compatibility with CMake generated SDL2-target.cmake files.
|
||||
|
||||
if(NOT TARGET SDL2::SDL2)
|
||||
add_library(SDL2::SDL2 INTERFACE IMPORTED)
|
||||
add_library(SDL2::SDL2 SHARED IMPORTED)
|
||||
set_target_properties(SDL2::SDL2
|
||||
PROPERTIES
|
||||
INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${SDL2_FRAMEWORK_PARENT_PATH}\""
|
||||
FRAMEWORK "TRUE"
|
||||
IMPORTED_LOCATION "${SDL2_FRAMEWORK_PATH}/Versions/A/SDL2"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_OPTIONS "SHELL:-F \"${SDL2_FRAMEWORK_PARENT_PATH}\";SHELL:-framework SDL2"
|
||||
COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
|
||||
INTERFACE_SDL2_SHARED "ON"
|
||||
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
||||
|
|
Loading…
Reference in a new issue