nameof_module/example/CMakeLists.txt

23 lines
760 B
Text
Raw Normal View History

2019-03-21 11:05:37 +00:00
include(CheckCXXCompilerFlag)
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)
2019-03-21 11:05:37 +00:00
check_cxx_compiler_flag(/permissive HAS_PERMISSIVE_FLAG)
if(HAS_PERMISSIVE_FLAG)
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
2019-04-23 13:18:39 +00:00
${CMAKE_SOURCE_DIR}/include/${CMAKE_PROJECT_NAME}.hpp)
2019-03-12 13:55:56 +00:00
target_compile_options(example PRIVATE ${OPTIONS})
2019-04-23 13:18:39 +00:00
target_link_libraries(example PRIVATE ${CMAKE_PROJECT_NAME})