-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
79 lines (67 loc) · 1.62 KB
/
Copy pathCMakeLists.txt
File metadata and controls
79 lines (67 loc) · 1.62 KB
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.20)
project(WiimoteBridge)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Include directories
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/dolphin_src)
# Source files for the main application
set(SOURCES
src/main.cpp
src/system_tray.cpp
src/wiimote_manager.cpp
src/registry_utils.cpp
)
set(HEADERS
include/system_tray.h
include/wiimote_manager.h
include/registry_utils.h
include/resource.h
)
# Copy Dolphin pairing logic files
set(DOLPHIN_SOURCES
dolphin_src/wiimote_pairing.cpp
)
set(DOLPHIN_HEADERS
dolphin_src/wiimote_pairing.h
)
# Resource file for embedding the icon
set(RESOURCE_FILES
resources.rc
)
# Create the executable
add_executable(WiimoteBridge WIN32
${SOURCES}
${HEADERS}
${DOLPHIN_SOURCES}
${DOLPHIN_HEADERS}
${RESOURCE_FILES}
)
# Link libraries
target_link_libraries(WiimoteBridge
PRIVATE
User32.lib
Shell32.lib
Advapi32.lib
BluetoothAPIs.lib
Bthprops.lib
SetupAPI.lib
Cfgmgr32.lib
Hid.lib
ws2_32.lib
)
# Set output directory
set_target_properties(WiimoteBridge PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
# Copy icon file to output directory
add_custom_command(TARGET WiimoteBridge POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/wiimoteicon.ico"
"$<TARGET_FILE_DIR:WiimoteBridge>/wiimoteicon.ico"
COMMENT "Copying icon file..."
)
# Enable Windows subsystem
if(MSVC)
target_link_options(WiimoteBridge PRIVATE /SUBSYSTEM:WINDOWS)
endif()