From c7558a9adf78f1cef9d8652210223bdded6b9571 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 14 Dec 2016 08:05:06 +0100 Subject: [PATCH] CMake: Decrease required version (3.0) and use pkgconfig to detect SDL2 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cc0faa..044544f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) -- 2.39.5