diff --git a/CMakeLists.txt b/CMakeLists.txt index dec1a3edb..520d68944 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,7 +143,7 @@ if(NOT ${THIS_IS_A_RELEASE}) find_package(Git) set_package_properties(Git PROPERTIES URL "https://git-scm.com" - DESCRIPTION "A free and open source distributed version control system" + DESCRIPTION "A free and open source distributed version control system (found: ${GIT_VERSION_STRING})" PURPOSE "Manage version control, get MINOR_VERSION name for version number." TYPE REQUIRED ) @@ -809,15 +809,15 @@ endif() # VOLK - Vector-Optimized Library of Kernels ################################################################################ find_package(VOLK) -set_package_properties(VOLK PROPERTIES - URL "http://libvolk.org" - DESCRIPTION "Vector-Optimized Library of Kernels" - PURPOSE "Provides an abstraction of optimized math routines targeting several SIMD processors." - TYPE REQUIRED -) if(NOT VOLK_FOUND) message(FATAL_ERROR "*** VOLK is required to build gnss-sdr") endif() +set_package_properties(VOLK PROPERTIES + URL "http://libvolk.org" + DESCRIPTION "Vector-Optimized Library of Kernels (found: ${VOLK_VERSION})" + PURPOSE "Provides an abstraction of optimized math routines targeting several SIMD processors." + TYPE REQUIRED +) @@ -875,26 +875,32 @@ if(NOT VOLKGNSSSDR_FOUND) message(FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK_GNSSSDR") endif() - set_package_properties(Python3 PROPERTIES - URL "https://www.python.org/" - DESCRIPTION "An interpreted, high-level, general-purpose programming language" - PURPOSE "Required to build volk_gnsssdr." - TYPE REQUIRED - ) + if(Python3_FOUND) + set_package_properties(Python3 PROPERTIES + URL "https://www.python.org/" + DESCRIPTION "An interpreted, high-level, general-purpose programming language (found: ${Python3_VERSION})" + PURPOSE "Required to build volk_gnsssdr." + TYPE REQUIRED + ) + endif() - set_package_properties(Python2 PROPERTIES - URL "https://www.python.org/" - DESCRIPTION "An interpreted, high-level, general-purpose programming language" - PURPOSE "Required to build volk_gnsssdr." - TYPE REQUIRED - ) + if(Python2_FOUND) + set_package_properties(Python2 PROPERTIES + URL "https://www.python.org/" + DESCRIPTION "An interpreted, high-level, general-purpose programming language (found: ${Python2_VERSION})" + PURPOSE "Required to build volk_gnsssdr." + TYPE REQUIRED + ) + endif() - set_package_properties(PythonInterp PROPERTIES - URL "https://www.python.org/" - DESCRIPTION "An interpreted, high-level, general-purpose programming language" - PURPOSE "Required to build volk_gnsssdr." - TYPE REQUIRED - ) + if(PYTHONINTERP_FOUND) + set_package_properties(PythonInterp PROPERTIES + URL "https://www.python.org/" + DESCRIPTION "An interpreted, high-level, general-purpose programming language (found: ${PYTHON_VERSION_STRING})" + PURPOSE "Required to build volk_gnsssdr." + TYPE REQUIRED + ) + endif() set(READ_ENVIRO "") if(ENABLE_PACKAGING) @@ -1343,7 +1349,6 @@ endif() find_package(Armadillo) set_package_properties(Armadillo PROPERTIES URL "http://arma.sourceforge.net/" - DESCRIPTION "C++ library for linear algebra and scientific computing" PURPOSE "Used for matrix computations." TYPE REQUIRED ) @@ -1445,6 +1450,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) INTERFACE_LINK_LIBRARIES "${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}" ) set_package_properties(Armadillo PROPERTIES + DESCRIPTION "C++ library for linear algebra and scientific computing" PURPOSE "Armadillo ${GNSSSDR_ARMADILLO_LOCAL_VERSION} will be downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." ) endif() @@ -1503,7 +1509,7 @@ if(NOT GNUTLS_OPENSSL_LIBRARY) find_package(OpenSSL) set_package_properties(OpenSSL PROPERTIES URL "https://www.openssl.org" - DESCRIPTION "Cryptography and SSL/TLS Toolkit" + DESCRIPTION "Cryptography and SSL/TLS Toolkit (found: v${OPENSSL_VERSION})" PURPOSE "Used for the SUPL protocol implementation." TYPE REQUIRED ) @@ -1540,7 +1546,6 @@ endif() find_package(MATIO) set_package_properties(MATIO PROPERTIES URL "https://github.com/tbeu/matio" - DESCRIPTION "MATLAB MAT File I/O Library" PURPOSE "Used to store processing block's results in MAT files readable from MATLAB/Octave." TYPE REQUIRED ) @@ -1550,6 +1555,9 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS endif() message(STATUS " Matio v${GNSSSDR_MATIO_LOCAL_VERSION} will be downloaded and built automatically") message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.") + set_package_properties(MATIO PROPERTIES + DESCRIPTION "MATLAB MAT File I/O Library" + ) find_package(ZLIB) set_package_properties(ZLIB PROPERTIES URL "https://www.zlib.net/" @@ -1682,7 +1690,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS ) else() set_package_properties(MATIO PROPERTIES - DESCRIPTION "MATLAB MAT File I/O Library (found: v.${MATIO_VERSION_STRING})" + DESCRIPTION "MATLAB MAT File I/O Library (found: v${MATIO_VERSION_STRING})" ) endif() @@ -1694,11 +1702,13 @@ endif() find_package(PUGIXML) set_package_properties(PUGIXML PROPERTIES URL "https://pugixml.org/" - DESCRIPTION "Light-weight, simple and fast XML parser for C++" PURPOSE "Used to handle Galileo almanac XML files published by the European GNSS Service Centre." TYPE REQUIRED ) if(NOT PUGIXML_FOUND) + set_package_properties(PUGIXML PROPERTIES + DESCRIPTION "Light-weight, simple and fast XML parser for C++" + ) message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.") set(PUGIXML_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) set(TOOLCHAIN_ARG "") @@ -1748,6 +1758,16 @@ if(NOT PUGIXML_FOUND) set_package_properties(PUGIXML PROPERTIES PURPOSE "PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." ) +else() + if(PUGIXML_VERSION) + set_package_properties(PUGIXML PROPERTIES + DESCRIPTION "Light-weight, simple and fast XML parser for C++ (found: ${PUGIXML_VERSION})" + ) + else() + set_package_properties(PUGIXML PROPERTIES + DESCRIPTION "Light-weight, simple and fast XML parser for C++" + ) + endif() endif() @@ -1758,7 +1778,6 @@ endif() find_package(Protobuf) set_package_properties(Protobuf PROPERTIES URL "https://developers.google.com/protocol-buffers/" - DESCRIPTION "Structured data serialization mechanism" PURPOSE "Used to serialize output data in a way that can be read by other applications." TYPE REQUIRED ) @@ -1816,6 +1835,10 @@ if(Protobuf_FOUND) set_package_properties(Protobuf PROPERTIES DESCRIPTION "Structured data serialization mechanism (found: v${Protobuf_VERSION})" ) +else() + set_package_properties(Protobuf PROPERTIES + DESCRIPTION "Structured data serialization mechanism" + ) endif() if(Protobuf_FOUND AND CMAKE_CROSSCOMPILING) @@ -2159,7 +2182,6 @@ endif() find_package(GROSMOSDR) set_package_properties(GROSMOSDR PROPERTIES URL "https://osmocom.org/projects/gr-osmosdr/wiki" - DESCRIPTION "osmocom GNU Radio blocks" PURPOSE "Used for communication with OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.)." TYPE OPTIONAL ) @@ -2167,7 +2189,19 @@ if(ENABLE_OSMOSDR) if(GROSMOSDR_FOUND) message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.") message(STATUS " You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ..'") + if(GROSMOSDR_VERSION) + set_package_properties(GROSMOSDR PROPERTIES + DESCRIPTION "osmocom GNU Radio blocks (found: v${GROSMOSDR_VERSION})" + ) + else() + set_package_properties(GROSMOSDR PROPERTIES + DESCRIPTION "osmocom GNU Radio blocks" + ) + endif() else() + set_package_properties(GROSMOSDR PROPERTIES + DESCRIPTION "osmocom GNU Radio blocks" + ) if(ENABLE_PACKAGING) message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") else() @@ -2175,6 +2209,9 @@ if(ENABLE_OSMOSDR) endif() endif() else() + set_package_properties(GROSMOSDR PROPERTIES + DESCRIPTION "osmocom GNU Radio blocks" + ) message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled.") message(STATUS " Enable it with 'cmake -DENABLE_OSMOSDR=ON ..' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") endif() @@ -2188,10 +2225,19 @@ endif() find_package(GRIIO) set_package_properties(GRIIO PROPERTIES URL "https://github.com/analogdevicesinc/gr-iio" - DESCRIPTION "IIO blocks for GNU Radio" PURPOSE "Used for communication with PlutoSDR and FMCOMMS devices." TYPE OPTIONAL ) +if(GRIIO_FOUND AND GRIIO_VERSION) + set_package_properties(GRIIO PROPERTIES + DESCRIPTION "IIO blocks for GNU Radio (found: v${GRIIO_VERSION})" + ) +else() + set_package_properties(GRIIO PROPERTIES + DESCRIPTION "IIO blocks for GNU Radio" + ) +endif() + ##################################################################### diff --git a/cmake/Modules/FindGRIIO.cmake b/cmake/Modules/FindGRIIO.cmake index 8b83d9386..720313b15 100644 --- a/cmake/Modules/FindGRIIO.cmake +++ b/cmake/Modules/FindGRIIO.cmake @@ -92,6 +92,10 @@ find_library(IIO_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) +if(PC_IIO_VERSION) + set(GRIIO_VERSION ${PC_IIO_VERSION}) +endif() + if(GRIIO_FOUND AND NOT TARGET Gnuradio::iio) add_library(Gnuradio::iio SHARED IMPORTED) set_target_properties(Gnuradio::iio PROPERTIES diff --git a/cmake/Modules/FindGROSMOSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake index 0054db97d..e655a20d8 100644 --- a/cmake/Modules/FindGROSMOSDR.cmake +++ b/cmake/Modules/FindGROSMOSDR.cmake @@ -95,6 +95,10 @@ find_library(GROSMOSDR_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) +if(GROSMOSDR_PKG_VERSION) + set(GROSMOSDR_VERSION ${GROSMOSDR_PKG_VERSION}) +endif() + if(GROSMOSDR_FOUND AND NOT TARGET Gnuradio::osmosdr) add_library(Gnuradio::osmosdr SHARED IMPORTED) set_target_properties(Gnuradio::osmosdr PROPERTIES diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake index 7534f4a00..5db152d21 100644 --- a/cmake/Modules/FindLIBOSMOSDR.cmake +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -42,6 +42,7 @@ find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h /usr/local/include ${LIBOSMOSDR_ROOT}/include $ENV{LIBOSMOSDR_ROOT}/include + ${LIBOSMOSDR_PKG_INCLUDEDIR} ) find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr @@ -77,6 +78,7 @@ find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr $ENV{LIBOSMOSDR_ROOT}/lib ${LIBOSMOSDR_ROOT}/lib64 $ENV{LIBOSMOSDR_ROOT}/lib64 + ${LIBOSMOSDR_PKG_LIBDIR} ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake index 3d8ce2bdc..2868b63bd 100644 --- a/cmake/Modules/FindPUGIXML.cmake +++ b/cmake/Modules/FindPUGIXML.cmake @@ -27,6 +27,9 @@ # Pugixml::pugixml # +include(FindPkgConfig) +pkg_check_modules(PC_PUGIXML pugixml QUIET) + find_path(PUGIXML_INCLUDE_DIR NAMES pugixml.hpp PATHS ${PUGIXML_HOME}/include @@ -38,6 +41,7 @@ find_path(PUGIXML_INCLUDE_DIR $ENV{PUGIXML_ROOT}/include ${PUGIXML_ROOT}/include/pugixml-1.9 $ENV{PUGIXML_ROOT}/include/pugixml-1.9 + ${PC_PUGIXML_INCLUDEDIR} ) find_library(PUGIXML_LIBRARY @@ -67,6 +71,7 @@ find_library(PUGIXML_LIBRARY $ENV{PUGIXML_ROOT}/lib/pugixml-1.9 ${PUGIXML_ROOT}/lib64/pugixml-1.9 $ENV{PUGIXML_ROOT}/lib64/pugixml-1.9 + ${PC_PUGIXML_LIBDIR} ) # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. @@ -80,6 +85,9 @@ if(PUGIXML_FOUND) message(STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}") message(STATUS "PugiXML library = ${PUGIXML_LIBRARY}") endif() + if(PC_PUGIXML_VERSION) + set(PUGIXML_VERSION ${PC_PUGIXML_VERSION}) + endif() else() message(STATUS "PugiXML not found.") endif() diff --git a/cmake/Modules/FindVOLK.cmake b/cmake/Modules/FindVOLK.cmake index 26d236625..7f5497364 100644 --- a/cmake/Modules/FindVOLK.cmake +++ b/cmake/Modules/FindVOLK.cmake @@ -25,7 +25,7 @@ ######################################################################## include(FindPkgConfig) -pkg_check_modules(PC_VOLK volk) +pkg_check_modules(PC_VOLK volk QUIET) find_path(VOLK_INCLUDE_DIRS NAMES volk/volk.h @@ -78,6 +78,22 @@ find_library(VOLK_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) + +if(PC_VOLK_VERSION) + set(VOLK_VERSION ${PC_VOLK_VERSION}) +endif() + +if(NOT VOLK_VERSION) + list(GET VOLK_LIBRARIES 0 FIRST_DIR) + get_filename_component(VOLK_LIB_DIR ${FIRST_DIR} DIRECTORY) + if(EXISTS ${VOLK_LIB_DIR}/cmake/volk/VolkConfigVersion.cmake) + include(${VOLK_LIB_DIR}/cmake/volk/VolkConfigVersion.cmake) + endif() + if(PACKAGE_VERSION) + set(VOLK_VERSION ${PACKAGE_VERSION}) + endif() +endif() + mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION) if(VOLK_FOUND AND NOT TARGET Volk::volk)