1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-21 23:55:13 -05:00

Move find_package from external/CMakeLists.txt to root CMakeLists.txt so variables remain in scope.

This commit is contained in:
Jon Beniston 2023-07-30 13:05:00 +01:00
parent 97a4888a88
commit 3d55ce50ef
4 changed files with 73 additions and 39 deletions

View File

@ -198,10 +198,6 @@ if(NOT DEBUG_OUTPUT)
add_definitions("-DQT_NO_DEBUG_OUTPUT")
endif()
if(ENABLE_EXTERNAL_LIBRARIES STREQUAL "AUTO")
set(AUTO_EXTERNAL_LIBRARIES ON CACHE INTERNAL "")
endif()
# declare build structures
# !! change sdrbase/plugins/pluginmanager.cpp too !!
add_definitions("-DLIB=\"lib${LIB_SUFFIX}\"")
@ -714,7 +710,31 @@ if(WIN32)
endif()
# When ENABLE_EXTERNAL_LIBRARIES is ON, we can build most of the required 3rd party libraries from source
# When ENABLE_EXTERNAL_LIBRARIES is AUTO, we only build 3rd party libraries that aren't already available
if(ENABLE_EXTERNAL_LIBRARIES)
if (ENABLE_EXTERNAL_LIBRARIES STREQUAL "AUTO")
find_package(Codec2)
find_package(CM256cc)
find_package(LibMbe)
find_package(SerialDV)
find_package(LibDSDcc)
find_package(LimeSuite)
find_package(LibBLADERF)
find_package(LibMiriSDR)
find_package(LibIIO)
find_package(LibAIRSPYHF)
find_package(LibPerseus)
find_package(LibRTLSDR)
find_package(LibUSB)
find_package(Opus)
find_package(Boost)
find_package(ZLIB)
find_package(UHD)
find_package(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
find_package(FAAD)
find_package(FFTW3F)
find_package(OpenCV OPTIONAL_COMPONENTS core highgui imgproc imgcodecs videoio)
endif (ENABLE_EXTERNAL_LIBRARIES STREQUAL "AUTO")
add_subdirectory(external)
find_package(Boost REQUIRED)
else()

View File

@ -6,7 +6,7 @@ cd $HOME
mkdir -p external && cd external
mkdir -p drowe67 && cd drowe67
git clone https://github.com/drowe67/codec2.git
git clone https://github.com/drowe67/codec2-dev.git codec2
cd codec2
git reset --hard "v1.0.3"

View File

@ -171,30 +171,6 @@ endif (WIN32)
set(MACOS_EXTERNAL_LIBS_FIXUP "${CMAKE_BINARY_DIR}/${INSTALL_LIB_DIR}")
if (AUTO_EXTERNAL_LIBRARIES)
find_package(Codec2)
find_package(CM256cc)
find_package(LibMbe)
find_package(SerialDV)
find_package(LibDSDcc)
find_package(LimeSuite)
find_package(LibBLADERF)
find_package(LibMiriSDR)
find_package(LibIIO)
find_package(LibAIRSPYHF)
find_package(LibPerseus)
find_package(LibRTLSDR)
find_package(LibUSB)
find_package(Opus)
find_package(Boost)
find_package(ZLIB)
find_package(UHD)
find_package(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
find_package(FAAD)
find_package(FFTW3F)
find_package(OpenCV OPTIONAL_COMPONENTS core highgui imgproc imgcodecs videoio)
endif (AUTO_EXTERNAL_LIBRARIES)
# While some of the following projects are not installed (to save time & space), some have to
# be so that on MacOS, the paths embedded in the libraries to other libraries are correct (as they are set to
# install path, not build). This is required for macdeployqt to be able to find them

View File

@ -2,78 +2,116 @@ project(feature)
if (ENABLE_FEATURE_GS232CONTROLLER AND Qt${QT_DEFAULT_MAJOR_VERSION}SerialPort_FOUND)
add_subdirectory(gs232controller)
else()
message(STATUS "Not building gs232controller (ENABLE_FEATURE_GS232CONTROLLER=${ENABLE_FEATURE_GS232CONTROLLER} Qt${QT_DEFAULT_MAJOR_VERSION}SerialPort_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}SerialPort_FOUND)")
endif()
if (ENABLE_FEATURE_MAP AND Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Location_FOUND)
add_subdirectory(map)
else()
message(STATUS "Not building map (ENABLE_FEATURE_MAP=${ENABLE_FEATURE_MAP} Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND} Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND} Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND} AND Qt${QT_DEFAULT_MAJOR_VERSION}Location_FOUND=${ AND Qt${QT_DEFAULT_MAJOR_VERSION}Location_FOUND})")
endif()
if (ENABLE_FEATURE_VORLOCALIZER AND Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND)
add_subdirectory(vorlocalizer)
else()
message(STATUS "Not building vorlocalizer (ENABLE_FEATURE_VORLOCALIZER=${ENABLE_FEATURE_VORLOCALIZER} Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND} Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND} Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND})")
endif()
if (ENABLE_FEATURE_AFC)
add_subdirectory(afc)
else()
message(STATUS "Not building afc (ENABLE_FEATURE_AFC=${ENABLE_FEATURE_AFC})")
endif()
if (ENABLE_FEATURE_AIS)
add_subdirectory(ais)
else()
message(STATUS "Not building ais (ENABLE_FEATURE_AIS=${ENABLE_FEATURE_AIS})")
endif()
if (ENABLE_FEATURE_ANTENNATOOLS)
add_subdirectory(antennatools)
else()
message(STATUS "Not building antennatools (ENABLE_FEATURE_ANTENNATOOLS=${ENABLE_FEATURE_ANTENNATOOLS})")
endif()
if (ENABLE_FEATURE_APRS)
add_subdirectory(aprs)
else()
message(STATUS "Not building aprs (ENABLE_FEATURE_APRS=${ENABLE_FEATURE_APRS})")
endif()
if (ENABLE_FEATURE_DEMODANALYZER)
add_subdirectory(demodanalyzer)
else()
message(STATUS "Not building demodanalyzer (ENABLE_FEATURE_DEMODANALYZER=${ENABLE_FEATURE_DEMODANALYZER})")
endif()
if (ENABLE_FEATURE_PERTESTER)
add_subdirectory(pertester)
else()
message(STATUS "Not building pertester (ENABLE_FEATURE_PERTESTER=${ENABLE_FEATURE_PERTESTER})")
endif()
if (ENABLE_FEATURE_RIGCTLSERVER)
add_subdirectory(rigctlserver)
else()
message(STATUS "Not building rigctlserver (ENABLE_FEATURE_RIGCTLSERVER=${ENABLE_FEATURE_RIGCTLSERVER})")
endif()
if (ENABLE_FEATURE_SIMPLEPTT)
add_subdirectory(simpleptt)
else()
message(STATUS "Not building simpleptt (ENABLE_FEATURE_SIMPLEPTT=${ENABLE_FEATURE_SIMPLEPTT})")
endif()
if (NOT SERVER_MODE)
if (ENABLE_FEATURE_SATELLITETRACKER AND SGP4_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}TextToSpeech_FOUND)
add_subdirectory(satellitetracker)
endif()
if (ENABLE_FEATURE_JOGDIALCONTROLLER)
add_subdirectory(jogdialcontroller)
else()
message(STATUS "Not building satellitetracker (ENABLE_FEATURE_SATELLITETRACKER=${ENABLE_FEATURE_SATELLITETRACKER} SGP4_FOUND=${SGP4_FOUND} Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND} Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND} Qt${QT_DEFAULT_MAJOR_VERSION}TextToSpeech_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}TextToSpeech_FOUND})")
endif()
else()
if (ENABLE_FEATURE_SATELLITETRACKER AND SGP4_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND)
add_subdirectory(satellitetracker)
else()
message(STATUS "Not building satellitetracker (ENABLE_FEATURE_SATELLITETRACKER=${ENABLE_FEATURE_SATELLITETRACKER} SGP4_FOUND=${SGP4_FOUND} Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND} Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND})")
endif()
endif()
if (Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND)
if (ENABLE_FEATURE_RADIOSONDE)
add_subdirectory(radiosonde)
endif()
if (ENABLE_FEATURE_STARTRACKER)
add_subdirectory(startracker)
endif()
if (ENABLE_FEATURE_JOGDIALCONTROLLER AND NOT SERVER_MODE)
add_subdirectory(jogdialcontroller)
else()
message(STATUS "Not building jogdialcontroller (ENABLE_FEATURE_JOGDIALCONTROLLER=${ENABLE_FEATURE_JOGDIALCONTROLLER} SERVER_MODE=${SERVER_MODE})")
endif()
if (ENABLE_FEATURE_RADIOSONDE AND Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND)
add_subdirectory(radiosonde)
else()
message(STATUS "Not building radiosonde (ENABLE_FEATURE_RADIOSONDE=${ENABLE_FEATURE_RADIOSONDE} Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND})")
endif()
if (ENABLE_FEATURE_STARTRACKER AND Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND)
add_subdirectory(startracker)
else()
message(STATUS "Not building startracker (ENABLE_FEATURE_STARTRACKER=${ENABLE_FEATURE_STARTRACKER} Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND})")
endif()
if (ENABLE_FEATURE_LIMERFE AND ENABLE_LIMESUITE AND LIMESUITE_FOUND)
add_subdirectory(limerfe)
else()
message(STATUS "Not building limerfe (ENABLE_FEATURE_LIMERFE=${ENABLE_FEATURE_LIMERFE} ENABLE_LIMESUITE=${ENABLE_LIMESUITE} LIMESUITE_FOUND=${LIMESUITE_FOUND})")
endif()
if (ENABLE_FEATURE_AMBE AND LIBSERIALDV_FOUND)
add_subdirectory(ambe)
else()
message(STATUS "Not building ambe (ENABLE_FEATURE_AMBE=${ENABLE_FEATURE_AMBE} LIBSERIALDV_FOUND=${LIBSERIALDV_FOUND})")
endif()
if (ENABLE_FEATURE_REMOTECONTROL)
add_subdirectory(remotecontrol)
else()
message(STATUS "Not building remotecontrol (ENABLE_FEATURE_REMOTECONTROL=${ENABLE_FEATURE_REMOTECONTROL})")
endif()