-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
48 lines (38 loc) · 1.39 KB
/
Copy pathCMakeLists.txt
File metadata and controls
48 lines (38 loc) · 1.39 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
cmake_minimum_required(VERSION 3.20)
# Use the static MSVC runtime so the result is a single portable .exe.
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
project(ShakeToZoom LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
add_executable(ShakeToZoom WIN32
src/main.cpp
src/MouseHook.cpp
src/ShakeDetector.cpp
src/CursorOverlay.cpp
src/TrayIcon.cpp
src/Settings.cpp
src/SettingsDialog.cpp
src/Autostart.cpp
src/Suppression.cpp
res/resource.rc
)
target_include_directories(ShakeToZoom PRIVATE src res)
# The .rc pulls in these assets; without this the resource is not recompiled
# when only the icon or manifest changes.
set_source_files_properties(res/resource.rc PROPERTIES
OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/res/app.ico;${CMAKE_CURRENT_SOURCE_DIR}/res/app.manifest")
target_compile_definitions(ShakeToZoom PRIVATE
UNICODE _UNICODE WIN32_LEAN_AND_MEAN NOMINMAX)
target_link_libraries(ShakeToZoom PRIVATE
user32 gdi32 shell32 comctl32 advapi32 winmm ole32 dwmapi)
# Merge our custom manifest (PerMonitorV2 DPI, common controls v6) into the
# single linker-embedded manifest instead of embedding a second one via .rc.
if(MSVC)
target_link_options(ShakeToZoom PRIVATE
"/MANIFESTINPUT:${CMAKE_CURRENT_SOURCE_DIR}/res/app.manifest")
endif()