forked from GENIVI/CANdevStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (36 loc) · 1.34 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.0.0)
project(CANdevStudio CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 14)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
option(WITH_COVERAGE "Build with coverage" OFF)
option(WITH_TESTS "Build with test" ON)
set(QT_REQUIRED_VERSION "5.6")
find_package(Qt5Core ${QT_REQUIRED_VERSION} REQUIRED)
find_package(Qt5SerialBus ${QT_REQUIRED_VERSION} REQUIRED)
find_package(Qt5Widgets ${QT_REQUIRED_VERSION} REQUIRED)
message(STATUS "Qt Version found: ${Qt5Core_VERSION}")
set_property(TARGET Qt5::SerialBus PROPERTY INTERFACE_COMPILE_FEATURES "")
set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES "")
if(NOT MSVC)
add_definitions(-Wall -Wextra)
endif()
include(CompilerVersion)
if(WITH_COVERAGE)
include(CodeCoverage)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_COVERAGE})
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_COVERAGE})
setup_target_for_coverage(NAME coverage EXECUTABLE ctest DEPENDENCIES candevice_test)
endif()
set(SPDLOG_BUILD_TESTING CACHE FORCE OFF)
add_subdirectory(3rdParty/spdlog)
add_subdirectory(src/common)
add_subdirectory(src/gui)
add_subdirectory(src/components)
if(WITH_TESTS OR WITH_COVERAGE)
enable_testing()
add_subdirectory(3rdParty/fakeit)
add_subdirectory(tests)
endif()