From c30975064e3a4d2c52edf55a314ce08c4a2f8adc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 19 Jun 2019 20:54:45 +0200 Subject: [PATCH 1/4] Get GPSTK version if found This can be important in the future since current version is a c++17 blocker --- cmake/Modules/FindGPSTK.cmake | 13 ++++++++++++- src/tests/CMakeLists.txt | 11 ++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index 1959c3ff6..b0024f333 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -44,10 +44,21 @@ find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} $ENV{GPSTK_ROOT}/${CMAKE_INSTALL_LIBDIR} ) -# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if +# handle the QUIET and REQUIRED arguments and set GPSTK_FOUND to TRUE if # all listed variables are TRUE include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) + +if(GPSTK_FOUND) + if(EXISTS ${CMAKE_INSTALL_FULL_DATADIR}/cmake/GPSTK/GPSTKConfigVersion.cmake) + include(${CMAKE_INSTALL_FULL_DATADIR}/cmake/GPSTK/GPSTKConfigVersion.cmake) + endif() + if(PACKAGE_VERSION) + set(GPSTK_VERSION ${PACKAGE_VERSION}) + endif() + unset(PACKAGE_VERSION) +endif() + mark_as_advanced(GPSTK_LIBRARY GPSTK_INCLUDE_DIR) if(GPSTK_FOUND AND NOT TARGET Gpstk::gpstk) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 12f65f0fd..3cb9382e3 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -191,10 +191,19 @@ add_feature_info(ENABLE_GNSS_SIM_INSTALL ENABLE_GNSS_SIM_INSTALL "Enables downlo find_package(GPSTK) set_package_properties(GPSTK PROPERTIES URL "http://www.gpstk.org" - DESCRIPTION "Library and suite of applications for satellite navigation" PURPOSE "Used in some Extra Tests." TYPE OPTIONAL ) +if(GPSTK_FOUND AND GPSTK_VERSION) + set_package_properties(GPSTK PROPERTIES + DESCRIPTION "Library and suite of applications for satellite navigation (found: v${GPSTK_VERSION})" + ) +else() + set_package_properties(GPSTK PROPERTIES + DESCRIPTION "Library and suite of applications for satellite navigation" + ) +endif() + if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) if(ENABLE_FPGA) set(CROSS_INSTALL_DIR "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") From 434f7d78307b2937ef1ac168b98f5b15a027f535 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 19 Jun 2019 21:01:36 +0200 Subject: [PATCH 2/4] Tell pkg-config to add more paths to its search Setting PKG_CONFIG_USE_CMAKE_PREFIX_PATH to TRUE. If this variable is not set, this behavior is enabled by default if CMAKE_MINIMUM_REQUIRED_VERSION is 3.1 or later, disabled otherwise. Since our minimum requirement is 2.8.12, we activate it manually. See https://cmake.org/cmake/help/latest/module/FindPkgConfig.html --- cmake/Modules/FindGLOG.cmake | 1 + cmake/Modules/FindGNURADIO.cmake | 1 + cmake/Modules/FindGRDBFCTTC.cmake | 1 + cmake/Modules/FindGRGN3S.cmake | 1 + cmake/Modules/FindGRIIO.cmake | 2 +- cmake/Modules/FindGROSMOSDR.cmake | 1 + cmake/Modules/FindLIBIIO.cmake | 1 + cmake/Modules/FindLIBOSMOSDR.cmake | 1 + cmake/Modules/FindPUGIXML.cmake | 1 + cmake/Modules/FindTELEORBIT.cmake | 1 + cmake/Modules/FindUHD.cmake | 1 + cmake/Modules/FindVOLK.cmake | 1 + cmake/Modules/FindVOLKGNSSSDR.cmake | 1 + 13 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 2ac5ab7fb..c702d4a04 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -41,6 +41,7 @@ else() set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib) endif() +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(PC_GLOG libglog) diff --git a/cmake/Modules/FindGNURADIO.cmake b/cmake/Modules/FindGNURADIO.cmake index 39bc0fcd2..1ed44391f 100644 --- a/cmake/Modules/FindGNURADIO.cmake +++ b/cmake/Modules/FindGNURADIO.cmake @@ -19,6 +19,7 @@ # Find GNU Radio ######################################################################## +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGRDBFCTTC.cmake b/cmake/Modules/FindGRDBFCTTC.cmake index 64c838af1..81cd9869b 100644 --- a/cmake/Modules/FindGRDBFCTTC.cmake +++ b/cmake/Modules/FindGRDBFCTTC.cmake @@ -19,6 +19,7 @@ # Find GR-DBFCTTC Module ######################################################################## +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(PC_GR_DBFCTTC gr-dbfcttc) diff --git a/cmake/Modules/FindGRGN3S.cmake b/cmake/Modules/FindGRGN3S.cmake index 4664a6edb..8b407544b 100644 --- a/cmake/Modules/FindGRGN3S.cmake +++ b/cmake/Modules/FindGRGN3S.cmake @@ -19,6 +19,7 @@ # Find GR-GN3S Module ######################################################################## +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(PC_GR_GN3S gr-gn3s) diff --git a/cmake/Modules/FindGRIIO.cmake b/cmake/Modules/FindGRIIO.cmake index 720313b15..1baf6fc6c 100644 --- a/cmake/Modules/FindGRIIO.cmake +++ b/cmake/Modules/FindGRIIO.cmake @@ -20,7 +20,7 @@ # Gnuradio::iio # - +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(PC_IIO gnuradio-iio) diff --git a/cmake/Modules/FindGROSMOSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake index e655a20d8..25a2763f2 100644 --- a/cmake/Modules/FindGROSMOSDR.cmake +++ b/cmake/Modules/FindGROSMOSDR.cmake @@ -39,6 +39,7 @@ # +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) diff --git a/cmake/Modules/FindLIBIIO.cmake b/cmake/Modules/FindLIBIIO.cmake index 4c94bb9dd..dddf7e750 100644 --- a/cmake/Modules/FindLIBIIO.cmake +++ b/cmake/Modules/FindLIBIIO.cmake @@ -20,6 +20,7 @@ # Iio::iio # +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(PC_LIBIIO libiio) diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake index 5db152d21..7ecf41a61 100644 --- a/cmake/Modules/FindLIBOSMOSDR.cmake +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -32,6 +32,7 @@ # Osmosdr::osmosdr # +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake index 2868b63bd..95c8d3273 100644 --- a/cmake/Modules/FindPUGIXML.cmake +++ b/cmake/Modules/FindPUGIXML.cmake @@ -27,6 +27,7 @@ # Pugixml::pugixml # +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(PC_PUGIXML pugixml QUIET) diff --git a/cmake/Modules/FindTELEORBIT.cmake b/cmake/Modules/FindTELEORBIT.cmake index bdb3d861c..a99cab845 100644 --- a/cmake/Modules/FindTELEORBIT.cmake +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -15,6 +15,7 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(PC_TELEORBIT teleorbit) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake index 286a1cacb..81e3879b9 100644 --- a/cmake/Modules/FindUHD.cmake +++ b/cmake/Modules/FindUHD.cmake @@ -23,6 +23,7 @@ ######################################################################## # Find the library for the USRP Hardware Driver ######################################################################## +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(PC_UHD uhd) diff --git a/cmake/Modules/FindVOLK.cmake b/cmake/Modules/FindVOLK.cmake index e788e509c..e04afd1ca 100644 --- a/cmake/Modules/FindVOLK.cmake +++ b/cmake/Modules/FindVOLK.cmake @@ -24,6 +24,7 @@ # Find VOLK (Vector-Optimized Library of Kernels) ######################################################################## +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(PC_VOLK volk QUIET) diff --git a/cmake/Modules/FindVOLKGNSSSDR.cmake b/cmake/Modules/FindVOLKGNSSSDR.cmake index 57abd1d99..7f0ab1ff3 100644 --- a/cmake/Modules/FindVOLKGNSSSDR.cmake +++ b/cmake/Modules/FindVOLKGNSSSDR.cmake @@ -25,6 +25,7 @@ # Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library ######################################################################## +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) include(FindPkgConfig) pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) From 34a949eb284cb041749113a5b373fa21d35ec042 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 19 Jun 2019 21:34:23 +0200 Subject: [PATCH 3/4] Enable RAW_UDP if PCAP is found Try to get PCAP version --- CMakeLists.txt | 13 ++++++++++++- cmake/Modules/FindPCAP.cmake | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba83d3762..38a4f6d62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2193,10 +2193,21 @@ endif() find_package(PCAP) set_package_properties(PCAP PROPERTIES URL "https://www.tcpdump.org" - DESCRIPTION "A portable C/C++ library for network traffic capture" PURPOSE "Used for the custom UDP IP packet source." TYPE OPTIONAL ) +if(PCAP_FOUND AND PCAP_VERSION) + set_package_properties(PCAP PROPERTIES + DESCRIPTION "A portable C/C++ library for network traffic capture (found: ${PCAP_VERSION})" + ) +else() + set_package_properties(PCAP PROPERTIES + DESCRIPTION "A portable C/C++ library for network traffic capture" + ) +endif() +if(PCAP_FOUND) + set(ENABLE_RAW_UDP ON) +endif() if(ENABLE_RAW_UDP) message(STATUS "High-optimized custom UDP IP packet source is enabled.") message(STATUS " You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ..'") diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index f6f806817..910f69fb6 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -48,6 +48,10 @@ # Pcap::pcap # +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) +include(FindPkgConfig) +pkg_check_modules(PC_PCAP libpcap) + if(EXISTS $ENV{PCAPDIR}) find_path(PCAP_INCLUDE_DIR NAMES @@ -57,6 +61,7 @@ if(EXISTS $ENV{PCAPDIR}) $ENV{PCAPDIR} ${PCAP_ROOT}/include $ENV{PCAP_ROOT}/include + ${PC_PCAP_INCLUDEDIR} NO_DEFAULT_PATH ) find_library(PCAP_LIBRARY @@ -66,6 +71,7 @@ if(EXISTS $ENV{PCAPDIR}) $ENV{PCAPDIR} ${PCAP_ROOT}/lib $ENV{PCAP_ROOT}/lib + ${PC_PCAP_LIBDIR} NO_DEFAULT_PATH ) else() @@ -76,6 +82,7 @@ else() HINTS ${PCAP_ROOT}/include $ENV{PCAP_ROOT}/include + ${PC_PCAP_INCLUDEDIR} ) find_library(PCAP_LIBRARY NAMES @@ -83,6 +90,7 @@ else() HINTS ${PCAP_ROOT}/lib $ENV{PCAP_ROOT}/lib + ${PC_PCAP_LIBDIR} ) endif() @@ -103,8 +111,13 @@ endif() #Functions include(CheckFunctionExists) +include(CheckVariableExists) + +set(OLD_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES}) +set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES}) +check_variable_exists("pcap_version" HAVE_PCAP_VERSION) check_function_exists("pcap_breakloop" HAVE_PCAP_BREAKLOOP) check_function_exists("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL) check_function_exists("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME) @@ -115,10 +128,21 @@ check_function_exists("pcap_lib_version" HAVE_PCAP_LIB_VERSION) check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) +set(CMAKE_REQUIRED_INCLUDES ${OLD_CMAKE_REQUIRED_INCLUDES}) +set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES) +if(${HAVE_PCAP_VERSION}) + set(PCAP_VERSION ${HAVE_PCAP_VERSION}) +endif() +if(NOT PCAP_VERSION) + if(PC_PCAP_VERSION) + set(PCAP_VERSION ${PC_PCAP_VERSION}) + endif() +endif() + if(PCAP_FOUND AND NOT TARGET Pcap::pcap) add_library(Pcap::pcap SHARED IMPORTED) set_target_properties(Pcap::pcap PROPERTIES From 25154ec0661014bfae721c21dee4f013676e795b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 19 Jun 2019 23:42:46 +0200 Subject: [PATCH 4/4] Add more package version identifications --- CMakeLists.txt | 54 +++++++++++++++++++++++++----- cmake/Modules/FindGOOGLETEST.cmake | 10 ++++++ cmake/Modules/FindORC.cmake | 7 +++- src/tests/CMakeLists.txt | 10 +++++- 4 files changed, 71 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38a4f6d62..7b8fe91e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -590,10 +590,18 @@ endif() find_package(GOOGLETEST) set_package_properties(GOOGLETEST PROPERTIES URL "https://github.com/google/googletest" - DESCRIPTION "Source code of Google's Testing Framework" PURPOSE "Used for Unit and System Tests." TYPE REQUIRED ) +if(GOOGLETEST_FOUND AND GOOGLETEST_VERSION) + set_package_properties(GOOGLETEST PROPERTIES + DESCRIPTION "Source code of Google's Testing Framework (found: ${GOOGLETEST_VERSION})" + ) +else() + set_package_properties(GOOGLETEST PROPERTIES + DESCRIPTION "Source code of Google's Testing Framework" + ) +endif() if(NOT GOOGLETEST_FOUND) set_package_properties(GOOGLETEST PROPERTIES PURPOSE "Googletest v${GNSSSDR_GTEST_LOCAL_VERSION} will be downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." @@ -1002,10 +1010,18 @@ if(NOT VOLKGNSSSDR_FOUND) find_package(ORC) set_package_properties(ORC PROPERTIES URL "https://gstreamer.freedesktop.org/modules/orc.html" - DESCRIPTION "The Optimized Inner Loops Runtime Compiler" PURPOSE "Used by volk_gnsssdr." TYPE OPTIONAL ) + if(ORC_FOUND AND ORC_VERSION) + set_package_properties(ORC PROPERTIES + DESCRIPTION "The Optimized Inner Loops Runtime Compiler (found: v${ORC_VERSION})" + ) + else() + set_package_properties(ORC PROPERTIES + DESCRIPTION "The Optimized Inner Loops Runtime Compiler" + ) + endif() if(NOT ORC_FOUND) set(ORC_LIBRARIES "") set(ORC_INCLUDE_DIRS "") @@ -1615,10 +1631,18 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS find_package(ZLIB) set_package_properties(ZLIB PROPERTIES URL "https://www.zlib.net/" - DESCRIPTION "A Massively Spiffy Yet Delicately Unobtrusive Compression Library" PURPOSE "Required to build Matio." TYPE REQUIRED ) + if(ZLIB_FOUND AND ZLIB_VERSION_STRING) + set_package_properties(ZLIB PROPERTIES + DESCRIPTION "A Massively Spiffy Yet Delicately Unobtrusive Compression Library (found: ${ZLIB_VERSION_STRING})" + ) + else() + set_package_properties(ZLIB PROPERTIES + DESCRIPTION "A Massively Spiffy Yet Delicately Unobtrusive Compression Library" + ) + endif() if(ZLIB_FOUND) get_filename_component(ZLIB_BASE_DIR ${ZLIB_INCLUDE_DIRS} DIRECTORY) if(OS_IS_LINUX) @@ -1658,10 +1682,18 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS find_package(HDF5) set_package_properties(HDF5 PROPERTIES URL "https://support.hdfgroup.org/HDF5/" - DESCRIPTION "A versatile data model, a portable file format and a software library" PURPOSE "Required to build Matio." TYPE REQUIRED ) + if(HDF5_FOUND AND HDF5_VERSION) + set_package_properties(HDF5 PROPERTIES + DESCRIPTION "A versatile data model, a portable file format and a software library (found: ${HDF5_VERSION})" + ) + else() + set_package_properties(HDF5 PROPERTIES + DESCRIPTION "A versatile data model, a portable file format and a software library" + ) + endif() if(HDF5_FOUND) list(GET HDF5_LIBRARIES 0 HDF5_FIRST_DIR) get_filename_component(HDF5_BASE_DIR2 ${HDF5_FIRST_DIR} DIRECTORY) @@ -2056,10 +2088,18 @@ endif() find_package(Doxygen) set_package_properties(Doxygen PROPERTIES URL "http://www.doxygen.nl" - DESCRIPTION "Generates documentation from annotated C++ sources" PURPOSE "Used to generate code documentation by doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'" TYPE OPTIONAL ) +if(DOXYGEN_FOUND AND DOXYGEN_VERSION) + set_package_properties(Doxygen PROPERTIES + DESCRIPTION "Generates documentation from annotated C++ sources (found: v${DOXYGEN_VERSION})" + ) +else() + set_package_properties(Doxygen PROPERTIES + DESCRIPTION "Generates documentation from annotated C++ sources" + ) +endif() find_package(LATEX) set_package_properties(LATEX PROPERTIES URL "https://www.latex-project.org" @@ -2205,9 +2245,7 @@ else() DESCRIPTION "A portable C/C++ library for network traffic capture" ) endif() -if(PCAP_FOUND) - set(ENABLE_RAW_UDP ON) -endif() + if(ENABLE_RAW_UDP) message(STATUS "High-optimized custom UDP IP packet source is enabled.") message(STATUS " You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ..'") diff --git a/cmake/Modules/FindGOOGLETEST.cmake b/cmake/Modules/FindGOOGLETEST.cmake index 4544f5127..462864449 100644 --- a/cmake/Modules/FindGOOGLETEST.cmake +++ b/cmake/Modules/FindGOOGLETEST.cmake @@ -26,6 +26,9 @@ # LIBGTEST_DEV_DIR # GTEST_INCLUDE_DIRS +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) +include(FindPkgConfig) +pkg_check_modules(PC_GTEST gtest) find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc @@ -33,6 +36,7 @@ find_path(LIBGTEST_DEV_DIR ${GTEST_DIR} ${GTEST_DIR}/googletest /usr/src/googletest/googletest + /usr/local/src/googletest/googletest /usr/src/gtest /usr/include/gtest /opt/local/src/gtest-1.7.0 @@ -44,8 +48,14 @@ find_path(GTEST_INCLUDE_DIRS ${GTEST_DIR}/googletest/include /usr/include /opt/local/src/gtest-1.7.0/include + ${PC_GTEST_INCLUDEDIR} ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GOOGLETEST DEFAULT_MSG LIBGTEST_DEV_DIR GTEST_INCLUDE_DIRS) + +if(GOOGLETEST_FOUND AND PC_GTEST_VERSION) + set(GOOGLETEST_VERSION ${PC_GTEST_VERSION}) +endif() + mark_as_advanced(LIBGTEST_DEV_DIR GTEST_INCLUDE_DIRS) diff --git a/cmake/Modules/FindORC.cmake b/cmake/Modules/FindORC.cmake index fea12b98f..e2b2ef4e8 100644 --- a/cmake/Modules/FindORC.cmake +++ b/cmake/Modules/FindORC.cmake @@ -15,7 +15,8 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -find_package(PkgConfig) +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) +include(FindPkgConfig) pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") find_program(ORCC_EXECUTABLE orcc @@ -63,6 +64,10 @@ find_library(ORC_LIB orc-0.4 ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} ) +if(PC_ORC_VERSION) + set(ORC_VERSION ${PC_ORC_VERSION}) +endif() + list(APPEND ORC_LIBRARY ${ORC_LIB}) set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 3cb9382e3..e03a45db8 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -172,10 +172,18 @@ if(GNUPLOT_FOUND) endif() set_package_properties(Gnuplot PROPERTIES URL "http://www.gnuplot.info" - DESCRIPTION "A portable command-line driven graphing utility" PURPOSE "Used to generate plots in some tests." TYPE OPTIONAL ) +if(GNUPLOT_FOUND AND GNUPLOT_VERSION_STRING) + set_package_properties(Gnuplot PROPERTIES + DESCRIPTION "A portable command-line driven graphing utility (found: v${GNUPLOT_VERSION_STRING})" + ) +else() + set_package_properties(Gnuplot PROPERTIES + DESCRIPTION "A portable command-line driven graphing utility" + ) +endif() if(ENABLE_UNIT_TESTING_MINIMAL) add_definitions(-DUNIT_TESTING_MINIMAL=1)