-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
68 lines (53 loc) · 1.72 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
cmake_minimum_required(VERSION 3.15)
# CMAKE_MSVC_RUNTIME_POLICY support
cmake_policy(SET CMP0091 NEW)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15 CACHE STRING "Minimum MacOS version")
if(DEFINED ENV{GITHUB_RUN_NUMBER})
set(DEFAULT_VERSION_BUILD $ENV{GITHUB_RUN_NUMBER})
else()
set(DEFAULT_VERSION_BUILD 0)
endif()
set(VERSION_BUILD "${DEFAULT_VERSION_BUILD}" CACHE STRING "patch component of version number")
project(
com.fredemmott.micmutetoggle.sdPlugin
VERSION 3.3.0.${VERSION_BUILD}
LANGUAGES CXX
)
message(STATUS "Configuring v${CMAKE_PROJECT_VERSION}")
if(MSVC)
# Statically link the MSVC runtime
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# ... but dynamically link the UCRT - the ABI-stable part
add_link_options(
"/DEFAULTLIB:ucrt$<$<CONFIG:Debug>:d>.lib"
"/NODEFAULTLIB:libucrt$<$<CONFIG:Debug>:d>.lib"
)
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED true)
set(CMAKE_CXX_EXTENSIONS false)
if(WIN32)
add_compile_definitions(
"UNICODE=1"
"_UNICODE=1"
"WIN32_LEAN_AND_MEAN=1"
"WINVER=0xa00" # Windows 10
"_WIN32_WINNT=0xa00"
)
endif()
if(MSVC)
add_compile_options(
"/diagnostics:caret" # more detailed error messages
"/EHsc" # standard-compliant exception handling
"/Zc:__cplusplus" # standard-compliant __cplusplus macro
"/await:strict" # standard--compliant coroutines
)
endif()
include("AudioDeviceLib.cmake")
include("StreamDeckSDK.cmake")
set_default_install_dir_to_streamdeck_plugin_dir()
include_directories("${CMAKE_SOURCE_DIR}")
include(sign_target.cmake)
add_subdirectory(Sources)
add_subdirectory(sdPlugin)
install(FILES README.md LICENSE LICENSE.GLYPHICONS LICENSE.AUDIO-FILES DESTINATION ${CMAKE_INSTALL_PREFIX})