Skip to content
Snippets Groups Projects
Commit d54225b8 authored by Automated MSK Jenkins User's avatar Automated MSK Jenkins User
Browse files

Merge remote-tracking branch 'project-template/master'

parents 7fca0a2b d55cfe6a
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@
######################################################################################################################
if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "None")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "None")
......
#######################################################################################################################
# enable_cxx11_support.cmake
# set_default_flags.cmake
#
# NOTE: Do not use this routine! Use enable_latest_css_support.cmake instead, even if you only need C++11, as the
# compiler always uses the strictest ("oldest") specified standard if mulitple flags are given. This will create
# problems when combining multiple projects (libraries...) requiring different C++ standards.
# Set default compiler flags for C++, including the flags for thelatest C++ standard (see
# enable_latest_cxx_support.cmake)
#
# Enable C++-11 support by selecting the appropriate compiler flag. The flag will be appended to all of the following
# cmake variables:
# - CMAKE_CXX_FLAGS
# - ${PROJECT_NAME}_CXX_FLAGS
# - ${PROJECT_NAME}_CMAKE_CXX_FLAGS
# It will also append ${PROJECT_NAME}_CXX_FLAGS to the CMAKE_CXX_FLAGS, so it is a good idea to set any project
# specific flags before calling this macro.
#
#######################################################################################################################
......@@ -25,17 +21,8 @@
#
#######################################################################################################################
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(${PROJECT_NAME}_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS} -std=c++11")
set(${PROJECT_NAME}_CMAKE_CXX_FLAGS "${${PROJECT_NAME}_CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
set(${PROJECT_NAME}_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS} -std=c++0x")
set(${PROJECT_NAME}_CMAKE_CXX_FLAGS "${${PROJECT_NAME}_CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
include(cmake/enable_latest_cxx_support.cmake)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${PROJECT_NAME}_CXX_FLAGS} -Wall -Wextra -Wshadow -pedantic -Wuninitialized")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 --coverage")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -g")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment