2018-04-29 12:34:02 +00:00
|
|
|
cmake_minimum_required(VERSION 3.2)
|
2018-04-30 03:00:05 +00:00
|
|
|
include(CheckCXXCompilerFlag)
|
2018-03-26 12:02:43 +00:00
|
|
|
project(nameof)
|
|
|
|
|
2018-08-02 14:51:44 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
2018-03-26 12:02:43 +00:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2018-04-08 17:27:41 +00:00
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
2018-03-26 12:02:43 +00:00
|
|
|
|
2018-03-28 08:54:21 +00:00
|
|
|
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
2018-05-28 11:57:38 +00:00
|
|
|
add_compile_options(-Wall -Wextra -pedantic-errors)
|
2018-08-06 14:53:58 +00:00
|
|
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
2018-03-28 08:54:21 +00:00
|
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
2018-04-30 03:00:05 +00:00
|
|
|
add_compile_options(/W4)
|
|
|
|
check_cxx_compiler_flag(/permissive HAS_PERMISSIVE_FLAG)
|
|
|
|
if(HAS_PERMISSIVE_FLAG)
|
|
|
|
add_compile_options(/permissive-)
|
|
|
|
endif()
|
2018-03-28 08:54:21 +00:00
|
|
|
endif()
|
2018-03-27 09:03:12 +00:00
|
|
|
|
2018-03-26 12:02:43 +00:00
|
|
|
add_subdirectory(example)
|
2018-03-28 08:54:21 +00:00
|
|
|
|
|
|
|
enable_testing()
|
2018-04-14 19:52:48 +00:00
|
|
|
add_subdirectory(test)
|