Skip to content
Snippets Groups Projects

Add CMake configuration files for the exercises, master branch (2020.10.09.)

22 files
+ 570
20
Compare changes
  • Side-by-side
  • Inline
Files
22
+ 27
0
# Set up the project.
cmake_minimum_required( VERSION 3.1 )
project( callgrind LANGUAGES CXX )
# Set up a Debug build type by default.
if( NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
set( CMAKE_BUILD_TYPE "Debug" CACHE
STRING "Choose the type of build." FORCE )
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
endif()
# Use C++17 in the project, or as high of a value as possible.
set( CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to use" )
set( CMAKE_CXX_EXTENSIONS FALSE CACHE BOOL "(Dis)Allow C++ extensions" )
# Enable warnings for the build.
if( ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" ) OR
( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" ) )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra" )
elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4" )
endif()
# Create the executable.
add_executable( test test.cpp )
Loading