forked from xibosignage/xibo-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.hpp.in
64 lines (51 loc) · 1.59 KB
/
config.hpp.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#include <string>
#include "common/FilePath.hpp"
#include "common/FileSystem.hpp"
const std::string DEFAULT_RESOURCES_DIR = "resources";
const std::string DEFAULT_CACHE_FILE = "cachedFiles.xml";
namespace ProjectResources
{
inline FilePath buildDirectory()
{
const char* directory = getenv("SNAP");
return directory == nullptr ? FilePath{"@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"} : FilePath{directory} / "bin";
}
inline FilePath configDirectory()
{
const char* directory = getenv("SNAP_USER_DATA");
return directory == nullptr ? FileSystem::currentPath() : FilePath{directory};
}
inline FilePath publicKeyFile()
{
return configDirectory() / "id_rsa.pub";
}
inline FilePath privateKeyFile()
{
return configDirectory() / "id_rsa";
}
inline FilePath defaultResourcesDir()
{
return configDirectory() / "resources";
}
inline FilePath cmsSettings()
{
return configDirectory() / "cmsSettings.xml";
}
inline FilePath playerSettings()
{
return configDirectory() / "playerSettings.xml";
}
inline std::string playerBinary()
{
const char* directory = getenv("SNAP");
auto path = buildDirectory() / "player";
return directory == nullptr ? path.string() : "desktop-launch " + path.string();
}
inline std::string optionsBinary()
{
const char* directory = getenv("SNAP");
auto path = buildDirectory() / "options";
return directory == nullptr ? path.string() : "desktop-launch " + path.string();
}
}