-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (32 loc) · 1.11 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
cmake_minimum_required(VERSION 3.10)
project(qcolorpicker)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 20)
option(QCOLORPICKER_BUILD_TESTING "Option to enable/disable building the tests"
${BUILD_TESTING})
option(QCOLORPICKER_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)
add_subdirectory(include)
link_libraries(Qt::Widgets qcolorpicker::interface)
if(QCOLORPICKER_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()