From cb6d3d245809fa0ba827f4adfc704e5cde761a26 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Fri, 7 Jun 2019 17:05:12 -0700 Subject: [PATCH] increase minimal requirement to 3.4 Signed-off-by: Nikolaj Bjorner --- examples/c++/CMakeLists.txt | 15 +++------------ examples/c/CMakeLists.txt | 17 ++++------------- examples/maxsat/CMakeLists.txt | 2 +- examples/tptp/CMakeLists.txt | 2 +- 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/examples/c++/CMakeLists.txt b/examples/c++/CMakeLists.txt index 52758889d..a71fd061a 100644 --- a/examples/c++/CMakeLists.txt +++ b/examples/c++/CMakeLists.txt @@ -2,7 +2,7 @@ # Example C++ project ################################################################################ project(Z3_C_EXAMPLE CXX) -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.4) find_package(Z3 REQUIRED CONFIG @@ -17,17 +17,8 @@ find_package(Z3 ################################################################################ # Z3 C++ API bindings require C++11 ################################################################################ -if ("${CMAKE_VERSION}" VERSION_LESS "3.1") - # Legacy CMake support - if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - else() - message(FATAL_ERROR "Setting C++ version to C++11 not supported for \"${CMAKE_CXX_COMPILER_ID}\"") - endif() -else () - set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_STANDARD_REQUIRED ON) -endif () +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) message(STATUS "Z3_FOUND: ${Z3_FOUND}") message(STATUS "Found Z3 ${Z3_VERSION_STRING}") diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index e45c82d37..943858347 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -6,19 +6,10 @@ # C++ we will use the C linker rather than the C++ linker and will not link # the C++ standard library in resulting in a link failure. project(Z3_C_EXAMPLE C CXX) -cmake_minimum_required(VERSION 2.8.12) - -# Set C version required to C99 -if ("${CMAKE_VERSION}" VERSION_LESS "3.1") - if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR - ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ") - endif() -else() - set(CMAKE_C_STANDARD_REQUIRED ON) - set(CMAKE_C_STANDARD 99) - set(CMAKE_C_EXTENSIONS OFF) -endif() +cmake_minimum_required(VERSION 3.4) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_EXTENSIONS OFF) find_package(Z3 REQUIRED diff --git a/examples/maxsat/CMakeLists.txt b/examples/maxsat/CMakeLists.txt index e59486297..1e184e535 100644 --- a/examples/maxsat/CMakeLists.txt +++ b/examples/maxsat/CMakeLists.txt @@ -6,7 +6,7 @@ # C++ we will use the C linker rather than the C++ linker and will not link # the C++ standard library in resulting in a link failure. project(Z3_C_MAXSAT_EXAMPLE C CXX) -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.4) find_package(Z3 REQUIRED CONFIG diff --git a/examples/tptp/CMakeLists.txt b/examples/tptp/CMakeLists.txt index 7870e5408..0050c01a2 100644 --- a/examples/tptp/CMakeLists.txt +++ b/examples/tptp/CMakeLists.txt @@ -2,7 +2,7 @@ # TPTP example ################################################################################ project(Z3_TPTP5 CXX) -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.4) find_package(Z3 REQUIRED CONFIG