nameof_module/example/CMakeLists.txt

21 lines
672 B
Text
Raw Normal View History

2019-03-12 13:55:56 +00:00
include_directories(${CMAKE_SOURCE_DIR}/include)
2018-03-17 04:31:59 +00:00
2019-03-12 13:55:56 +00:00
set(OPTIONS "")
2018-08-29 11:57:44 +00:00
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
set(CMAKE_VERBOSE_MAKEFILE ON)
2019-03-12 13:55:56 +00:00
set(OPTIONS -Wall -Wextra -pedantic-errors)
2019-03-20 16:41:51 +00:00
set(OPTIONS ${OPTIONS} -std=c++17)
2018-08-29 11:57:44 +00:00
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
2019-03-12 13:55:56 +00:00
set(OPTIONS /W4)
2018-08-29 11:57:44 +00:00
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.11)
2019-03-12 13:55:56 +00:00
set(OPTIONS ${OPTIONS} /permissive-)
2018-08-29 11:57:44 +00:00
endif()
2019-03-20 16:41:51 +00:00
set(OPTIONS ${OPTIONS} /std:c++17)
2018-08-29 11:57:44 +00:00
endif()
2019-03-12 13:55:56 +00:00
add_executable(example
example.cpp
${CMAKE_SOURCE_DIR}/include/nameof.hpp)
target_compile_options(example PRIVATE ${OPTIONS})