-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
78 lines (68 loc) · 2.15 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
cmake_minimum_required(VERSION 3.2)
include("cmake/HunterGate.cmake")
huntergate(URL "https://github.com/cpp-pm/hunter/archive/v0.23.321.tar.gz" SHA1
"5e53cbb0429037ea8e2592bfd92704b8ff3ab492")
project(
QtParkingPOS
VERSION 0.2.0
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
if(APPLE AND EXISTS /usr/local/opt/qt6)
# Homebrew installs Qt6 (up to at least 5.9.1) in /usr/local/qt6, ensure it
# can be found by CMake since it is not in the default /usr/local prefix.
# source:
# https://github.com/Homebrew/homebrew-core/issues/8392#issuecomment-325226494
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt6")
set(CMAKE_MACOSX_RPATH 1)
elseif(APPLE AND EXISTS /opt/homebrew/opt/qt@5)
list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/qt@5")
set(CMAKE_MACOSX_RPATH 1)
endif()
find_package(Qt6 QUIET)
if(NOT Qt6_FOUND)
hunter_add_package(Qt6)
endif()
find_package(
Qt6
COMPONENTS Core Widgets Concurrent Sql
REQUIRED)
set(QT_LINK_LIBRARIES Qt6::Core Qt6::Widgets Qt6::Concurrent Qt6::Sql)
set(QT_PARKINGPOS_SRC
src/main.cpp
src/QDatabaseManager.cpp
includes/QDatabaseManager.h
src/QRegisterDialog.cpp
includes/QRegisterDialog.h
src/QAboutDialog.cpp
includes/QAboutDialog.h
src/QLoginDialog.cpp
includes/QLoginDialog.h
src/QParkingPOS.cpp
includes/QParkingPOS.h
src/QCheckInWindow.cpp
includes/QCheckInWindow.h
src/QCheckOutWindow.cpp
includes/QCheckOutWindow.h
src/QParkingSplashscreen.cpp
includes/QParkingSplashscreen.h
src/QAdministratorWindow.cpp
includes/QAdministratorWindow.h
src/QRegisterDialog.ui
src/QAboutDialog.ui
src/QLoginDialog.ui
src/QCheckInWindow.ui
src/QCheckOutWindow.ui
src/QParkingSplashscreen.ui
src/QAdministratorWindow.ui
resources/parking_pos.qrc
resources/images.qrc)
add_executable(qtparkingpos ${QT_PARKINGPOS_SRC})
target_include_directories(qtparkingpos PRIVATE includes/)
target_link_libraries(qtparkingpos ${QT_LINK_LIBRARIES})