Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cmake/LibraryConfigurations.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if(POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
endif()

set(RAYLIB_DEPENDENCIES "include(CMakeFindDependencyMacro)")

if (${PLATFORM} MATCHES "Desktop")
set(PLATFORM_CPP "PLATFORM_DESKTOP")

Expand Down Expand Up @@ -120,15 +122,17 @@ elseif ("${PLATFORM}" MATCHES "SDL")
find_package(SDL3 QUIET)
if(SDL3_FOUND)
message(STATUS "Found SDL3 via find_package()")
set(LIBS_PUBLIC SDL3::SDL3)
set(RAYLIB_DEPENDENCIES "${RAYLIB_DEPENDENCIES}\nfind_dependency(SDL3 REQUIRED)")
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
set(LIBS_PRIVATE SDL3::SDL3)
add_compile_definitions(USING_SDL3_PACKAGE)
else()
# Fallback to SDL2
find_package(SDL2 REQUIRED)
message(STATUS "Found SDL2 via find_package()")
set(PLATFORM_CPP "PLATFORM_DESKTOP_SDL")
set(LIBS_PRIVATE SDL2::SDL2)
set(LIBS_PUBLIC SDL2::SDL2)
set(RAYLIB_DEPENDENCIES "${RAYLIB_DEPENDENCIES}\nfind_dependency(SDL3 REQUIRED)")
add_compile_definitions(USING_SDL2_PACKAGE)
endif()
endif()
Expand Down
2 changes: 2 additions & 0 deletions cmake/raylib-config.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
@PACKAGE_INIT@
@RAYLIB_DEPENDENCIES@

include("${CMAKE_CURRENT_LIST_DIR}/raylib-targets.cmake")
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ if (BUILD_SHARED_LIBS)
endif ()

target_link_libraries(raylib PRIVATE $<BUILD_INTERFACE:${LIBS_PRIVATE}>)
target_link_libraries(raylib PUBLIC ${LIBS_PUBLIC})

# Sets some compile time definitions for the pre-processor
# If CUSTOMIZE_BUILD option is on you will not use config.h by default
Expand Down
Loading