-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
124 lines (107 loc) · 3.75 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
cmake_minimum_required(VERSION 3.16)
project(sdl2-gamepad-mapper VERSION 0.0.9 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 6.4 REQUIRED COMPONENTS Quick QuickControls2 Network Gui)
#find_package(Qt6 6.4 REQUIRED COMPONENTS Quick QuickControls2 Network Gui LinguistTools)
qt_standard_project_setup()
if (WIN32)
set(QT_PATH ${CMAKE_PREFIX_PATH}/../..)
endif()
if (!WIN32)
find_package(SDL2 REQUIRED)
endif()
qt_add_executable(sdl2-gamepad-mapper
main.cpp
)
qt_add_resources(sdl2-gamepad-mapper "qml"
PREFIX "/"
FILES
main.qml
)
qt_add_resources(sdl2-gamepad-mapper "resources"
PREFIX "/"
FILES
images/axis.png
images/button.png
images/controllermap.png
images/down-arrow-small.png
images/left-arrow-small.png
images/right-arrow-small.png
images/up-arrow-small.png
)
qt_add_qml_module(sdl2-gamepad-mapper
URI sdl2mappercomponents
VERSION 1.0
SOURCES
sdl2mappercomponents/applogger.cpp
sdl2mappercomponents/applogger.h
sdl2mappercomponents/apploggersingleton.cpp
sdl2mappercomponents/apploggersingleton.h
sdl2mappercomponents/displaymappedjoystickbackend.cpp
sdl2mappercomponents/displaymappedjoystickbackend.h
sdl2mappercomponents/joystickcontainer.cpp
sdl2mappercomponents/joystickcontainer.h
sdl2mappercomponents/joystickcontainermodel.cpp
sdl2mappercomponents/joystickcontainermodel.h
sdl2mappercomponents/joysticksdl.cpp
sdl2mappercomponents/joysticksdl.h
sdl2mappercomponents/mainviewbackend.cpp
sdl2mappercomponents/mainviewbackend.h
sdl2mappercomponents/mappinggcviewbackend.cpp
sdl2mappercomponents/mappinggcviewbackend.h
sdl2mappercomponents/sdl2mapperbackend.cpp
sdl2mappercomponents/sdl2mapperbackend.h
sdl2mappercomponents/sdlinputreader.cpp
sdl2mappercomponents/sdlinputreader.h
QML_FILES
sdl2mappercomponents/DisplayMappedJoystickItem.qml
sdl2mappercomponents/MappingGCItem.qml
)
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
# explicit, fixed bundle identifier manually though.
set_target_properties(sdl2-gamepad-mapper PROPERTIES
# MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appsdl2-gamepad-mapper-cmake
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
target_link_libraries(sdl2-gamepad-mapper
PRIVATE Qt6::Quick
PRIVATE Qt6::QuickControls2
PRIVATE Qt6::Network
PRIVATE Qt6::Gui
)
include_directories(${CMAKE_SOURCE_DIR}/sdl2mappercomponents)
if (WIN32)
#message("IN WIN32")
target_link_libraries(sdl2-gamepad-mapper
PUBLIC -L${CMAKE_SOURCE_DIR}/SDL2/lib/
PUBLIC -llibSDL2
PUBLIC -L${QT_PATH}/Tools/OpenSSL/Win_x64/lib
PUBLIC -llibssl
PUBLIC -llibcrypto
)
include_directories(${CMAKE_SOURCE_DIR}/SDL2/include/)
target_include_directories(sdl2-gamepad-mapper
PUBLIC "${QT_PATH}/Tools/OpenSSL/Win_x64/include"
)
else()
target_link_libraries(sdl2-gamepad-mapper
PUBLIC SDL2
)
endif()
#qt_add_lupdate(sdl2-gamepad-mapper
# TS_FILES sdl2-gamepad-mapper_en_US.ts
#)
#qt_add_lrelease(sdl2-gamepad-mapper
# TS_FILES
# sdl2-gamepad-mapper_en_US.ts
#)
include(GNUInstallDirs)
install(TARGETS sdl2-gamepad-mapper
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)