cmake: Split SDL2-static and SDL2main into their own target exports

This makes it so that the generated targets are not interdependent,
which allows Linux distributions to split libraries into the
appropriate subpackages as needed.
This commit is contained in:
Neal Gompa
2022-01-07 14:30:26 -05:00
committed by Sam Lantinga
parent 1694782b2a
commit 0696fc0134
2 changed files with 53 additions and 13 deletions

View File

@@ -1,4 +1,12 @@
include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake")
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake")
endif()
# on static-only builds create an alias
if(NOT TARGET SDL2::SDL2 AND TARGET SDL2::SDL2-static)