-
Notifications
You must be signed in to change notification settings - Fork 10
/
StreamDeckSDK.cmake.in
46 lines (41 loc) · 1.03 KB
/
StreamDeckSDK.cmake.in
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
include(FetchContent)
FetchContent_Declare(
StreamDeckSDK
@SOURCE_URL_TYPE@ @SOURCE_URL@
@SOURCE_REF_TYPE@ @SOURCE_REF@
DOWNLOAD_EXTRACT_TIMESTAMP ON
)
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()