-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
53 lines (43 loc) · 1.46 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
49
50
51
52
53
cmake_minimum_required(VERSION 3.16)
project(SyncThingy)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
# BS workaround for stupid Glib using "signals" for which QT uses as well
add_definitions(-DQT_NO_KEYWORDS)
find_package(PkgConfig REQUIRED)
#pkg_check_modules(PORTAL REQUIRED IMPORTED_TARGET libportal)
pkg_check_modules(PORTAL-QT REQUIRED IMPORTED_TARGET libportal-qt5)
find_package(Qt5 COMPONENTS
Core
Gui
Widgets
DBus
REQUIRED)
add_executable(${PROJECT_NAME}
src/main.cpp
src/Constants.h
src/SettingsDialog.cpp src/SettingsDialog.h
src/ServiceDialog.cpp src/ServiceDialog.h)
add_subdirectory(src/singleapplication)
target_link_libraries(${PROJECT_NAME}
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::DBus
PkgConfig::PORTAL-QT
SingleApplication::SingleApplication)
if (STATIC)
#Static start
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(Qt5_USE_STATIC_LIBS ON)
set(Qt5_USE_STATIC_RUNTIME ON)
#Static Libs
#Set Linker flags
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
endif()
install(TARGETS ${PROJECT_NAME} DESTINATION bin)