nameof_module/CMakeLists.txt

23 lines
607 B
Text
Raw Normal View History

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)
set(CMAKE_CXX_STANDARD 11)
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-04-04 12:19:02 +00:00
add_compile_options(-Wall -Wextra -pedantic)
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)