add global definitions for all paths

This commit is contained in:
AlexandreRouma
2024-08-25 21:40:01 +02:00
parent d5bc0fa3c3
commit d905d19020
5 changed files with 70 additions and 36 deletions

View File

@@ -24,14 +24,16 @@
#include <Windows.h>
#endif
#ifndef INSTALL_PREFIX
#ifdef __APPLE__
#define INSTALL_PREFIX "/usr/local"
#else
#define INSTALL_PREFIX "/usr"
// Default install dirs to make the IDE happy
#ifndef SDRPP_MODULES_LOAD_DIR
#define SDRPP_MODULES_LOAD_DIR ""
#endif
#ifndef SDRPP_RES_LOAD_DIR
#define SDRPP_RES_LOAD_DIR ""
#endif
namespace core {
ConfigManager configManager;
ModuleManager moduleManager;
@@ -248,19 +250,14 @@ int sdrpp_main(int argc, char* argv[]) {
defConfig["lockMenuOrder"] = false;
#endif
#if defined(_WIN32)
defConfig["modulesDirectory"] = "./modules";
defConfig["resourcesDirectory"] = "./res";
#elif defined(IS_MACOS_BUNDLE)
defConfig["modulesDirectory"] = "../Plugins";
defConfig["resourcesDirectory"] = "../Resources";
#elif defined(__ANDROID__)
defConfig["modulesDirectory"] = root + "/modules";
defConfig["resourcesDirectory"] = root + "/res";
#if define(__ANDROID__)
defConfig["modulesDirectory"] = root + SDRPP_MODULES_LOAD_DIR;
defConfig["resourcesDirectory"] = root + SDRPP_RES_LOAD_DIR;
#else
defConfig["modulesDirectory"] = INSTALL_PREFIX "/lib/sdrpp/plugins";
defConfig["resourcesDirectory"] = INSTALL_PREFIX "/share/sdrpp";
defConfig["modulesDirectory"] = SDRPP_MODULES_LOAD_DIR;
defConfig["resourcesDirectory"] = SDRPP_RES_LOAD_DIR;
#endif
// Load config
flog::info("Loading config");