Use CMAKE_CXX_STANDARD instead of setting compiler flags
authorMartin Lambers <marlam@marlam.de>
Wed, 17 Apr 2019 11:00:03 +0000 (13:00 +0200)
committerMartin Lambers <marlam@marlam.de>
Wed, 17 Apr 2019 11:00:03 +0000 (13:00 +0200)
camsim-cornellbox/CMakeLists.txt
camsim-flow/CMakeLists.txt
camsim-helloworld/CMakeLists.txt
camsim-pmd-longbox/CMakeLists.txt
camsim-shadowmaps/CMakeLists.txt
camsim-sponza/CMakeLists.txt
libcamsim/CMakeLists.txt

index 0583817..ad9951e 100644 (file)
@@ -13,8 +13,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 project(camsim-cornellbox)
 
+set(CMAKE_CXX_STANDARD 11)
 if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -Wextra")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
 endif()
 
 find_package(Qt5 5.6.0 COMPONENTS Gui)
index 5069cb0..f64405b 100644 (file)
@@ -13,8 +13,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 project(camsim-flow)
 
+set(CMAKE_CXX_STANDARD 11)
 if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -Wextra")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
 endif()
 
 find_package(Qt5 5.6.0 COMPONENTS Gui)
index 64f9355..237b7f0 100644 (file)
@@ -13,8 +13,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 project(camsim-helloworld)
 
+set(CMAKE_CXX_STANDARD 11)
 if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -Wextra")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
 endif()
 
 find_package(Qt5 5.6.0 COMPONENTS Gui)
index 56e0238..abad968 100644 (file)
@@ -13,8 +13,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 project(camsim-pmd-longbox)
 
+set(CMAKE_CXX_STANDARD 11)
 if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -Wextra")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
 endif()
 
 find_package(Qt5 5.6.0 COMPONENTS Gui)
index 5f06d10..2718d61 100644 (file)
@@ -13,8 +13,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 project(camsim-shadowmaps)
 
+set(CMAKE_CXX_STANDARD 11)
 if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -Wextra")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
 endif()
 
 find_package(Qt5 5.6.0 COMPONENTS Gui)
index f649a0f..6c9aa5a 100644 (file)
@@ -13,8 +13,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 project(camsim-sponza)
 
+set(CMAKE_CXX_STANDARD 11)
 if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -Wextra")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
 endif()
 
 find_package(Qt5 5.6.0 COMPONENTS Gui)
index 45abfd1..b753024 100644 (file)
@@ -21,8 +21,9 @@ set(CAMSIM_SOVERSION 0)
 option(CAMSIM_BUILD_DOCUMENTATION "Build API reference documentation (requires Doxygen)" OFF)
 
 # Compiler and system
+set(CMAKE_CXX_STANDARD 14)
 if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 -Wall -Wextra")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
 endif()
 
 # Required libraries