Skip to content

Commit 7463401

Browse files
committed
Modernize CMake config
1 parent dabb825 commit 7463401

2 files changed

Lines changed: 11 additions & 45 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,21 @@ jobs:
2222
- "fedora:43"
2323
build_type: [Dev]
2424
cpp_compiler: [g++]
25-
cpp_version: [c++17]
2625
include:
2726
- image: "ubuntu:22.04"
2827
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
2928
- image: "ubuntu:24.04"
3029
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
31-
- image: "debian:bookworm"
32-
cpp_version: c++20
3330
- image: "debian:bookworm"
3431
c_compiler: clang
3532
cpp_compiler: clang++
36-
- image: "debian:bookworm"
37-
c_compiler: clang
38-
cpp_compiler: clang++
39-
cpp_version: c++20
4033
- image: "debian:bookworm"
4134
build_type: RelWithDebInfo
4235
- image: "debian:trixie"
4336
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
44-
- image: "debian:trixie"
45-
cpp_version: c++20
46-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
47-
- image: "debian:trixie"
48-
c_compiler: clang
49-
cpp_compiler: clang++
5037
- image: "debian:trixie"
5138
c_compiler: clang
5239
cpp_compiler: clang++
53-
cpp_version: c++20
5440
- image: "debian:trixie"
5541
build_type: RelWithDebInfo
5642
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
@@ -81,7 +67,6 @@ jobs:
8167
CXX: ${{ matrix.cpp_compiler }}
8268
CXXFLAGS: ${{ matrix.CXXFLAGS }}
8369
LDFLAGS: ${{ matrix.LDFLAGS }}
84-
CPP_VERSION: ${{ matrix.cpp_version }}
8570
APT_LISTCHANGES_FRONTEND: none
8671
DEBIAN_FRONTEND: noninteractive
8772
steps:

CMakeLists.txt

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@
66
#
77
#-----------------------------------------------------------------------------
88

9-
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
9+
cmake_minimum_required(VERSION 3.10)
10+
1011
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
1112

13+
#-----------------------------------------------------------------------------
14+
15+
set(CMAKE_CXX_STANDARD 17)
16+
set(CMAKE_CXX_EXTENSIONS OFF)
17+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
18+
19+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
20+
1221

1322
#-----------------------------------------------------------------------------
1423
#
@@ -22,18 +31,7 @@ set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRel;Dev"
2231
"List of available configuration types"
2332
FORCE)
2433

25-
project(osm-gis-export)
26-
27-
set(OSM_GIS_EXPORT_VERSION_MAJOR 0)
28-
set(OSM_GIS_EXPORT_VERSION_MINOR 0)
29-
set(OSM_GIS_EXPORT_VERSION_PATCH 1)
30-
31-
set(OSM_GIS_EXPORT_VERSION
32-
${OSM_GIS_EXPORT_VERSION_MAJOR}.${OSM_GIS_EXPORT_VERSION_MINOR}.${OSM_GIS_EXPORT_VERSION_PATCH})
33-
34-
set(AUTHOR "Jochen Topf <jochen@topf.org>")
35-
36-
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
34+
project(osm-gis-export VERSION 0.0.1 LANGUAGES CXX C)
3735

3836

3937
#-----------------------------------------------------------------------------
@@ -121,23 +119,6 @@ else()
121119
endif()
122120

123121

124-
#-----------------------------------------------------------------------------
125-
#
126-
# Decide which C++ version to use (Minimum/default: C++17).
127-
#
128-
#-----------------------------------------------------------------------------
129-
if(NOT MSVC)
130-
if(NOT USE_CPP_VERSION)
131-
set(USE_CPP_VERSION c++17)
132-
endif()
133-
message(STATUS "Use C++ version: ${USE_CPP_VERSION}")
134-
# following only available from cmake 2.8.12:
135-
# add_compile_options(-std=${USE_CPP_VERSION})
136-
# so using this instead:
137-
add_definitions(-std=${USE_CPP_VERSION})
138-
endif()
139-
140-
141122
#-----------------------------------------------------------------------------
142123
#
143124
# Compiler and Linker flags

0 commit comments

Comments
 (0)