66#
77#-----------------------------------------------------------------------------
88
9- cmake_minimum_required (VERSION 3.10 FATAL_ERROR )
9+ cmake_minimum_required (VERSION 3.10 )
1010
1111project (osmcoastline VERSION 2.4.1 LANGUAGES CXX C )
1212
@@ -16,9 +16,22 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
1616
1717set (AUTHOR "Jochen Topf <jochen@topf.org>" )
1818
19- set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
19+ #-----------------------------------------------------------------------------
20+ #
21+ # Decide which C++ version to use (Minimum/default: C++14)
22+ #
23+ #-----------------------------------------------------------------------------
2024
21- option (WITH_LZ4 "Build with lz4 support for PBF files" ON )
25+ if (NOT USE_CPP_VERSION)
26+ set (USE_CPP_VERSION 14)
27+ endif ()
28+ message (STATUS "Use C++ version: ${USE_CPP_VERSION} " )
29+
30+ set (CMAKE_CXX_STANDARD ${USE_CPP_VERSION} )
31+ set (CMAKE_CXX_EXTENSIONS OFF )
32+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
33+
34+ set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
2235
2336
2437#-----------------------------------------------------------------------------
@@ -27,6 +40,8 @@ option(WITH_LZ4 "Build with lz4 support for PBF files" ON)
2740#
2841#-----------------------------------------------------------------------------
2942
43+ option (WITH_LZ4 "Build with lz4 support for PBF files" ON )
44+
3045include_directories (include )
3146
3247find_package (Osmium 2.16.0 COMPONENTS io gdal )
@@ -58,23 +73,6 @@ if(MSVC)
5873endif ()
5974
6075
61- #-----------------------------------------------------------------------------
62- #
63- # Decide which C++ version to use (Minimum/default: C++14).
64- #
65- #-----------------------------------------------------------------------------
66- if (NOT MSVC )
67- if (NOT USE_CPP_VERSION)
68- set (USE_CPP_VERSION c++14)
69- endif ()
70- message (STATUS "Use C++ version: ${USE_CPP_VERSION} " )
71- # following only available from cmake 2.8.12:
72- # add_compile_options(-std=${USE_CPP_VERSION})
73- # so using this instead:
74- add_definitions (-std=${USE_CPP_VERSION} )
75- endif ()
76-
77-
7876#-----------------------------------------------------------------------------
7977#
8078# Compiler and Linker flags
0 commit comments