From 23e1453cd0cd43f81d60292cc187076d41c6370e Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Fri, 27 Oct 2023 14:06:03 +0200 Subject: [PATCH] Revert "Merge pull request #9364 from taniabogatsch/increase-cmake-version" This reverts commit 2646836f6fa6b47b41b2db0a96f4e9f95a4c6449, reversing changes made to 71272844695fb7169beeeca23bd8f75e5434c204. --- CMakeLists.txt | 16 +++++++++++++--- extension/parquet/CMakeLists.txt | 2 +- third_party/imdb/CMakeLists.txt | 2 +- third_party/libpg_query/CMakeLists.txt | 2 +- third_party/re2/CMakeLists.txt | 3 ++- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 359f70d49c41..b38ff6c350eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 2.8.12) if(POLICY CMP0026) cmake_policy(SET CMP0026 NEW) @@ -22,7 +22,12 @@ find_package(Threads REQUIRED) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set (CMAKE_CXX_STANDARD 11) +if (CMAKE_VERSION VERSION_LESS "3.1") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +else () + set (CMAKE_CXX_STANDARD 11) +endif () + set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -624,7 +629,12 @@ function(link_extension_libraries LIBRARY) endfunction() function(link_threads LIBRARY) + if (CMAKE_VERSION VERSION_LESS "3.1") + target_link_libraries(${LIBRARY} pthread) + + else() target_link_libraries(${LIBRARY} Threads::Threads) + endif() endfunction() function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY PARAMETERS) @@ -1084,7 +1094,7 @@ if (NOT "${LOCAL_EXTENSION_REPO}" STREQUAL "") message(STATUS "Extensions will be deployed to: ${LOCAL_EXTENSION_REPO}") endif() -if (NOT EXTENSION_CONFIG_BUILD ) +if (CMAKE_VERSION VERSION_GREATER "3.0" AND NOT EXTENSION_CONFIG_BUILD ) # this does not work with 2.8 # Write the export set for build and install tree install(EXPORT "${DUCKDB_EXPORT_SET}" DESTINATION "${INSTALL_CMAKE_DIR}") export(EXPORT "${DUCKDB_EXPORT_SET}" diff --git a/extension/parquet/CMakeLists.txt b/extension/parquet/CMakeLists.txt index 1ef3305093f4..877ddf8689e5 100644 --- a/extension/parquet/CMakeLists.txt +++ b/extension/parquet/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 2.8.12) project(ParquetExtension) diff --git a/third_party/imdb/CMakeLists.txt b/third_party/imdb/CMakeLists.txt index 5d10dde6d2de..2875dd87ff89 100644 --- a/third_party/imdb/CMakeLists.txt +++ b/third_party/imdb/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 2.8.12) if(POLICY CMP0063) cmake_policy(SET CMP0063 NEW) diff --git a/third_party/libpg_query/CMakeLists.txt b/third_party/libpg_query/CMakeLists.txt index 5cb0aa6f6140..cb1e13d07191 100644 --- a/third_party/libpg_query/CMakeLists.txt +++ b/third_party/libpg_query/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 2.8.12) project(duckdb_pg_query CXX C) if(POLICY CMP0063) diff --git a/third_party/re2/CMakeLists.txt b/third_party/re2/CMakeLists.txt index df428ac1ea07..e7a7f586c79a 100644 --- a/third_party/re2/CMakeLists.txt +++ b/third_party/re2/CMakeLists.txt @@ -1,7 +1,8 @@ # Copyright 2015 The RE2 Authors. All Rights Reserved. Use of this source code # is governed by a BSD-style license that can be found in the LICENSE file. -cmake_minimum_required(VERSION 3.5) +# Old enough to support Ubuntu Trusty. +cmake_minimum_required(VERSION 2.8.12) if(POLICY CMP0048) cmake_policy(SET CMP0048 NEW)