blob: a26ef84e5a0c2caae0b8d6b93b55cf06a46f6b9b [file] [log] [blame]
hardlyb1e7e142014-08-06 00:43:51 +03001cmake_minimum_required(VERSION 2.8)
2
3project(all)
4
onqtam222ecad2016-03-15 11:54:37 +02005include(scripts/common.cmake)
hardlyb1e7e142014-08-06 00:43:51 +03006
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
9if(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)
11endif()
12
13# setup coverage stuff only when COVERALLS_SERVICE_NAME is set (usually on travis CI)
14if(DEFINED ENV{COVERALLS_SERVICE_NAME})
15 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/scripts/coveralls-cmake/cmake)
16 include(Coveralls)
17 coveralls_turn_on_coverage()
18
19 coveralls_setup("${CMAKE_SOURCE_DIR}/doctest/doctest.h" ON "${CMAKE_SOURCE_DIR}/scripts/coveralls-cmake/cmake")
20endif()
21
hardlyb1e7e142014-08-06 00:43:51 +030022include_directories("doctest/") # needed here so the coverage tools work - otherwise the "../../doctest" relative path fucks up
23
24file(GLOB subdir_list "${CMAKE_SOURCE_DIR}/examples/*")
25foreach(dir ${subdir_list})
26 if(IS_DIRECTORY ${dir})
27 get_filename_component(DIRNAME ${dir} NAME)
28 add_subdirectory(examples/${DIRNAME})
29 endif()
30endforeach()