Don't set SDL2_LIBRARY, we need the Framework configuration on Apple platforms

This commit is contained in:
Sam Lantinga 2022-05-27 14:47:39 -07:00 committed by Anonymous Maarten
parent 37ef6a765d
commit 423c7ef856

View file

@ -30,9 +30,6 @@ endif()
set(SDL2_FOUND TRUE)
set(SDL2_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../Headers")
set(SDL2_INCLUDE_DIRS "${SDL2_INCLUDE_DIR}")
set(SDL2_LIBRARY "${CMAKE_CURRENT_LIST_DIR}/../../SDL2")
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}")
@ -44,7 +41,7 @@ if(NOT TARGET SDL2::SDL2)
set_target_properties(SDL2::SDL2
PROPERTIES
INTERFACE_COMPILE_OPTIONS "-F;${SDL2_FRAMEWORK_PARENT_PATH}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_FRAMEWORK_PARENT_PATH}/SDL2.framework/Headers"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_FRAMEWORK_PATH}/Headers"
INTERFACE_LINK_OPTIONS "-F;${SDL2_FRAMEWORK_PARENT_PATH};-framework;SDL2"
)
endif()