-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (25 loc) · 923 Bytes
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(cppcapture VERSION 0.8)
# options
option(BUILD_TESTING "Build unit tests and examples" OFF)
option(CPPCAPTURE_WITH_QT "Enable better integration with Qt (adds a dependency to QtCore)" OFF)
option(CPPCAPTURE_NODEBUG "Disable debug messages even in debug builds" OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) # force C++11
set(CMAKE_CXX_EXTENSIONS OFF)
# detect Qt if required
if (CPPCAPTURE_WITH_QT)
find_package(Qt5 COMPONENTS Core REQUIRED)
endif()
if (BUILD_TESTING)
enable_testing()
endif()
# adjust default compiler options
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /permissive-")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wunused -Werror")
endif()
add_subdirectory(third_party)
add_subdirectory(src)
add_subdirectory(examples)