mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
cmake: added install and uninstall targets
This commit is contained in:
parent
5ab1f76538
commit
6fd9e4f5bc
@ -1,6 +1,23 @@
|
||||
cmake_minimum_required(VERSION 3.0.2)
|
||||
cmake_policy(SET CMP0043 OLD)
|
||||
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
# the RPATH to be used when installing, but only if it's not a system directory
|
||||
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
||||
if("${isSystemDir}" STREQUAL "-1")
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
endif("${isSystemDir}" STREQUAL "-1")
|
||||
|
||||
# add the automatically determined parts of the RPATH
|
||||
# which point to directories outside the build tree to the install RPATH
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
option(V4L-RTL "Use Linux Kernel RTL-SDR Source." OFF)
|
||||
option(V4L-MSI "Use Linux Kernel MSI2500 Source." OFF)
|
||||
option(BUILD_TYPE "Build type (RELEASE, RELEASEWITHDBGINFO, DEBUG" RELEASE)
|
||||
@ -357,3 +374,20 @@ if(LIBUSB_FOUND AND UNIX)
|
||||
add_subdirectory(fcdhid)
|
||||
add_subdirectory(fcdlib)
|
||||
endif(LIBUSB_FOUND AND UNIX)
|
||||
|
||||
##############################################################################
|
||||
|
||||
#install targets
|
||||
install(TARGETS sdrangel DESTINATION bin)
|
||||
install(TARGETS sdrbase DESTINATION lib)
|
||||
|
||||
##############################################################################
|
||||
|
||||
# uninstall target
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
|
21
cmake_uninstall.cmake.in
Normal file
21
cmake_uninstall.cmake.in
Normal file
@ -0,0 +1,21 @@
|
||||
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
exec_program(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
endif(NOT "${rm_retval}" STREQUAL 0)
|
||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
endforeach(file)
|
@ -28,3 +28,5 @@ add_library(fcdhid SHARED
|
||||
target_link_libraries(fcdhid
|
||||
${LIBUSB_LIBRARIES}
|
||||
)
|
||||
|
||||
install(TARGETS fcdhid DESTINATION lib)
|
@ -27,3 +27,5 @@ add_library(fcdlib SHARED
|
||||
)
|
||||
|
||||
target_link_libraries(fcdlib)
|
||||
|
||||
install(TARGETS fcdlib DESTINATION lib)
|
@ -44,4 +44,6 @@ target_link_libraries(demodam
|
||||
sdrbase
|
||||
)
|
||||
|
||||
qt5_use_modules(demodam Core Widgets OpenGL Multimedia)
|
||||
qt5_use_modules(demodam Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS demodam DESTINATION lib/plugins/channel)
|
@ -51,4 +51,6 @@ target_link_libraries(demodbfm
|
||||
sdrbase
|
||||
)
|
||||
|
||||
qt5_use_modules(demodbfm Core Widgets OpenGL Multimedia)
|
||||
qt5_use_modules(demodbfm Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS demodbfm DESTINATION lib/plugins/channel)
|
@ -45,3 +45,5 @@ target_link_libraries(chanalyzer
|
||||
)
|
||||
|
||||
qt5_use_modules(chanalyzer Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS chanalyzer DESTINATION lib/plugins/channel)
|
||||
|
@ -45,3 +45,5 @@ target_link_libraries(demodlora
|
||||
)
|
||||
|
||||
qt5_use_modules(demodlora Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS demodlora DESTINATION lib/plugins/channel)
|
||||
|
@ -44,4 +44,6 @@ target_link_libraries(demodnfm
|
||||
sdrbase
|
||||
)
|
||||
|
||||
qt5_use_modules(demodnfm Core Widgets OpenGL Multimedia)
|
||||
qt5_use_modules(demodnfm Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS demodnfm DESTINATION lib/plugins/channel)
|
@ -45,3 +45,5 @@ target_link_libraries(demodssb
|
||||
)
|
||||
|
||||
qt5_use_modules(demodssb Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS demodssb DESTINATION lib/plugins/channel)
|
||||
|
@ -45,3 +45,5 @@ target_link_libraries(demodtcpsrc
|
||||
)
|
||||
|
||||
qt5_use_modules(demodtcpsrc Core Widgets OpenGL Network)
|
||||
|
||||
install(TARGETS demodtcpsrc DESTINATION lib/plugins/channel)
|
||||
|
@ -45,3 +45,5 @@ target_link_libraries(demodudpsrc
|
||||
)
|
||||
|
||||
qt5_use_modules(demodudpsrc Core Widgets OpenGL Network)
|
||||
|
||||
install(TARGETS demodudpsrc DESTINATION lib/plugins/channel)
|
||||
|
@ -44,4 +44,6 @@ target_link_libraries(demodwfm
|
||||
sdrbase
|
||||
)
|
||||
|
||||
qt5_use_modules(demodwfm Core Widgets OpenGL Multimedia)
|
||||
qt5_use_modules(demodwfm Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS demodwfm DESTINATION lib/plugins/channel)
|
@ -51,3 +51,5 @@ target_link_libraries(inputairspy
|
||||
)
|
||||
|
||||
qt5_use_modules(inputairspy Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS inputairspy DESTINATION lib/plugins/samplesource)
|
||||
|
@ -50,3 +50,5 @@ target_link_libraries(inputbladerf
|
||||
)
|
||||
|
||||
qt5_use_modules(inputbladerf Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS inputbladerf DESTINATION lib/plugins/samplesource)
|
||||
|
@ -53,3 +53,5 @@ target_link_libraries(inputfcdpro
|
||||
)
|
||||
|
||||
qt5_use_modules(inputfcdpro Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS inputfcdpro DESTINATION lib/plugins/samplesource)
|
@ -53,3 +53,5 @@ target_link_libraries(inputfcdproplus
|
||||
)
|
||||
|
||||
qt5_use_modules(inputfcdproplus Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS inputfcdproplus DESTINATION lib/plugins/samplesource)
|
||||
|
@ -45,3 +45,5 @@ target_link_libraries(inputfilesource
|
||||
)
|
||||
|
||||
qt5_use_modules(inputfilesource Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS inputfilesource DESTINATION lib/plugins/samplesource)
|
||||
|
@ -51,3 +51,5 @@ target_link_libraries(inputhackrf
|
||||
)
|
||||
|
||||
qt5_use_modules(inputhackrf Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS inputhackrf DESTINATION lib/plugins/samplesource)
|
||||
|
@ -50,3 +50,5 @@ target_link_libraries(inputrtlsdr
|
||||
)
|
||||
|
||||
qt5_use_modules(inputrtlsdr Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS inputrtlsdr DESTINATION lib/plugins/samplesource)
|
||||
|
@ -54,3 +54,5 @@ target_link_libraries(inputsdrdaemon
|
||||
)
|
||||
|
||||
qt5_use_modules(inputsdrdaemon Core Widgets OpenGL Multimedia)
|
||||
|
||||
install(TARGETS inputsdrdaemon DESTINATION lib/plugins/samplesource)
|
||||
|
@ -30,11 +30,15 @@ PluginManager::~PluginManager()
|
||||
|
||||
void PluginManager::loadPlugins()
|
||||
{
|
||||
qDebug() << "PluginManager::loadPlugins: " << qPrintable(QApplication::instance()->applicationDirPath());
|
||||
QString applicationDirPath = QApplication::instance()->applicationDirPath();
|
||||
QString applicationLibPath = applicationDirPath + "/../lib";
|
||||
qDebug() << "PluginManager::loadPlugins: " << qPrintable(applicationDirPath) << ", " << qPrintable(applicationLibPath);
|
||||
|
||||
QDir pluginsDir = QDir(QApplication::instance()->applicationDirPath());
|
||||
QDir pluginsBinDir = QDir(applicationDirPath);
|
||||
QDir pluginsLibDir = QDir(applicationLibPath);
|
||||
|
||||
loadPlugins(pluginsDir);
|
||||
loadPlugins(pluginsBinDir);
|
||||
loadPlugins(pluginsLibDir);
|
||||
|
||||
qSort(m_plugins);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user