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 authored and Sam Lantinga committed 2022-01-08 09:50:14 -08:00
1 parent 1694782b2a
commit 0696fc0134
2 files changed
+53 -13

No files matched your search

+9 -1
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)