onqtam | 4a65563 | 2016-05-26 14:20:52 +0300 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 2.8) |
| 2 | |
| 3 | project(all) |
| 4 | |
| 5 | include(scripts/common.cmake) |
| 6 | |
| 7 | # when on Travis CI force 64 bit for gcc 4.4 under OSX because -m32 fails |
| 8 | # saying that it cannot find 'std::exception' as a symbol (or others) for i386 |
| 9 | if(DEFINED ENV{TRAVIS} AND APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5) |
| 10 | add_compiler_flags(-m64) |
| 11 | endif() |
| 12 | |
onqtam | cc9e865 | 2016-08-02 14:23:38 +0300 | [diff] [blame] | 13 | include_directories("doctest/") # needed here so the coverage tools work - otherwise the "../../doctest" relative path fucks up |
| 14 | |
onqtam | 4a65563 | 2016-05-26 14:20:52 +0300 | [diff] [blame] | 15 | # setup coverage stuff only when COVERALLS_SERVICE_NAME is set (usually on travis CI) |
| 16 | if(DEFINED ENV{COVERALLS_SERVICE_NAME}) |
| 17 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/scripts/coveralls-cmake/cmake) |
| 18 | include(Coveralls) |
| 19 | coveralls_turn_on_coverage() |
| 20 | |
| 21 | coveralls_setup("${CMAKE_SOURCE_DIR}/doctest/doctest.h" ON "${CMAKE_SOURCE_DIR}/scripts/coveralls-cmake/cmake") |
onqtam | cc9e865 | 2016-08-02 14:23:38 +0300 | [diff] [blame] | 22 | |
onqtam | b478ca6 | 2016-08-16 07:22:15 +0300 | [diff] [blame^] | 23 | add_subdirectory(scripts/code_coverage_source) |
| 24 | |
onqtam | cc9e865 | 2016-08-02 14:23:38 +0300 | [diff] [blame] | 25 | return() |
onqtam | 4a65563 | 2016-05-26 14:20:52 +0300 | [diff] [blame] | 26 | endif() |
| 27 | |
onqtam | b478ca6 | 2016-08-16 07:22:15 +0300 | [diff] [blame^] | 28 | add_subdirectory(scripts/code_coverage_source) |
| 29 | |
onqtam | 4a65563 | 2016-05-26 14:20:52 +0300 | [diff] [blame] | 30 | file(GLOB subdir_list "${CMAKE_SOURCE_DIR}/examples/*") |
| 31 | foreach(dir ${subdir_list}) |
| 32 | if(IS_DIRECTORY ${dir}) |
| 33 | get_filename_component(DIRNAME ${dir} NAME) |
| 34 | add_subdirectory(examples/${DIRNAME}) |
| 35 | endif() |
| 36 | endforeach() |