From 7f4da303cb09d7ca450ad3e33734782e7e827e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 7 Oct 2019 14:31:59 +0200 Subject: [PATCH] Require at least CMake 3.4. --- CMakeLists.txt | 11 ++--------- doc/building.dox | 2 +- doc/changelog.dox | 9 +++++++++ doc/generated/CMakeLists.txt | 4 ++-- package/ci/travis.yml | 4 ++-- src/Magnum/Platform/CMakeLists.txt | 1 + 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07209938b..996a5400f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,21 +23,14 @@ # DEALINGS IN THE SOFTWARE. # -cmake_minimum_required(VERSION 3.1) - -# Configuration fails on < 3.4 if only C++ is enabled (CheckFunctionExists -# macro called from FindX11). Also, Android needs C for compiling some glue -# code. -if(NOT CMAKE_VERSION VERSION_LESS 3.4.0 AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android") - set(LANG CXX) -endif() +cmake_minimum_required(VERSION 3.4) option(HUNTER_ENABLED "Get dependencies (Corrade, GLFW, SDL2, ...) via Hunter" OFF) if(HUNTER_ENABLED) include(${CMAKE_CURRENT_LIST_DIR}/package/hunter/HunterInit.cmake) endif() -project(Magnum ${LANG}) +project(Magnum CXX) if(HUNTER_ENABLED) include(${CMAKE_CURRENT_LIST_DIR}/package/hunter/HunterAddPackages.cmake) diff --git a/doc/building.dox b/doc/building.dox index ad3368a58..a5313f821 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -40,7 +40,7 @@ Minimal set of tools and libraries required for building is: - C++ compiler with good C++11 support. Compilers which are tested to have everything needed are **GCC** >= 4.8.1, **Clang** >= 3.3 and **MSVC** >= 2015. On Windows you can also use **MinGW-w64**. -- **CMake** >= 3.1 +- **CMake** >= 3.4 - **Corrade** --- Plugin management and utility library. See @ref building-corrade "Corrade download and installation guide" for more information. diff --git a/doc/changelog.dox b/doc/changelog.dox index c16b0bae3..3248155ec 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -38,6 +38,15 @@ See also: @section changelog-latest Changes since 2019.01 +@subsection changelog-latest-dependencies Dependency changes + +- Minimal supported CMake version is now 3.4. Older versions are not + supported anymore and all workarounds for them were removed. Download a + prebuilt release of a newer version if you need to use Corrade on older + systems (such as Ubuntu 14.04 or Debian 8). This is a conservative change + that shouldn't affect any additional distribution compared to the CMake 3.1 + requirement in 2019.01. + @subsection changelog-latest-new New features - MSVC 2019 compatibility, with slightly less workarounds needed compared to diff --git a/doc/generated/CMakeLists.txt b/doc/generated/CMakeLists.txt index dac28265a..4e24d6e4a 100644 --- a/doc/generated/CMakeLists.txt +++ b/doc/generated/CMakeLists.txt @@ -23,9 +23,9 @@ # DEALINGS IN THE SOFTWARE. # -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.4) -project(MagnumDocumentationImageGenerator) +project(MagnumDocumentationImageGenerator CXX) set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../modules/" ${CMAKE_MODULE_PATH}) diff --git a/package/ci/travis.yml b/package/ci/travis.yml index 9efde6577..942c7ed55 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -212,12 +212,12 @@ install: - if [ "$TRAVIS_OS_NAME" == "linux" ] && ( [ "$TARGET" == "desktop" ] || [ "$TARGET" == "desktop-sanitizers" ] ); then export PLATFORM_GL_API=GLX; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-gles" ]; then export PLATFORM_GL_API=EGL; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "android" ]; then wget -nc https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip && unzip -q android-*.zip; fi -# Download CMake 3.1.3 to ensure we're still compatible with it (Travis has +# Download CMake 3.4.3 to ensure we're still compatible with it (Travis has # 3.9 since December 2017). Also, the PATH setting can't be cached, so it's # separate (bit me two times already). Android needs CMake 3.7, but # https://gitlab.kitware.com/cmake/cmake/issues/17253 is fixed in 3.9.2, so # grab that. FindVulkan is since 3.7, in that case just use the system package. -- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! "$TARGET" == "desktop-vulkan" ] && [ ! "$TARGET" == "android" ] && [ ! -e "$HOME/cmake/bin" ]; then cd $HOME ; wget -nc --no-check-certificate https://cmake.org/files/v3.1/cmake-3.1.3-Linux-x86_64.tar.gz && mkdir -p cmake && cd cmake && tar --strip-components=1 -xzf ../cmake-3.1.3-Linux-x86_64.tar.gz && cd $TRAVIS_BUILD_DIR ; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! "$TARGET" == "desktop-vulkan" ] && [ ! "$TARGET" == "android" ] && [ ! -e "$HOME/cmake/bin" ]; then cd $HOME ; wget -nc --no-check-certificate https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz && mkdir -p cmake && cd cmake && tar --strip-components=1 -xzf ../cmake-3.4.3-Linux-x86_64.tar.gz && cd $TRAVIS_BUILD_DIR ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "android" ] && [ ! -e "$HOME/cmake/bin" ]; then cd $HOME ; wget -nc --no-check-certificate https://cmake.org/files/v3.9/cmake-3.9.2-Linux-x86_64.tar.gz && mkdir -p cmake && cd cmake && tar --strip-components=1 -xzf ../cmake-3.9.2-Linux-x86_64.tar.gz && cd $TRAVIS_BUILD_DIR ; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ ! "$TARGET" == "desktop-vulkan" ]; then export PATH=$HOME/cmake/bin:$PATH && cmake --version; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja; fi diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt index 78b19c444..6e73220f1 100644 --- a/src/Magnum/Platform/CMakeLists.txt +++ b/src/Magnum/Platform/CMakeLists.txt @@ -144,6 +144,7 @@ if(WITH_ANDROIDAPPLICATION) set(MagnumAndroidApplication_PRIVATE_HEADERS Implementation/Egl.h) + enable_language(C) add_library(MagnumAndroidApplicationGlue OBJECT "${CMAKE_ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c") set_target_properties(MagnumAndroidApplicationGlue PROPERTIES