From 23c9e3ec1ee16eef79bfebc5dd59de712e354ceb Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 16 Jun 2018 10:20:25 -0400 Subject: [PATCH] Raise minimum CMake version to 2.8.12 and remove compat code 2.8.12 is supported by our main CI targets and [repology] confirms that this is broadly supported. [repology]: https://repology.org/metapackage/cmake/information --- CMakeLists.txt | 34 +++++++--------------- src/nvim/CMakeLists.txt | 6 ---- third-party/CMakeLists.txt | 2 +- third-party/cmake/GettextCMakeLists.txt | 2 +- third-party/cmake/GperfCMakeLists.txt | 2 +- third-party/cmake/LibiconvCMakeLists.txt | 2 +- third-party/cmake/LibuvCMakeLists.txt | 2 +- third-party/cmake/Libvterm-tbl2inc_c.cmake | 2 +- third-party/cmake/LibvtermCMakeLists.txt | 2 +- third-party/cmake/UnibiliumCMakeLists.txt | 2 +- third-party/cmake/libtermkeyCMakeLists.txt | 2 +- 11 files changed, 19 insertions(+), 39 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d6610733b..cc40755b4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # intro: https://codingnest.com/basic-cmake/ # best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1 -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.12) project(nvim C) if(POLICY CMP0059) @@ -569,31 +569,17 @@ if(BUSTED_PRG) message(WARNING "disabling unit tests: no Luajit FFI in ${LUA_PRG}") endif() - if(${CMAKE_VERSION} VERSION_LESS 2.8.12) - if(CMAKE_GENERATOR MATCHES "Visual Studio") - set(TEST_LIBNVIM_PATH ${CMAKE_BINARY_DIR}/lib/nvim-test.dll) - else() - get_target_property(TEST_LIBNVIM_PATH nvim-test LOCATION) - endif() - configure_file( - ${CMAKE_SOURCE_DIR}/test/config/paths.lua.in - ${CMAKE_BINARY_DIR}/test/config/paths.lua) + if(LUA_HAS_FFI) + set(TEST_LIBNVIM_PATH $) else() - # To avoid duplicating paths.lua.in while we still support CMake < 2.8.12, - # use configure_file() to add the generator expression and then generate - # the final file - if(LUA_HAS_FFI) - set(TEST_LIBNVIM_PATH $) - else() - set(TEST_LIBNVIM_PATH "") - endif() - configure_file( - ${CMAKE_SOURCE_DIR}/test/config/paths.lua.in - ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen) - file(GENERATE - OUTPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua - INPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen) + set(TEST_LIBNVIM_PATH "") endif() + configure_file( + ${CMAKE_SOURCE_DIR}/test/config/paths.lua.in + ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen) + file(GENERATE + OUTPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua + INPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen) add_custom_target(functionaltest COMMAND ${CMAKE_COMMAND} diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index bdedce8076..825ebc29cf 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -394,12 +394,6 @@ endif() set(NVIM_EXEC_LINK_LIBRARIES ${NVIM_LINK_LIBRARIES} ${LUA_PREFERRED_LIBRARIES}) -if(CMAKE_VERSION VERSION_LESS "2.8.8") - # Use include_directories() because INCLUDE_DIRECTORIES target property - # is not supported - include_directories(${LUA_PREFERRED_INCLUDE_DIRS}) -endif() - # Don't use jemalloc in the unit test library. if(JEMALLOC_FOUND) list(APPEND NVIM_EXEC_LINK_LIBRARIES ${JEMALLOC_LIBRARIES}) diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 8aae8ea9e4..cf49a67f60 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -1,5 +1,5 @@ # This is not meant to be included by the top-level. -cmake_minimum_required (VERSION 2.8.7) +cmake_minimum_required (VERSION 2.8.12) project(NVIM_DEPS) # Needed for: check_c_compiler_flag() diff --git a/third-party/cmake/GettextCMakeLists.txt b/third-party/cmake/GettextCMakeLists.txt index 67ec0d113f..5a6253df3b 100644 --- a/third-party/cmake/GettextCMakeLists.txt +++ b/third-party/cmake/GettextCMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.12) project(gettext C) # Adds PREFIX to each item in LIST diff --git a/third-party/cmake/GperfCMakeLists.txt b/third-party/cmake/GperfCMakeLists.txt index 32837fc166..15ae305ba8 100644 --- a/third-party/cmake/GperfCMakeLists.txt +++ b/third-party/cmake/GperfCMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.12) project(gperf LANGUAGES C CXX) add_executable(gperf diff --git a/third-party/cmake/LibiconvCMakeLists.txt b/third-party/cmake/LibiconvCMakeLists.txt index d14b8529d4..8ad3cc9352 100644 --- a/third-party/cmake/LibiconvCMakeLists.txt +++ b/third-party/cmake/LibiconvCMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.12) project(libiconv C) include_directories( diff --git a/third-party/cmake/LibuvCMakeLists.txt b/third-party/cmake/LibuvCMakeLists.txt index 8b51a101c6..c9b7c56e7b 100644 --- a/third-party/cmake/LibuvCMakeLists.txt +++ b/third-party/cmake/LibuvCMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.12) project(libuv LANGUAGES C) file(GLOB UV_SOURCES_COMMON src/*.c) diff --git a/third-party/cmake/Libvterm-tbl2inc_c.cmake b/third-party/cmake/Libvterm-tbl2inc_c.cmake index b1ee0246f1..7a82f4248b 100644 --- a/third-party/cmake/Libvterm-tbl2inc_c.cmake +++ b/third-party/cmake/Libvterm-tbl2inc_c.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.12) set(HEX_ALPHABET "0123456789abcdef") diff --git a/third-party/cmake/LibvtermCMakeLists.txt b/third-party/cmake/LibvtermCMakeLists.txt index 27d0d11e9f..dad3ef62c2 100644 --- a/third-party/cmake/LibvtermCMakeLists.txt +++ b/third-party/cmake/LibvtermCMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 2.8.12) project(libvterm LANGUAGES C) include(GNUInstallDirs) diff --git a/third-party/cmake/UnibiliumCMakeLists.txt b/third-party/cmake/UnibiliumCMakeLists.txt index 49bc12c6b7..a96482bcbb 100644 --- a/third-party/cmake/UnibiliumCMakeLists.txt +++ b/third-party/cmake/UnibiliumCMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.12) project(unibilium LANGUAGES C) file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/*.c) diff --git a/third-party/cmake/libtermkeyCMakeLists.txt b/third-party/cmake/libtermkeyCMakeLists.txt index cb57631c1c..c55da7929a 100644 --- a/third-party/cmake/libtermkeyCMakeLists.txt +++ b/third-party/cmake/libtermkeyCMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.12) project(libtermkey) add_definitions(-D _CRT_SECURE_NO_WARNINGS)