Skip to content

Commit

Permalink
Establish minimum CMake version 3.15 (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews authored Aug 16, 2024
1 parent 7cb7e3f commit d9422f5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
cxxstd: 14
arch: 64
packages: 'g++-7-multilib gcc-7-multilib'
cmake: 3.13.*
cmake: 3.17.*
os: ubuntu-20.04

- cxx_compiler: g++-7
Expand All @@ -63,7 +63,7 @@ jobs:
cxxstd: 14
arch: 32
packages: 'g++-7-multilib gcc-7-multilib g++-multilib gcc-multilib'
cmake: 3.13.*
cmake: 3.18.*
os: ubuntu-20.04

- cxx_compiler: g++-8
Expand All @@ -72,7 +72,7 @@ jobs:
cxxstd: 14
arch: 64
packages: 'g++-8-multilib gcc-8-multilib'
cmake: 3.13.*
cmake: 3.21.*
os: ubuntu-20.04

- cxx_compiler: g++-9
Expand All @@ -81,7 +81,7 @@ jobs:
cxxstd: 14
arch: 64
packages: 'g++-9-multilib gcc-9-multilib'
cmake: 3.13.*
cmake: 3.23.*
os: ubuntu-20.04

- cxx_compiler: g++-10
Expand All @@ -90,7 +90,7 @@ jobs:
cxxstd: 14
arch: 64
packages: 'g++-10-multilib gcc-10-multilib'
cmake: 3.13.*
cmake: 3.25.*
os: ubuntu-20.04

# gcc 10 and lower are not supported
Expand All @@ -102,7 +102,7 @@ jobs:
cxxstd: 17
arch: 64
packages: 'g++-11-multilib gcc-11-multilib'
cmake: 3.22.*
cmake: 3.27.*
os: ubuntu-22.04

- cxx_compiler: g++-12
Expand All @@ -111,7 +111,7 @@ jobs:
cxxstd: 20
arch: 64
packages: 'g++-12-multilib gcc-12-multilib'
cmake: 3.22.*
cmake: 3.29.*
os: ubuntu-22.04

# - cxx_compiler: g++-13
Expand All @@ -132,7 +132,7 @@ jobs:
cxxstd: 14
arch: 64
packages: 'clang-7'
cmake: 3.13.*
cmake: 3.15.*
os: ubuntu-20.04

- cxx_compiler: clang++-8
Expand All @@ -141,7 +141,7 @@ jobs:
cxxstd: 14
arch: 64
packages: 'clang-8'
cmake: 3.13.*
cmake: 3.17.*
os: ubuntu-20.04

- cxx_compiler: clang++-9
Expand All @@ -150,7 +150,7 @@ jobs:
cxxstd: 14
arch: 64
packages: 'clang-9'
cmake: 3.13.*
cmake: 3.20.*
os: ubuntu-20.04

- cxx_compiler: clang++-10
Expand All @@ -159,7 +159,7 @@ jobs:
cxxstd: 14
arch: 64
packages: 'clang-10'
cmake: 3.17.*
cmake: 3.21.*
os: ubuntu-20.04

# clang 10 and lower are not supported
Expand All @@ -171,7 +171,7 @@ jobs:
cxxstd: 14
arch: 64
packages: 'clang-11'
cmake: 3.25.*
cmake: 3.23.*
os: ubuntu-22.04

- cxx_compiler: clang++-12
Expand All @@ -189,7 +189,7 @@ jobs:
cxxstd: 17
arch: 64
packages: 'clang-13'
cmake: 3.25.*
cmake: 3.27.*
os: ubuntu-22.04

- cxx_compiler: clang++-14
Expand All @@ -198,7 +198,7 @@ jobs:
cxxstd: 20
arch: 64
packages: 'clang-14'
cmake: 3.25.*
cmake: 3.29.*
os: ubuntu-22.04

runs-on: ${{ matrix.ci.os }}
Expand Down Expand Up @@ -544,7 +544,7 @@ jobs:
sudo -E apt-get update
sudo -E apt-get autopurge -y needrestart
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install make python3-pip g++
python3 -m pip install --disable-pip-version-check --user cmake==3.13.*
python3 -m pip install --disable-pip-version-check --user cmake==3.15.*
echo "$(python3 -m site --user-base)/bin" >> $GITHUB_PATH
- name: 'Check Out'
Expand Down
25 changes: 7 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
# See the COPYING file for more information.
##############################################################################

# Require CMake 3.13+ with support for meta-features that request compiler
# modes for specific C/C++ language standard levels, and object libraries.
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.15)

#-----------------------------------------------------------------------------
# Version
Expand All @@ -24,6 +22,7 @@ string(REGEX MATCH "GEOS_VERSION_MINOR=([0-9]+)" _ ${_version_txt})
set(_version_minor ${CMAKE_MATCH_1})
string(REGEX MATCH "GEOS_VERSION_PATCH=([0-9]+)" _ ${_version_txt})
set(_version_patch ${CMAKE_MATCH_1})
set(GEOS_VERSION_NOPATCH "${_version_major}.${_version_minor}.${_version_patch}")
# OPTIONS: "", "dev", "rc1" etc.
string(REGEX MATCH "GEOS_PATCH_WORD=([a-zA-Z0-9]+)" _ ${_version_txt})
set(_version_patch_word ${CMAKE_MATCH_1})
Expand Down Expand Up @@ -56,23 +55,19 @@ unset(_version_capi_revision)
#-----------------------------------------------------------------------------
# Project
#-----------------------------------------------------------------------------
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.9)
list(APPEND _project_info DESCRIPTION "GEOS - C++ port of the Java Topology Suite (JTS)")
endif()
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
list(APPEND _project_info HOMEPAGE_URL "https://libgeos.org/")
endif()

project(GEOS VERSION "${_version_major}.${_version_minor}.${_version_patch}"
project(GEOS
VERSION ${GEOS_VERSION_NOPATCH}
LANGUAGES C CXX
${_project_info})
DESCRIPTION "GEOS - C++ port of the Java Topology Suite (JTS)"
HOMEPAGE_URL "https://libgeos.org/"
)

if(NOT "${_version_patch_word}" STREQUAL "")
# Re-write VERSION variables after project()
set(GEOS_VERSION "${GEOS_VERSION}${_version_patch_word}")
set(GEOS_VERSION_PATCH "${_version_patch}${_version_patch_word}")
endif()
set(GEOS_VERSION_NOPATCH "${_version_major}.${_version_minor}.${_version_patch}")

unset(_version_major)
unset(_version_minor)
Expand All @@ -98,12 +93,6 @@ endif()
# Default to release build so packagers don't release debug builds
set(DEFAULT_BUILD_TYPE Release)

# Require CMake 3.13+ with VS generator for complete support of VS versions
# and support by AppVeyor.
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

# TODO: Follow CMake detection of git and version tagging
Expand Down

0 comments on commit d9422f5

Please sign in to comment.