1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

Added support for LIB_SUFFIX (e.g. for lib64 on Fedora)

This commit is contained in:
Jaroslav Škarvada 2022-01-26 01:00:49 +01:00
parent 60a1955d54
commit 5904c2f8b0
No known key found for this signature in database
GPG Key ID: D8E1C00E076E840B
3 changed files with 33 additions and 28 deletions

View File

@ -115,8 +115,9 @@ endif()
# declare build structures
# !! change sdrbase/plugins/pluginmanager.cpp too !!
add_definitions("-DLIB=\"lib${LIB_SUFFIX}\"")
set(SDRANGEL_BINARY_BIN_DIR "${CMAKE_BINARY_DIR}/bin")
set(SDRANGEL_BINARY_LIB_DIR "${CMAKE_BINARY_DIR}/lib")
set(SDRANGEL_BINARY_LIB_DIR "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}")
if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${SDRANGEL_BINARY_BIN_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
@ -151,7 +152,7 @@ elseif(WIN32)
set(INSTALL_DOC_DIR ".")
else()
set(INSTALL_BIN_DIR "bin")
set(INSTALL_LIB_DIR "lib/${CMAKE_PROJECT_NAME}")
set(INSTALL_LIB_DIR "lib${LIB_SUFFIX}/${CMAKE_PROJECT_NAME}")
set(INSTALL_DOC_DIR "share/${CMAKE_PROJECT_NAME}")
endif()
set(INSTALL_PLUGINS_DIR "${INSTALL_LIB_DIR}/plugins")
@ -589,7 +590,7 @@ endif()
# install external libraries dependencies (Linux)
if (LINUX AND ENABLE_EXTERNAL_LIBRARIES)
install(DIRECTORY ${EXTERNAL_BUILD_LIBRARIES}/lib/ DESTINATION ${INSTALL_LIB_DIR})
install(DIRECTORY ${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/ DESTINATION ${INSTALL_LIB_DIR})
endif()
if(WIN32)
include(DeployQt)

View File

@ -57,14 +57,14 @@ elseif (LINUX)
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=${EXTERNAL_BUILD_LIBRARIES}/bin
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=${EXTERNAL_BUILD_LIBRARIES}/bin
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO=${EXTERNAL_BUILD_LIBRARIES}/bin
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${EXTERNAL_BUILD_LIBRARIES}/lib
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG=${EXTERNAL_BUILD_LIBRARIES}/lib
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=${EXTERNAL_BUILD_LIBRARIES}/lib
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO=${EXTERNAL_BUILD_LIBRARIES}/lib
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${EXTERNAL_BUILD_LIBRARIES}/lib
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG=${EXTERNAL_BUILD_LIBRARIES}/lib
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=${EXTERNAL_BUILD_LIBRARIES}/lib
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO=${EXTERNAL_BUILD_LIBRARIES}/lib
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
)
endif ()
@ -189,7 +189,7 @@ if (NOT WIN32 AND (NOT CODEC2_FOUND OR CODEC2_EXTERNAL))
if (WIN32)
set(CODEC2_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/codec2.lib" CACHE INTERNAL "")
elseif (LINUX)
set(CODEC2_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libcodec2${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
set(CODEC2_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libcodec2${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
endif ()
ExternalProject_Add(codec2
GIT_REPOSITORY https://github.com/drowe67/codec2.git
@ -208,7 +208,7 @@ if (NOT WIN32 AND (NOT CODEC2_FOUND OR CODEC2_EXTERNAL))
set(CODEC2_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/codec2.lib" CACHE INTERNAL "")
makeCopy("${source_dir}/src" "${source_dir}/src/codec2" codec2)
elseif (LINUX)
set(CODEC2_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libcodec2${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
set(CODEC2_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libcodec2${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
makeLink("${source_dir}/src" "${source_dir}/src/codec2" codec2)
else ()
set(CODEC2_LIBRARIES "${binary_dir}/src/libcodec2${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
@ -222,7 +222,7 @@ if (NOT APPLE AND (NOT CM256CC_FOUND OR CM256CC_EXTERNAL))
if (WIN32)
set(CM256CC_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/cm256cc.lib" CACHE INTERNAL "")
elseif (LINUX)
set(CM256CC_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libcm256cc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
set(CM256CC_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libcm256cc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
endif ()
string(REPLACE ";" "|" CMAKE_PREFIX_PATH_SEP "${CMAKE_PREFIX_PATH}")
ExternalProject_Add(cm256cc
@ -258,7 +258,7 @@ if ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND (NOT LIBMBE_FOUND OR LIBMBE_EX
if (WIN32)
set(LIBMBE_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/libmbe.lib" CACHE INTERNAL "")
elseif (LINUX)
set(LIBMBE_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libmbe${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
set(LIBMBE_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libmbe${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
endif ()
ExternalProject_Add(mbelib
GIT_REPOSITORY https://github.com/kasper93/mbelib.git
@ -290,7 +290,7 @@ if (NOT LIBSERIALDV_FOUND OR LIBSERIALDV_EXTERNAL)
if (WIN32)
set(LIBSERIALDV_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/serialdv.lib" CACHE INTERNAL "")
elseif (LINUX)
set(LIBSERIALDV_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib/libserialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
set(LIBSERIALDV_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libserialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
endif ()
ExternalProject_Add(serialdv
GIT_REPOSITORY https://github.com/f4exb/serialDV.git
@ -328,7 +328,7 @@ if ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND LIBMBE_FOUND)
if (WIN32)
set(LIBDSDCC_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/dsdcc.lib" CACHE INTERNAL "")
elseif (LINUX)
set(LIBDSDCC_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libdsdcc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
set(LIBDSDCC_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libdsdcc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
endif ()
ExternalProject_Add(dsdcc
GIT_REPOSITORY https://github.com/f4exb/dsdcc.git
@ -363,7 +363,7 @@ endif ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND LIBMBE_FOUND)
if (WIN32)
set(APT_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/apt.lib" CACHE INTERNAL "")
elseif (LINUX)
set(APT_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libapt${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
set(APT_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libapt${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
endif()
ExternalProject_Add(apt
GIT_REPOSITORY https://github.com/srcejon/aptdec.git
@ -393,7 +393,7 @@ endif ()
if (WIN32)
set(SGP4_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/sgp4s.lib" CACHE INTERNAL "")
elseif (LINUX)
set(SGP4_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libsgp4s${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
set(SGP4_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libsgp4s${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
endif()
ExternalProject_Add(sgp4
GIT_REPOSITORY https://github.com/dnwrnr/sgp4.git
@ -448,7 +448,7 @@ if (ZLIB_FOUND AND FAAD_FOUND)
if (WIN32)
set(DAB_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/dab_lib.lib" CACHE INTERNAL "")
elseif (LINUX)
set(DAB_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libdab_lib${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
set(DAB_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libdab_lib${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
endif()
if (WIN32)
ExternalProject_Add(dab
@ -511,7 +511,7 @@ if (LINUX)
set(LIMESUITE_FOUND ON CACHE INTERNAL "")
set(LIMESUITE_EXTERNAL ON CACHE INTERNAL "")
set(LIMESUITE_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/limesuite/src/limesuite/src" CACHE INTERNAL "")
set(LIMESUITE_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib/libLimeSuite.so" CACHE INTERNAL "")
set(LIMESUITE_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libLimeSuite.so" CACHE INTERNAL "")
ExternalProject_Add(limesuite
GIT_REPOSITORY https://github.com/myriadrf/LimeSuite.git
GIT_TAG ${LIMESUITE_TAG}
@ -561,7 +561,7 @@ if (LINUX)
set(LIBIIO_FOUND ON CACHE INTERNAL "")
set(LIBIIO_EXTERNAL ON CACHE INTERNAL "")
set(LIBIIO_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/libiio/src/libiio" CACHE INTERNAL "")
set(LIBIIO_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libiio.so" CACHE INTERNAL "")
set(LIBIIO_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libiio.so" CACHE INTERNAL "")
ExternalProject_Add(libiio
GIT_REPOSITORY https://github.com/analogdevicesinc/libiio.git
GIT_TAG ${LIBIIO_TAG}
@ -582,7 +582,7 @@ if (LINUX)
if (NOT LIBAIRSPYHF_FOUND OR LIBAIRSPYHF_EXTERNAL)
set(LIBAIRSPYHF_FOUND ON CACHE INTERNAL "")
set(LIBAIRSPYHF_EXTERNAL ON CACHE INTERNAL "")
set(LIBAIRSPYHF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libairspyhf.so" CACHE INTERNAL "")
set(LIBAIRSPYHF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libairspyhf.so" CACHE INTERNAL "")
ExternalProject_Add(airspyhf
GIT_REPOSITORY https://github.com/airspy/airspyhf.git
GIT_TAG ${AIRSPYHF_TAG}
@ -602,7 +602,7 @@ if (LINUX)
set(LIBPERSEUS_FOUND ON CACHE INTERNAL "")
set(LIBPERSEUS_EXTERNAL ON CACHE INTERNAL "")
set(LIBPERSEUS_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/perseus/src/perseus" CACHE INTERNAL "")
set(LIBPERSEUS_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libperseus-sdr.so" CACHE INTERNAL "")
set(LIBPERSEUS_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libperseus-sdr.so" CACHE INTERNAL "")
ExternalProject_Add(perseus
GIT_REPOSITORY https://github.com/f4exb/libperseus-sdr.git
GIT_TAG ${PERSEUS_TAG}
@ -620,7 +620,7 @@ if (LINUX)
set(LIBRTLSDR_FOUND ON CACHE INTERNAL "")
set(LIBRTLSDR_EXTERNAL ON CACHE INTERNAL "")
set(LIBRTLSDR_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/rtlsdr/src/rtlsdr/include" CACHE INTERNAL "")
set(LIBRTLSDR_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/librtlsdr.so" CACHE INTERNAL "")
set(LIBRTLSDR_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/librtlsdr.so" CACHE INTERNAL "")
ExternalProject_Add(rtlsdr
GIT_REPOSITORY https://github.com/osmocom/rtl-sdr.git
GIT_TAG ${RTLSDR_TAG}
@ -638,7 +638,7 @@ if (LINUX)
set(LIBMIRISDR_FOUND ON CACHE INTERNAL "")
set(LIBMIRISDR_EXTERNAL ON CACHE INTERNAL "")
set(LIBMIRISDR_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/libmirisdr/src/libmirisdr/include" CACHE INTERNAL "")
set(LIBMIRISDR_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libmirisdr.so" CACHE INTERNAL "")
set(LIBMIRISDR_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libmirisdr.so" CACHE INTERNAL "")
ExternalProject_Add(libmirisdr
GIT_REPOSITORY https://github.com/f4exb/libmirisdr-4.git
GIT_TAG ${MIRISDR_TAG}

View File

@ -30,6 +30,10 @@
#include "plugin/pluginmanager.h"
#ifndef LIB
#define LIB "lib"
#endif
const QString PluginManager::m_localInputHardwareID = "LocalInput";
const QString PluginManager::m_localInputDeviceTypeID = "sdrangel.samplesource.localinput";
const QString PluginManager::m_remoteInputHardwareID = "RemoteInput";
@ -71,9 +75,9 @@ void PluginManager::loadPluginsPart(const QString& pluginsSubDir)
// NOTE: not the best solution but for now this is
// on make install [PREFIX]/bin and [PREFIX]/lib/sdrangel
PluginsPath << applicationDirPath + "/../lib/sdrangel/" + pluginsSubDir;
PluginsPath << applicationDirPath + "/../" + LIB + "/sdrangel/" + pluginsSubDir;
// on build
PluginsPath << applicationDirPath + "/lib/" + pluginsSubDir;
PluginsPath << applicationDirPath + "/" + LIB + "/" + pluginsSubDir;
#ifdef __APPLE__
// on SDRAngel.app
PluginsPath << applicationDirPath + "/../Resources/lib/" + pluginsSubDir;