diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-08-01 16:35:25 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-09-14 05:58:27 +0200 |
commit | 7b9f4e4e8169ca2fad3a1c7ca03f07ecfc46678e (patch) | |
tree | 0cef1ac0dc228b621afc90bc94e4e0dddcb90c82 /vendor/bandit/bandit/assertion_frameworks/snowhouse/CMakeLists.txt | |
parent | c6196b25d119a10e79deedef26a73e0d5a021b0e (diff) |
Bandit 2.0.0
Diffstat (limited to 'vendor/bandit/bandit/assertion_frameworks/snowhouse/CMakeLists.txt')
-rw-r--r-- | vendor/bandit/bandit/assertion_frameworks/snowhouse/CMakeLists.txt | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/CMakeLists.txt b/vendor/bandit/bandit/assertion_frameworks/snowhouse/CMakeLists.txt index edfabc0d..ea43226b 100644 --- a/vendor/bandit/bandit/assertion_frameworks/snowhouse/CMakeLists.txt +++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/CMakeLists.txt @@ -2,16 +2,48 @@ cmake_minimum_required(VERSION 2.8) project(snowhouse) +option(SNOWHOUSE_BUILD_TESTS "Build the Snowhouse tests" ON) +option(SNOWHOUSE_RUN_TESTS "Run the Snowhouse tests" ON) +option(SNOWHOUSE_IS_CPP11 "Whether to build this as a C++11 project" OFF) + include_directories("${PROJECT_SOURCE_DIR}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ./bin) set(CMAKE_CXX_FLAGS "-Wfatal-errors -Wall -W -Werror -Wfloat-equal -Wundef -Wendif-labels -Wshadow -pedantic-errors") -FILE(GLOB SnowhouseSpecSourceFiles example/*.cpp) -add_executable(snowhouse-tests ${SnowhouseSpecSourceFiles}) +if(SNOWHOUSE_IS_CPP11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdeprecated") + + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() + endif() + + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() + + if (CMAKE_HOST_APPLE AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + endif() +endif() + +message(${CMAKE_CXX_FLAGS}) + +if (SNOWHOUSE_BUILD_TESTS) + FILE(GLOB SnowhouseSpecSourceFiles example/*.cpp) + add_executable(snowhouse-tests ${SnowhouseSpecSourceFiles}) +endif() -add_custom_command(TARGET snowhouse-tests - POST_BUILD - COMMAND snowhouse-tests - WORKING_DIRECTORY ./bin) +if (SNOWHOUSE_BUILD_TESTS AND SNOWHOUSE_RUN_TESTS) + add_custom_command(TARGET snowhouse-tests + POST_BUILD + COMMAND snowhouse-tests + WORKING_DIRECTORY ./bin) +elseif (SNOWHOUSE_RUN_TESTS) + message(WARNING "Unable to run snowhouse tests - set:\n option(SNOWHOUSE_BUILD_TESTS, \"Build the Snowhouse tests\" ON)\nand clear your CMakeCache.txt") +endif() |