diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-02-23 09:11:55 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-02-23 09:11:55 +0100 |
commit | 062cd07342edc2b003555e90dd2cee0514b9f64a (patch) | |
tree | 3c73893dae8a9380c9f24e9c5822c5ec6bf671d5 /vendor/bandit/CMakeLists.txt | |
parent | ffee481435ac0afe3f9a5a3eb07b2f2a46467089 (diff) |
Add BanditCpp 1.1.4 test harness
Diffstat (limited to 'vendor/bandit/CMakeLists.txt')
-rw-r--r-- | vendor/bandit/CMakeLists.txt | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/bandit/CMakeLists.txt b/vendor/bandit/CMakeLists.txt new file mode 100644 index 00000000..49ff0565 --- /dev/null +++ b/vendor/bandit/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 2.8) +project(bandit) + +set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +include(cotire) + +include_directories("${PROJECT_SOURCE_DIR}") + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ./bin) + +if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MP ") +else() + # Assume GCC-style arguments + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wfatal-errors -Wall -W -Werror -Wfloat-equal -Wundef -Wendif-labels") + + 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() +endif() + +# +# If we're on Mac OS we assume we have libc++, otherwise we assume +# we don't need it. (TODO: make this check more sofisticated) +# +if (CMAKE_HOST_APPLE AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +endif() + +FILE(GLOB BanditSpecSourceFiles specs/*.cpp specs/**/*.cpp) +add_executable(bandit-specs ${BanditSpecSourceFiles} ) +set_target_properties(bandit-specs PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "specs/specs.h") +set_target_properties(bandit-specs PROPERTIES COTIRE_ADD_UNIT_BUILD FALSE) +cotire(bandit-specs) + +add_custom_command(TARGET bandit-specs + POST_BUILD + COMMAND bandit-specs --no-color --reporter=dots + WORKING_DIRECTORY ./bin) |