-
Notifications
You must be signed in to change notification settings - Fork 10
/
StreamDeckSDK.cmake
45 lines (40 loc) · 1012 Bytes
/
StreamDeckSDK.cmake
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
include(FetchContent)
FetchContent_Declare(
StreamDeckSDK
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../
GIT_TAG none
)
FetchContent_GetProperties(StreamDeckSDK)
if(NOT streamdecksdk_POPULATED)
FetchContent_Populate(StreamDeckSDK)
add_subdirectory("${streamdecksdk_SOURCE_DIR}" "${streamdecksdk_BINARY_DIR}" EXCLUDE_FROM_ALL)
endif()
if(APPLE)
set(
STREAMDECK_PLUGIN_DIR
"$ENV{HOME}/Library/Application Support/com.elgato.StreamDeck/Plugins"
)
elseif(WIN32)
string(
REPLACE
"\\"
"/"
STREAMDECK_PLUGIN_DIR
"$ENV{appdata}/Elgato/StreamDeck/Plugins"
)
endif()
set(
STREAMDECK_PLUGIN_DIR
${STREAMDECK_PLUGIN_DIR}
CACHE PATH "Path to this system's streamdeck plugin directory"
)
function(set_default_install_dir_to_streamdeck_plugin_dir)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(
CMAKE_INSTALL_PREFIX
"${STREAMDECK_PLUGIN_DIR}/${CMAKE_PROJECT_NAME}"
CACHE PATH "See cmake documentation"
FORCE
)
endif()
endfunction()