-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
47 lines (36 loc) · 1.18 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.10)
project(qnodeeditor)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 20)
option(QNODEEDITOR_BUILD_TESTING "Option to enable/disable building the tests"
${BUILD_TESTING})
option(QNODEEDITOR_REPORT_COVERAGE "Option to enable/disable coverage report"
${BUILD_COVERAGE})
# set QT version to 6 if not set already
if("${QT_VERSION}" STREQUAL "")
message(
"Parent scope didn't tell the QT version to use. Defaulting it to Qt6")
set(QT_VERSION 6)
else()
message("Qt version set by the parent scope is Qt${QT_VERSION}")
endif()
find_package(Qt${QT_VERSION} REQUIRED COMPONENTS Core Gui Widgets)
find_package(spdlog)
add_subdirectory(include)
link_libraries(Qt::Widgets qnodeeditor::interface)
if(spdlog_FOUND)
link_libraries(spdlog::spdlog)
endif()
if(QNODEEDITOR_REPORT_COVERAGE)
message("Building with coverage report")
add_compile_options(-fprofile-instr-generate -fcoverage-mapping --coverage)
add_link_options(-fprofile-instr-generate -fcoverage-mapping --coverage)
endif()
add_subdirectory(src)
add_subdirectory(sample)
if(BUILD_TESTING)
enable_testing(true)
add_subdirectory(test)
endif()