summaryrefslogtreecommitdiffstats
path: root/smtk-import
diff options
context:
space:
mode:
authorGravatar Rolf Eike Beer <eike@sf-mail.de>2019-03-10 10:59:23 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-03-19 12:41:32 -0700
commitd0acee4083f88926ed76c287e9836b14a82e163a (patch)
treefee43acd5436264f062051a3900d9096426d1f1e /smtk-import
parent8e43d2b8d2023f06e79b1a5b5bfc28bd79294925 (diff)
downloadsubsurface-d0acee4083f88926ed76c287e9836b14a82e163a.tar.gz
CMake: let CMake set the needed flags for C and C++ standards
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
Diffstat (limited to 'smtk-import')
-rw-r--r--smtk-import/CMakeLists.txt10
1 files changed, 7 insertions, 3 deletions
diff --git a/smtk-import/CMakeLists.txt b/smtk-import/CMakeLists.txt
index 500a3f6a2..ff74ea273 100644
--- a/smtk-import/CMakeLists.txt
+++ b/smtk-import/CMakeLists.txt
@@ -1,7 +1,7 @@
# Modified from Subsurface's CMakeLists.txt
project(smtk2ssrf)
-cmake_minimum_required(VERSION 2.8.11)
+cmake_minimum_required(VERSION 3.1)
option(COMMANDLINE "Build command line version" OFF)
@@ -9,6 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH FALSE)
set(SSRF_PATH ../)
set(CMAKE_MODULE_PATH ${SSRF_PATH}cmake/Modules)
include(${CMAKE_MODULE_PATH}/MacroOutOfSourceBuild.cmake)
@@ -82,8 +83,11 @@ else()
endif()
# Set compiler flags and definitions
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC")
+set(CMAKE_C_STANDARD 99)
+set(CMAKE_C_STANDARD_REQUIRED TRUE)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(SMTK_LINK_LIBRARIES ${SMTK_LINK_LIBRARIES} -lssh2 -lz -lpthread)