Skip to content

Commit

Permalink
cmake: hide features from summary that are not available on host OS
Browse files Browse the repository at this point in the history
  • Loading branch information
rjonaitis committed Apr 26, 2024
1 parent 538f5a4 commit d32d564
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
9 changes: 3 additions & 6 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ add_subdirectory(SoapyLMS7)
########################################################################
## GNU Radio plugin
########################################################################
option(ENABLE_GNURADIO "Enable build library" OFF)
find_package(Gnuradio QUIET) # precheck if any gnuradio package is available
cmake_dependent_option(ENABLE_GNURADIO "Build LimeSuiteNG plugin for GNU Radio" ON "ENABLE_LIBRARY;Gnuradio_FOUND" OFF)
add_feature_info(GNURADIO ENABLE_GNURADIO "GNU Radio 3.9+ Plug-in")
if(ENABLE_GNURADIO)
add_subdirectory(gr-limesdr)
Expand All @@ -26,8 +27,4 @@ endif()
########################################################################
## HDSDR plugin
########################################################################
cmake_dependent_option(ENABLE_HDSDR "Enable HDSDR plugin" ON "ENABLE_LIBRARY;MSVC;CMAKE_SIZEOF_VOID_P EQUAL 4" OFF)
add_feature_info(HDSDR ENABLE_HDSDR "HDSDR plugin for limesuiteng")
if(ENABLE_HDSDR)
add_subdirectory(HDSDR)
endif()
add_subdirectory(HDSDR)
9 changes: 3 additions & 6 deletions plugins/Desktop/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
########################################################################
## Feature registration
########################################################################
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LINUX TRUE)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
return()
endif()

include(FeatureSummary)
include(CMakeDependentOption)
cmake_dependent_option(ENABLE_DESKTOP "Enable LimeSuiteNG launcher and icons" ON "ENABLE_GUI;LINUX" OFF)
cmake_dependent_option(ENABLE_DESKTOP "Enable LimeSuiteNG launcher and icons" ON "ENABLE_GUI" OFF)
add_feature_info(DESKTOP ENABLE_DESKTOP "LimeSuiteNG freedesktop integration")
if(NOT ENABLE_DESKTOP)
return()
Expand Down
11 changes: 11 additions & 0 deletions plugins/HDSDR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
########################################################################
cmake_minimum_required(VERSION 3.12)

# HDSDR is Windows only
if (NOT CMAKE_HOST_WIN32)
return()
endif()

cmake_dependent_option(ENABLE_HDSDR "Enable HDSDR plugin" ON "ENABLE_LIBRARY;MSVC;CMAKE_SIZEOF_VOID_P EQUAL 4" OFF)
add_feature_info(HDSDR ENABLE_HDSDR "HDSDR (32bit only) plugin for limesuiteng")
if (NOT ENABLE_HDSDR)
return()
endif()

# Only compile on Windows
if(NOT MSVC)
message(FATAL_ERROR "HDSDR build is available on Microsoft Visual Studio")
Expand Down
13 changes: 7 additions & 6 deletions plugins/gr-limesdr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ else()
# Requires GNU Radio commit 02da1cb623f77d7d443ddbb291b7fec1eb147b04 (for v3.10) or 4b030830625849df9620e6aac78b7da46c788d26 (v3.11+) to be present
if(Gnuradio_VERSION VERSION_LESS "3.10.4")
message(
SEND_ERROR
WARNING
"gr-limesdr in-tree build is not possible. Needed GNU Radio version is at least 3.10.4, GNU Radio version found: ${Gnuradio_VERSION}"
)
return()
Expand Down Expand Up @@ -162,11 +162,12 @@ file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIR}" PYTHON_NUMPY_INCLUDE_DIR)
########################################################################
include(FeatureSummary)
include(CMakeDependentOption)
option(ENABLE_RFE "Enable LimeRFE support" OFF)
add_feature_info(LimeRFE ENABLE_LIBRARY "LimeRFE support")
if(ENABLE_RFE)
message(STATUS "Enabling LimeRFE support")
endif()
# RFE Support not added yet
# option(ENABLE_RFE "Enable LimeRFE support" OFF)
# add_feature_info(LimeRFE ENABLE_LIBRARY "LimeRFE support")
# if(ENABLE_RFE)
# message(STATUS "Enabling LimeRFE support")
# endif()

########################################################################
# Setup doxygen option
Expand Down

0 comments on commit d32d564

Please sign in to comment.