generated from kitswas/CPP-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
79 lines (65 loc) · 2.14 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
79
cmake_minimum_required(VERSION 3.16)
project("Virtual Gamepad PC" VERSION 0.2 LANGUAGES CXX C)
if (NOT WIN32)
message(FATAL_ERROR "This project is only supported on Windows")
endif()
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Network)
add_subdirectory(VGP_Data_Exchange/C)
set(QR_CODE_GEN_SOURCES
third-party-libs/QR-Code-generator/cpp/qrcodegen.cpp
third-party-libs/QR-Code-generator/cpp/qrcodegen.hpp
)
add_library(QR_Code_Generator SHARED ${QR_CODE_GEN_SOURCES})
# Add project files sorted in alphabetical order
set(PROJECT_SOURCES
res/icons.qrc
src/main.cpp
src/networking/executor.cpp
src/networking/executor.hpp
src/networking/server.cpp
src/networking/server.hpp
src/networking/server.ui
src/settings.cpp
src/settings.hpp
src/settings_key_variables.cpp
src/settings_key_variables.hpp
src/simulation/keyboardSim.cpp
src/simulation/keyboardSim.hpp
src/simulation/mouseSim.cpp
src/simulation/mouseSim.hpp
src/simulation/simulate.cpp
src/simulation/simulate.hpp
src/ui/mainmenu.cpp
src/ui/mainmenu.hpp
src/ui/mainmenu.ui
src/ui/mainwindow.cpp
src/ui/mainwindow.hpp
src/ui/mainwindow.ui
src/ui/preferences.cpp
src/ui/preferences.hpp
src/ui/preferences.ui
)
qt_add_executable(VGamepadPC
${PROJECT_SOURCES}
)
target_link_libraries(VGamepadPC PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network Data_Exchange QR_Code_Generator)
set_target_properties(VGamepadPC PROPERTIES
WIN32_EXECUTABLE TRUE
)
install(TARGETS VGamepadPC
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# On Windows, we need to copy the DLLs to the output directory using windeployqt
# This is done by adding a custom command as a post-build step
# The CMake Cache variable WINDEPLOYQT_EXECUTABLE should contain the path to windeployqt
add_custom_command(
TARGET VGamepadPC POST_BUILD
COMMAND ${WINDEPLOYQT_EXECUTABLE} $<TARGET_FILE:VGamepadPC>
)