nameof_module/CMakeLists.txt
2018-08-06 19:38:14 +05:00

23 lines
654 B
CMake

cmake_minimum_required(VERSION 3.2)
include(CheckCXXCompilerFlag)
project(nameof)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
add_compile_options(-stdlib=libc++)
add_compile_options(-Wall -Wextra -pedantic-errors)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_compile_options(/W4)
check_cxx_compiler_flag(/permissive HAS_PERMISSIVE_FLAG)
if(HAS_PERMISSIVE_FLAG)
add_compile_options(/permissive-)
endif()
endif()
add_subdirectory(example)
enable_testing()
add_subdirectory(test)