Support installation via CMake

This commit is contained in:
Aang23
2021-02-11 22:49:33 +01:00
parent b86cf9681c
commit 835ec716a0
17 changed files with 112 additions and 15 deletions

View File

@ -28,6 +28,10 @@
#include <Windows.h>
#endif
#ifndef INSTALL_PREFIX
#define INSTALL_PREFIX "/usr"
#endif
namespace core {
ConfigManager configManager;
ScriptManager scriptManager;
@ -146,8 +150,8 @@ int sdrpp_main(int argc, char *argv[]) {
defConfig["modulesDirectory"] = "./modules";
defConfig["resourcesDirectory"] = "./res";
#else
defConfig["modulesDirectory"] = "/usr/lib/sdrpp/plugins";
defConfig["resourcesDirectory"] = "/usr/share/sdrpp";
defConfig["modulesDirectory"] = (std::string)INSTALL_PREFIX + "/lib/sdrpp/plugins";
defConfig["resourcesDirectory"] = (std::string)INSTALL_PREFIX + "/share/sdrpp";
#endif
// Load config