Add support for installing with static libs when using DRM

This commit is contained in:
Chris Thrasher 2023-02-08 00:51:52 -07:00
parent 04483c58d9
commit 6aaf132d41

View File

@ -10,6 +10,10 @@ if(SFML_STATIC_LIBRARIES)
set(FIND_SFML_OS_WINDOWS 1) set(FIND_SFML_OS_WINDOWS 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(FIND_SFML_OS_LINUX 1) set(FIND_SFML_OS_LINUX 1)
if(@SFML_USE_DRM@)
set(FIND_SFML_USE_DRM 1)
endif()
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(FIND_SFML_OS_FREEBSD 1) set(FIND_SFML_OS_FREEBSD 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@ -44,7 +48,10 @@ if(SFML_STATIC_LIBRARIES)
# sfml-window # sfml-window
list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT_INDEX) list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT_INDEX)
if(FIND_SFML_WINDOW_COMPONENT_INDEX GREATER -1) if(FIND_SFML_WINDOW_COMPONENT_INDEX GREATER -1)
if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD) if(FIND_SFML_USE_DRM)
sfml_bind_dependency(TARGET DRM FRIENDLY_NAME "drm" SEARCH_NAMES "drm")
sfml_bind_dependency(TARGET GBM FRIENDLY_NAME "gbm" SEARCH_NAMES "gbm")
elseif(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD)
sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "X11" SEARCH_NAMES "X11") sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "X11" SEARCH_NAMES "X11")
sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xrandr" SEARCH_NAMES "Xrandr") sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xrandr" SEARCH_NAMES "Xrandr")
sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xcursor" SEARCH_NAMES "Xcursor") sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xcursor" SEARCH_NAMES "Xcursor")