diff options
| -rw-r--r-- | CMakeLists.txt | 5 | ||||
| -rw-r--r-- | CMakeScripts/ConfigEnv.cmake | 13 | ||||
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 9 |
3 files changed, 10 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dcb68102..3050cdec1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-or-later -cmake_minimum_required(VERSION 2.8.8) +cmake_minimum_required(VERSION 3.1.0) cmake_policy(SET CMP0003 NEW) # don't be prolific with library paths cmake_policy(SET CMP0005 NEW) # proper define quoting @@ -18,9 +18,10 @@ message("Binary Dir: ${CMAKE_CURRENT_BINARY_DIR}") # ----------------------------------------------------------------------------- # CMake Configuration # ----------------------------------------------------------------------------- -# Used in cmake 3.1+ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# set(CMAKE_CXX_EXTENSIONS OFF) # enforces -std=c++11 instead of -std=gnu++11 + # TODO: build currently fails with it as we actually depend on GNU compiler extensions... list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeScripts/Modules") diff --git a/CMakeScripts/ConfigEnv.cmake b/CMakeScripts/ConfigEnv.cmake index 29f2f5df8..b8809428c 100644 --- a/CMakeScripts/ConfigEnv.cmake +++ b/CMakeScripts/ConfigEnv.cmake @@ -5,20 +5,19 @@ if(WIN32) message("-- Windows build detected, setting default features")
include(CMakeScripts/ConfigEnvMinGW.cmake)
-
+
set(CMAKE_C_COMPILER "${MINGW_BIN}/gcc.exe")
set(CMAKE_CXX_COMPILER "${MINGW_BIN}/g++.exe")
- set(CMAKE_CXX_STANDARD 11)
-
+
# Setup Windows resource files compiler.
set(CMAKE_RC_COMPILER "${MINGW_BIN}/windres.exe")
set(CMAKE_RC_COMPILER_INIT windres)
enable_language(RC)
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -i <SOURCE> -o <OBJECT>")
-
+
# These options are required for having i18n support on Windows.
option(ENABLE_NLS "Compile with Native Language Support (using gettext)" ON)
-
+
# Does not compile on Windows with these options.
option(ENABLE_BINRELOC "Use AutoPackage" OFF)
option(WITH_JEMALLOC "Compile with JEMALLOC support" OFF)
@@ -26,7 +25,7 @@ endif() if(APPLE)
message("-- Mac OS X build detected, setting default features")
-
+
# prefer macports and/or user-installed libraries over system ones
#LIST(APPEND CMAKE_PREFIX_PATH /opt/local /usr/local)
set(CMAKE_FIND_FRAMEWORK "LAST")
@@ -35,7 +34,7 @@ if(APPLE) if(DEFINED ENV{CMAKE_PREFIX_PATH})
message("CMAKE_PREFIX_PATH: $ENV{CMAKE_PREFIX_PATH}")
endif()
-
+
if(DEFINED ENV{GTKMM_BASEPATH})
message("GTKMM_BASEPATH: $ENV{GTKMM_BASEPATH}")
endif()
diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 09362da7d..8099f0997 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -10,14 +10,6 @@ list(APPEND INKSCAPE_INCS ${PROJECT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/include ) -# ---------------------------------------------------------------------------- -# Add C++11 standard compliance -# TODO: Add a proper check for compiler compliance here -# ---------------------------------------------------------------------------- -# this can be removed when cmake minimum is 3.1 -# as replaced with CMAKE_CXX_STANDARD in main CMakeLists.txt -list(APPEND INKSCAPE_CXX_FLAGS "-std=c++11") - # Errors for common mistakes list(APPEND INKSCAPE_CXX_FLAGS "-Werror=format") # e.g.: printf("%s", std::string("foo")) list(APPEND INKSCAPE_CXX_FLAGS "-Werror=format-security") # e.g.: printf(variable); @@ -29,6 +21,7 @@ if (CMAKE_COMPILER_IS_GNUCC) list(APPEND INKSCAPE_CXX_FLAGS_DEBUG "-fstack-clash-protection -fcf-protection") endif() endif() + # Define the flags for profiling if desired: if(WITH_PROFILING) set(BUILD_SHARED_LIBS off) |
