Improve cmake config file generation

This allows for finding raylib on a non-standard location (eg, not in /usr/lib{,64})
This commit is contained in:
Leonardo 2024-11-25 21:57:47 -03:00
commit 246ec831df

View file

@ -17,7 +17,12 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
set(GLFW_LIBRARY_TYPE "OBJECT" CACHE STRING "" FORCE)
if (NOT BUILD_SHARED_LIBS)
message(STATUS "Enabling install of GLFW static libs because raylib will be built statically")
set(GLFW_INSTALL ON CACHE BOOL "" FORCE)
endif ()
add_subdirectory(external/glfw)
@ -25,7 +30,7 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT
if (BUILD_SHARED_LIBS)
set_property(TARGET glfw PROPERTY C_VISIBILITY_PRESET hidden)
endif()
list(APPEND raylib_sources $<TARGET_OBJECTS:glfw>)
include_directories(BEFORE SYSTEM external/glfw/include)
elseif("${PLATFORM}" STREQUAL "DRM")