[PATCH] CMake: configure and install sdl2-config.cmake

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[PATCH] CMake: configure and install sdl2-config.cmake

Bugzilla from mezin.alexander@gmail.com
Autotools build scripts installed sdl2-config.cmake, but CMake build
scripts did't.
This patch fixes the problem. Though there is still no config for MSVC builds.

 CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fe7e22a..6cb8739 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1506,8 +1506,8 @@ if(NOT WINDOWS OR CYGWIN)

     "${SDL2_BINARY_DIR}/sdl2.pc" @ONLY)
-  configure_file("${SDL2_SOURCE_DIR}/sdl2-config.in"
-    "${SDL2_BINARY_DIR}/sdl2-config")
+  configure_file("${SDL2_SOURCE_DIR}/sdl2-config.cmake.in"
+    "${SDL2_BINARY_DIR}/sdl2-config.cmake" @ONLY)
     "${SDL2_BINARY_DIR}/sdl2-config" @ONLY)
@@ -1637,6 +1637,8 @@ if(NOT (WINDOWS OR CYGWIN))
     install(FILES ${SDL2_BINARY_DIR}/sdl2.pc
       DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
+  install(FILES ${SDL2_BINARY_DIR}/sdl2-config.cmake
+    DESTINATION "lib${LIB_SUFFIX}/cmake/SDL2")
   install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION bin)
   # TODO: what about the .spec file? Is it only needed for RPM creation?
   install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION
2.10.1 (Apple Git-78)
SDL mailing list
[hidden email]