aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: d96e44a089696770adb7a04c008eb1d48aee87d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required(VERSION 3.1)
project(effcee C CXX)
enable_testing()

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

option(EFFCEE_BUILD_TESTING "Enable testing for Effcee" ON)
if(${EFFCEE_BUILD_TESTING})
  message(STATUS "Configuring Effcee to build tests.")
  if(MSVC)
    # Our tests use ::testing::Combine.  Force the ability to use it, working
    # around googletest's possibly faulty compiler detection logic.
    # See https://github.com/google/googletest/issues/1352
    add_definitions(-DGTEST_HAS_COMBINE=1)
  endif(MSVC)
else()
  message(STATUS "Configuring Effcee to avoid building tests.")
endif()

option(EFFCEE_BUILD_SAMPLES "Enable building sample Effcee programs" ON)
if(${EFFCEE_BUILD_SAMPLES})
  message(STATUS "Configuring Effcee to build samples.")
else()
  message(STATUS "Configuring Effcee to avoid building samples.")
endif()

# RE2 needs Pthreads on non-WIN32
set(CMAKE_THREAD_LIBS_INIT "")
find_package(Threads)

include(cmake/setup_build.cmake)
include(cmake/utils.cmake)
include(GNUInstallDirs)

add_subdirectory(third_party)
add_subdirectory(effcee)
add_subdirectory(fuzzer)

if(${EFFCEE_BUILD_SAMPLES})
  add_subdirectory(examples)
endif()