mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
[build][cmake] Improve cmake config file generation (#4541)
* Improve cmake config file generation
This allows for finding raylib on a non-standard location (eg, not in /usr/lib{,64})
* Only have glfw as private if using internal glfw and not static
This commit is contained in:
committed by
GitHub
parent
79188f570b
commit
c53dd8a931
23
cmake/SetupCmakeConfig.cmake
Normal file
23
cmake/SetupCmakeConfig.cmake
Normal file
@ -0,0 +1,23 @@
|
||||
include(CMakePackageConfigHelpers)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Setup install of exported targets
|
||||
install(EXPORT raylib-targets
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/raylib
|
||||
)
|
||||
|
||||
# Macro to write config
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake"
|
||||
VERSION ${raylib_VERSION}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
# Setup install of version config
|
||||
install(
|
||||
FILES
|
||||
"../cmake/raylib-config.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake"
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_LIBDIR}/cmake/raylib
|
||||
)
|
||||
Reference in New Issue
Block a user