aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2021-04-03 08:03:25 +0100
committerSimon Tatham <anakin@pobox.com>2021-04-03 08:03:25 +0100
commita1bab40025a821909eea7d47e6d0af5c27338833 (patch)
tree5db8bbb3bcc77ce7f17d1ab871f3659828f41d87
parente763b9ead86df6a92666525f8d2ed0385e251c61 (diff)
downloadpuzzles-a1bab40025a821909eea7d47e6d0af5c27338833.zip
puzzles-a1bab40025a821909eea7d47e6d0af5c27338833.tar.gz
puzzles-a1bab40025a821909eea7d47e6d0af5c27338833.tar.bz2
puzzles-a1bab40025a821909eea7d47e6d0af5c27338833.tar.xz
Support earlier versions of CMake.
At least, for the Unix build, so as to support Debian stable and a couple of prior Ubuntu LTSes. Not much needed to change in the cmake scripts; the only noticeable difference was that the 'install' command needs an explicit RUNTIME DESTINATION.
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/platforms/unix.cmake11
2 files changed, 11 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86c6c08..058107a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.16)
+cmake_minimum_required(VERSION 3.5)
project(puzzles
LANGUAGES C)
diff --git a/cmake/platforms/unix.cmake b/cmake/platforms/unix.cmake
index aeff797..3398b9d 100644
--- a/cmake/platforms/unix.cmake
+++ b/cmake/platforms/unix.cmake
@@ -66,7 +66,16 @@ endfunction()
function(set_platform_puzzle_target_properties NAME TARGET)
set_target_properties(${TARGET} PROPERTIES
OUTPUT_NAME ${NAME_PREFIX}${NAME})
- install(TARGETS ${TARGET})
+
+ if(CMAKE_VERSION VERSION_LESS 3.14)
+ # CMake 3.13 and earlier required an explicit install destination.
+ install(TARGETS ${TARGET} RUNTIME DESTINATION bin)
+ else()
+ # 3.14 and above selects a sensible default, which we should avoid
+ # overriding here so that end users can override it using
+ # CMAKE_INSTALL_BINDIR.
+ install(TARGETS ${TARGET})
+ endif()
endfunction()
function(build_platform_extras)