-
Notifications
You must be signed in to change notification settings - Fork 257
/
CMakeLists.txt
48 lines (41 loc) · 1.37 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
48
cmake_minimum_required(VERSION 3.3)
project(QSimpleUpdater
LANGUAGES CXX
)
option(QSIMPLE_UPDATER_BUILD_TESTS "Build the unit tests" ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Network)
find_package(Qt${QT_VERSION_MAJOR} CONFIG REQUIRED COMPONENTS Widgets Network)
if(QSIMPLE_UPDATER_BUILD_TESTS)
find_package(Qt${QT_VERSION_MAJOR} CONFIG REQUIRED COMPONENTS Test)
endif()
add_library(QSimpleUpdater STATIC
etc/resources/qsimpleupdater.qrc
include/QSimpleUpdater.h
src/AuthenticateDialog.cpp
src/AuthenticateDialog.h
src/AuthenticateDialog.ui
src/Downloader.cpp
src/Downloader.h
src/Downloader.ui
src/QSimpleUpdater.cpp
src/Updater.cpp
src/Updater.h
)
target_include_directories(QSimpleUpdater PUBLIC include)
target_link_libraries(QSimpleUpdater PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets PRIVATE Qt${QT_VERSION_MAJOR}::Network)
add_subdirectory(tutorial)
if(QSIMPLE_UPDATER_BUILD_TESTS)
enable_testing()
add_executable(UnitTests
tests/main.cpp
tests/Test_Versioning.h
tests/Test_Updater.h
tests/Test_QSimpleUpdater.h
tests/Test_Downloader.h
)
add_test(NAME ApiTest COMMAND ApiTest)
target_link_libraries(UnitTests PRIVATE Qt${QT_VERSION_MAJOR}::Test QSimpleUpdater)
endif()