mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-26 04:17:50 +02:00
Support installation via CMake
This commit is contained in:
@ -10,6 +10,9 @@ else()
|
||||
endif (MSVC)
|
||||
add_definitions(-DSDRPP_IS_CORE)
|
||||
|
||||
# Set the install prefix
|
||||
add_compile_definitions(INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Main code
|
||||
file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c")
|
||||
|
||||
@ -88,3 +91,6 @@ endif ()
|
||||
set(CORE_FILES ${RUNTIME_OUTPUT_DIRECTORY} PARENT_SCOPE)
|
||||
|
||||
# cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/Users/Alex/vcpkg/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 15 2017 Win64"
|
||||
|
||||
# Install directives
|
||||
install(TARGETS sdrpp_core DESTINATION lib)
|
@ -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
|
||||
|
Reference in New Issue
Block a user