]> git.jsancho.org Git - lugaru.git/commitdiff
CMake: Decrease required version (3.0) and use pkgconfig to detect SDL2
authorRémi Verschelde <rverschelde@gmail.com>
Wed, 14 Dec 2016 07:05:06 +0000 (08:05 +0100)
committerRémi Verschelde <rverschelde@gmail.com>
Wed, 14 Dec 2016 07:06:59 +0000 (08:06 +0100)
Some distros (e.g. CentOS 7+EPEL) do not provide the sdl2-config.cmake file
necessary for `find_package`.

Others still provide CMake 3.0 which works just fine (at least for Linux
compilation).

Also install Seven Tasks readme.

CMakeLists.txt

index 4cc0faa02ed9850c15657be4de74d7327067d825..044544f13406cdf5fa4c2ec44fb7e6eb9f107b62 100644 (file)
@@ -1,6 +1,6 @@
 project(lugaru)
 
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.0)
 cmake_policy(SET CMP0004 OLD)
 
 include(FindPkgConfig)
@@ -173,7 +173,9 @@ else(WIN32)
     find_package(OpenAL REQUIRED)
 endif(WIN32)
 
-find_package(sdl2 REQUIRED)
+# Not all distros provide sdl2-config.cmake yet
+#find_package(sdl2 REQUIRED)
+pkg_check_modules(SDL2 sdl2 REQUIRED)
 find_package(PNG REQUIRED)
 find_package(JPEG REQUIRED)
 find_package(ZLIB REQUIRED)
@@ -295,5 +297,6 @@ install(FILES ${CMAKE_SOURCE_DIR}/AUTHORS
               ${CMAKE_SOURCE_DIR}/RELEASE-NOTES.md
               ${CMAKE_SOURCE_DIR}/Docs/DEVTOOLS.txt
               ${CMAKE_SOURCE_DIR}/Docs/README.Empire.txt
+              ${CMAKE_SOURCE_DIR}/Docs/README.SevenTasks.txt
               ${CMAKE_SOURCE_DIR}/Docs/README.Temple.txt
         DESTINATION ${LUGARU_DOCDIR})