From 961f8cee1f84dd2e179d61b83fb03c1f9f224ea7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 1 Dec 2018 19:09:44 +0100 Subject: [PATCH] =?UTF-8?q?Offer=20a=20=5FROOT=C2=A0CMake=20a?= =?UTF-8?q?nd=C2=A0environment=20variable=20as=20a=20way=20to=20define=20a?= =?UTF-8?q?=20base=20path=20to=20find=20packages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake/Modules/FindGFLAGS.cmake | 77 +++++++++++++++------------ cmake/Modules/FindGFORTRAN.cmake | 2 + cmake/Modules/FindGLOG.cmake | 4 ++ cmake/Modules/FindGNSSSIMULATOR.cmake | 13 +++-- cmake/Modules/FindGNURADIO.cmake | 32 ++++++----- cmake/Modules/FindGPERFTOOLS.cmake | 28 ++++++++-- cmake/Modules/FindGPSTK.cmake | 17 ++++-- cmake/Modules/FindGRDBFCTTC.cmake | 6 +++ cmake/Modules/FindGRGN3S.cmake | 6 +++ cmake/Modules/FindGRIIO.cmake | 16 +++--- cmake/Modules/FindGROSMOSDR.cmake | 19 +++++-- cmake/Modules/FindLIBIIO.cmake | 6 +++ cmake/Modules/FindLIBOSMOSDR.cmake | 16 ++++-- cmake/Modules/FindLOG4CPP.cmake | 6 +++ cmake/Modules/FindMATIO.cmake | 18 ++++++- cmake/Modules/FindOPENBLAS.cmake | 27 ++++++---- cmake/Modules/FindORC.cmake | 61 ++++++++++++--------- cmake/Modules/FindPCAP.cmake | 19 +++++-- cmake/Modules/FindPUGIXML.cmake | 44 ++++++++------- cmake/Modules/FindTELEORBIT.cmake | 16 +++--- cmake/Modules/FindUHD.cmake | 16 +++--- cmake/Modules/FindVOLK.cmake | 12 +++-- cmake/Modules/FindVOLKGNSSSDR.cmake | 16 +++--- 23 files changed, 319 insertions(+), 158 deletions(-) diff --git a/cmake/Modules/FindGFLAGS.cmake b/cmake/Modules/FindGFLAGS.cmake index 76a832ca5..31739e216 100644 --- a/cmake/Modules/FindGFLAGS.cmake +++ b/cmake/Modules/FindGFLAGS.cmake @@ -17,8 +17,9 @@ # - Try to find GFlags # -# The following variables are optionally searched for defaults -# GFlags_ROOT_DIR: Base directory where all GFlags components are found +# The following CMake and environment variables are optionally searched +# for defaults: +# GFLAGS_ROOT: Base directory where all GFlags components are found # # The following are set after configuration is done: # GFlags_FOUND @@ -30,39 +31,45 @@ if(APPLE) find_path(GFlags_ROOT_DIR libgflags.dylib PATHS - /opt/local/lib - /usr/local/lib + /opt/local/lib + /usr/local/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib ) else() find_path(GFlags_ROOT_DIR libgflags.so HINTS - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/powerpc-linux-gnuspe - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib/i386-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/x86_64-kfreebsd-gnu - /usr/lib/i386-kfreebsd-gnu - /usr/lib/m68k-linux-gnu - /usr/lib/sh4-linux-gnu - /usr/lib/sparc64-linux-gnu - /usr/lib/x86_64-linux-gnux32 - /usr/lib/alpha-linux-gnu - /usr/lib64 - /usr/lib + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib + ${GFLAGS_ROOT}/lib64 + $ENV{GFLAGS_ROOT}/lib64 ) endif() @@ -71,10 +78,12 @@ if(GFlags_ROOT_DIR) find_path(GFlags_INCLUDE_DIRS gflags/gflags.h HINTS - /opt/local/include - /usr/local/include - /usr/include - ${GFlags_ROOT_DIR}/src + /opt/local/include + /usr/local/include + /usr/include + ${GFlags_ROOT_DIR}/src + ${GFLAGS_ROOT}/include + $ENV{GFLAGS_ROOT}/include ) # Find the libraries diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index f3299fefb..f19ccd77a 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -142,6 +142,8 @@ find_library(GFORTRAN NAMES gfortran /usr/lib/gcc/powerpc64le-linux-gnu/8 /usr/lib/gcc/s390x-linux-gnu/8 /usr/lib/gcc/alpha-linux-gnu/8 + ${GFORTRAN_ROOT}/lib + $ENV{GFORTRAN_ROOT}/lib ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 50231f585..2d8f154f3 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -68,6 +68,10 @@ macro(_FIND_GLOG_LIBRARIES _var) /usr/lib/alpha-linux-gnu /usr/lib64 /usr/lib + ${GLOG_ROOT}/lib + $ENV{GLOG_ROOT}/lib + ${GLOG_ROOT}/lib64 + $ENV{GLOG_ROOT}/lib64 PATH_SUFFIXES lib ) mark_as_advanced(${_var}) diff --git a/cmake/Modules/FindGNSSSIMULATOR.cmake b/cmake/Modules/FindGNSSSIMULATOR.cmake index 5d4294548..66aa9176a 100644 --- a/cmake/Modules/FindGNSSSIMULATOR.cmake +++ b/cmake/Modules/FindGNSSSIMULATOR.cmake @@ -17,11 +17,14 @@ find_program(SW_GENERATOR_BIN gnss_sim PATHS /usr/bin - /usr/local/bin - /opt/local/bin - ${CMAKE_INSTALL_PREFIX}/bin - PATH_SUFFIXES bin) + /usr/local/bin + /opt/local/bin + ${CMAKE_INSTALL_PREFIX}/bin + ${GNSSSIMULATOR_ROOT}/bin + $ENV{GNSSSIMULATOR_ROOT}/bin + PATH_SUFFIXES bin +) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) +find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) mark_as_advanced(SW_GENERATOR_BIN) diff --git a/cmake/Modules/FindGNURADIO.cmake b/cmake/Modules/FindGNURADIO.cmake index c6811ba7f..7f5deb3ab 100644 --- a/cmake/Modules/FindGNURADIO.cmake +++ b/cmake/Modules/FindGNURADIO.cmake @@ -65,29 +65,29 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR}) # look for include files - find_path( - ${INCVAR_NAME} + find_path(${INCVAR_NAME} NAMES ${INCFILE} HINTS $ENV{GNURADIO_RUNTIME_DIR}/include - ${PC_INCDIR} - ${CMAKE_INSTALL_PREFIX}/include - ${GNURADIO_INSTALL_PREFIX}/include + ${PC_INCDIR} + ${CMAKE_INSTALL_PREFIX}/include + ${GNURADIO_INSTALL_PREFIX}/include PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include ) # look for libs foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES}) - find_library( - ${LIBVAR_NAME}_${libname} + find_library(${LIBVAR_NAME}_${libname} NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION} HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib - ${PC_LIBDIR} - ${CMAKE_INSTALL_PREFIX}/lib/ - ${CMAKE_INSTALL_PREFIX}/lib64/ - ${GNURADIO_INSTALL_PREFIX}/lib/ - ${GNURADIO_INSTALL_PREFIX}/lib64 + ${PC_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + ${GNURADIO_INSTALL_PREFIX}/lib + ${GNURADIO_INSTALL_PREFIX}/lib64 PATHS /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu @@ -115,6 +115,10 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) /usr/lib64 /usr/lib ${GNURADIO_INSTALL_PREFIX}/lib + ${GNURADIO_ROOT}/lib + $ENV{GNURADIO_ROOT}/lib + ${GNURADIO_ROOT}/lib64 + $ENV{GNURADIO_ROOT}/lib64 ) list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) endforeach() @@ -174,6 +178,8 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION) PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include ) if(GNURADIO_VERSION_GREATER_THAN_373) set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+") @@ -187,6 +193,8 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION) PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include ) if(GNURADIO_VERSION_GREATER_THAN_38) set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+") diff --git a/cmake/Modules/FindGPERFTOOLS.cmake b/cmake/Modules/FindGPERFTOOLS.cmake index 3278caf92..67dfff8af 100644 --- a/cmake/Modules/FindGPERFTOOLS.cmake +++ b/cmake/Modules/FindGPERFTOOLS.cmake @@ -24,7 +24,7 @@ # Variables used by this module, they can change the default behaviour and need # to be set before calling find_package: # -# Gperftools_ROOT_DIR Set this variable to the root installation of +# GPERFTOOLS_ROOT Set this variable to the root installation of # Gperftools if the module has problems finding # the proper installation path. # @@ -36,19 +36,37 @@ find_library(GPERFTOOLS_TCMALLOC NAMES tcmalloc - HINTS ${Gperftools_ROOT_DIR}/lib) + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) find_library(GPERFTOOLS_PROFILER NAMES profiler - HINTS ${Gperftools_ROOT_DIR}/lib) + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER NAMES tcmalloc_and_profiler - HINTS ${Gperftools_ROOT_DIR}/lib) + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h - HINTS ${Gperftools_ROOT_DIR}/include) + HINTS ${Gperftools_ROOT_DIR}/include + ${GPERFTOOLS_ROOT}/include + $ENV{GPERFTOOLS_ROOT}/include +) set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index c3270a6eb..f5ecb667e 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -24,14 +24,23 @@ find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp HINTS /usr/include - /usr/local/include - /opt/local/include) + /usr/local/include + /opt/local/include + ${GPSTK_ROOT}/include + $ENV{GPSTK_ROOT}/include +) set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) + find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} HINTS /usr/lib - /usr/local/lib - /opt/local/lib) + /usr/local/lib + /opt/local/lib + ${GPSTK_ROOT}/lib + $ENV{GPSTK_ROOT}/lib + ${GPSTK_ROOT}/lib64 + $ENV{GPSTK_ROOT}/lib64 +) # handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if # all listed variables are TRUE diff --git a/cmake/Modules/FindGRDBFCTTC.cmake b/cmake/Modules/FindGRDBFCTTC.cmake index 4b99f3702..e0689aeaf 100644 --- a/cmake/Modules/FindGRDBFCTTC.cmake +++ b/cmake/Modules/FindGRDBFCTTC.cmake @@ -30,6 +30,8 @@ find_path( PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/include /usr/local/include + ${GRDBFCTTC_ROOT}/include + $ENV{GRDBFCTTC_ROOT}/include ) find_library( @@ -43,6 +45,10 @@ find_library( /usr/lib64 /usr/local/lib /usr/local/lib64 + ${GRDBFCTTC_ROOT}/lib + $ENV{GRDBFCTTC_ROOT}/lib + ${GRDBFCTTC_ROOT}/lib64 + $ENV{GRDBFCTTC_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGRGN3S.cmake b/cmake/Modules/FindGRGN3S.cmake index 119a75eed..93f7bda89 100644 --- a/cmake/Modules/FindGRGN3S.cmake +++ b/cmake/Modules/FindGRGN3S.cmake @@ -30,6 +30,8 @@ find_path( PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /usr/include + ${GRGN3S_ROOT}/include + $ENV{GRGN3S_ROOT}/include ) find_library( @@ -43,6 +45,10 @@ find_library( /usr/local/lib64 /usr/lib /usr/lib64 + ${GRGN3S_ROOT}/lib + $ENV{GRGN3S_ROOT}/lib + ${GRGN3S_ROOT}/lib64 + $ENV{GRGN3S_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGRIIO.cmake b/cmake/Modules/FindGRIIO.cmake index 5575e3122..6d341e7fd 100644 --- a/cmake/Modules/FindGRIIO.cmake +++ b/cmake/Modules/FindGRIIO.cmake @@ -18,21 +18,21 @@ include(FindPkgConfig) pkg_check_modules(PC_IIO gnuradio-iio) -find_path( - IIO_INCLUDE_DIRS +find_path(IIO_INCLUDE_DIRS NAMES gnuradio/iio/api.h HINTS $ENV{IIO_DIR}/include - ${PC_IIO_INCLUDEDIR} + ${PC_IIO_INCLUDEDIR} PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /usr/include + ${GRIIO_ROOT}/include + $ENV{GRIIO_ROOT}/include ) -find_library( - IIO_LIBRARIES +find_library(IIO_LIBRARIES NAMES gnuradio-iio HINTS $ENV{IIO_DIR}/lib - ${PC_IIO_LIBDIR} + ${PC_IIO_LIBDIR} PATHS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64 /usr/local/lib @@ -61,6 +61,10 @@ find_library( /usr/lib/sparc64-linux-gnu /usr/lib/x86_64-linux-gnux32 /usr/lib/sh4-linux-gnu + ${GRIIO_ROOT}/lib + $ENV{GRIIO_ROOT}/lib + ${GRIIO_ROOT}/lib64 + $ENV{GRIIO_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindGROSMOSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake index e78541806..48379ed76 100644 --- a/cmake/Modules/FindGROSMOSDR.cmake +++ b/cmake/Modules/FindGROSMOSDR.cmake @@ -34,14 +34,20 @@ # GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) # GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers +include(FindPkgConfig) pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) + find_path(GROSMOSDR_INCLUDE_DIR - NAMES osmosdr/source.h + NAMES + osmosdr/source.h osmosdr/api.h PATHS - ${GROSMOSDR_PKG_INCLUDE_DIRS} - /usr/include - /usr/local/include + ${GROSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + /opt/local/include + ${GROSMOSDR_ROOT}/include + $ENV{GROSMOSDR_ROOT}/include ) find_library(GROSMOSDR_LIBRARIES @@ -50,6 +56,7 @@ find_library(GROSMOSDR_LIBRARIES ${GROSMOSDR_PKG_LIBRARY_DIRS} /usr/lib /usr/local/lib + /opt/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu /usr/lib/arm-linux-gnueabihf @@ -74,6 +81,10 @@ find_library(GROSMOSDR_LIBRARIES /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu /usr/lib64 + ${GROSMOSDR_ROOT}/lib + $ENV{GROSMOSDR_ROOT}/lib + ${GROSMOSDR_ROOT}/lib64 + $ENV{GROSMOSDR_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindLIBIIO.cmake b/cmake/Modules/FindLIBIIO.cmake index f8b6d10b9..a76180ca2 100644 --- a/cmake/Modules/FindLIBIIO.cmake +++ b/cmake/Modules/FindLIBIIO.cmake @@ -27,6 +27,8 @@ find_path( /usr/local/include /usr/include /opt/local/include + ${LIBIIO_ROOT}/include + $ENV{LIBIIO_ROOT}/include ) find_library( @@ -63,6 +65,10 @@ find_library( /usr/lib/x86_64-linux-gnux32 /usr/lib/sh4-linux-gnu /Library/Frameworks/iio.framework/ + ${LIBIIO_ROOT}/lib + $ENV{LIBIIO_ROOT}/lib + ${LIBIIO_ROOT}/lib64 + $ENV{LIBIIO_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake index 72f459e72..1e3aaf5e0 100644 --- a/cmake/Modules/FindLIBOSMOSDR.cmake +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -28,12 +28,16 @@ # LIBOSMOSDR_LIBRARIES The libosmosdr libraries # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers +include(FindPkgConfig) pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) + find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h PATHS - ${LIBOSMOSDR_PKG_INCLUDE_DIRS} - /usr/include - /usr/local/include + ${LIBOSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + ${LIBOSMOSDR_ROOT}/include + $ENV{LIBOSMOSDR_ROOT}/include ) find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr @@ -65,7 +69,11 @@ find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu /usr/lib64 - ) + ${LIBOSMOSDR_ROOT}/lib + $ENV{LIBOSMOSDR_ROOT}/lib + ${LIBOSMOSDR_ROOT}/lib64 + $ENV{LIBOSMOSDR_ROOT}/lib64 +) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) diff --git a/cmake/Modules/FindLOG4CPP.cmake b/cmake/Modules/FindLOG4CPP.cmake index b14ac009a..283c3ddf9 100644 --- a/cmake/Modules/FindLOG4CPP.cmake +++ b/cmake/Modules/FindLOG4CPP.cmake @@ -32,6 +32,8 @@ find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh /opt/local/include /usr/local/include /usr/include + ${LOG4CPP_ROOT}/include + $ENV{LOG4CPP_ROOT}/include ) set(LOG4CPP_NAMES log4cpp) @@ -68,6 +70,10 @@ find_library(LOG4CPP_LIBRARY /usr/lib /usr/local/lib /opt/local/lib + ${LOG4CPP_ROOT}/lib + $ENV{LOG4CPP_ROOT}/lib + ${LOG4CPP_ROOT}/lib64 + $ENV{LOG4CPP_ROOT}/lib64 ) if(LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake index e9d66c65b..08facf069 100644 --- a/cmake/Modules/FindMATIO.cmake +++ b/cmake/Modules/FindMATIO.cmake @@ -60,10 +60,24 @@ # # Look for the header file. -find_path(MATIO_INCLUDE_DIR NAMES matio.h DOC "The MATIO include directory") +find_path(MATIO_INCLUDE_DIR + NAMES matio.h + HINTS + ${MATIO_ROOT}/include + $ENV{MATIO_ROOT}/include + DOC "The MATIO include directory" +) # Look for the library. -find_library(MATIO_LIBRARY NAMES matio DOC "The MATIO library") +find_library(MATIO_LIBRARY + NAMES matio + HINTS + ${MATIO_ROOT}/lib + $ENV{MATIO_ROOT}/lib + ${MATIO_ROOT}/lib64 + $ENV{MATIO_ROOT}/lib64 + DOC "The MATIO library" +) if(MATIO_INCLUDE_DIR) # --------------------------------------------------- diff --git a/cmake/Modules/FindOPENBLAS.cmake b/cmake/Modules/FindOPENBLAS.cmake index 0704a9681..8ff70d65f 100644 --- a/cmake/Modules/FindOPENBLAS.cmake +++ b/cmake/Modules/FindOPENBLAS.cmake @@ -20,17 +20,22 @@ # The following environment variable is optionally searched # OPENBLAS_HOME: Base directory where all OpenBlas components are found -set(OPEN_BLAS_SEARCH_PATHS /lib/ - /lib64/ - /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - /opt/OpenBLAS/lib - /opt/local/lib - /usr/lib/openblas-base - $ENV{OPENBLAS_HOME}/lib - ) +set(OPEN_BLAS_SEARCH_PATHS + /lib + /lib64/ + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/OpenBLAS/lib + /opt/local/lib + /usr/lib/openblas-base + $ENV{OPENBLAS_HOME}/lib + ${OPENBLAS_ROOT}/lib + $ENV{OPENBLAS_ROOT}/lib + ${OPENBLAS_ROOT}/lib64 + $ENV{OPENBLAS_ROOT}/lib64 +) find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) diff --git a/cmake/Modules/FindORC.cmake b/cmake/Modules/FindORC.cmake index 7bd013e67..fea12b98f 100644 --- a/cmake/Modules/FindORC.cmake +++ b/cmake/Modules/FindORC.cmake @@ -20,41 +20,50 @@ pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") find_program(ORCC_EXECUTABLE orcc HINTS ${PC_ORC_TOOLSDIR} - PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) + PATHS ${ORC_ROOT}/bin + ${CMAKE_INSTALL_PREFIX}/bin +) -find_path(ORC_INCLUDE_DIR NAMES orc/orc.h +find_path(ORC_INCLUDE_DIR + NAMES orc/orc.h HINTS ${PC_ORC_INCLUDEDIR} - PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) + PATHS ${ORC_ROOT}/include/orc-0.4 + ${CMAKE_INSTALL_PREFIX}/include/orc-0.4 +) - -find_path(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} +find_path(ORC_LIBRARY_DIR + NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} HINTS ${PC_ORC_LIBDIR} - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib64 - /usr/lib - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib64 + /usr/lib + ${ORC_ROOT}/lib + $ENV{ORC_ROOT}/lib + PATHS + ${ORC_ROOT}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} +) find_library(ORC_LIB orc-0.4 HINTS ${PC_ORC_LIBRARY_DIRS} - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) - -list(APPEND ORC_LIBRARY - ${ORC_LIB} + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} ) +list(APPEND ORC_LIBRARY ${ORC_LIB}) set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) set(ORC_LIBRARIES ${ORC_LIBRARY}) diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index d91524ff4..af746c852 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -48,10 +48,12 @@ if(EXISTS $ENV{PCAPDIR}) find_path(PCAP_INCLUDE_DIR NAMES - pcap/pcap.h - pcap.h + pcap/pcap.h + pcap.h PATHS $ENV{PCAPDIR} + ${PCAP_ROOT}/include + $ENV{PCAP_ROOT}/include NO_DEFAULT_PATH ) find_library(PCAP_LIBRARY @@ -59,18 +61,25 @@ if(EXISTS $ENV{PCAPDIR}) pcap PATHS $ENV{PCAPDIR} + ${PCAP_ROOT}/lib + $ENV{PCAP_ROOT}/lib NO_DEFAULT_PATH ) else() find_path(PCAP_INCLUDE_DIR NAMES - pcap/pcap.h - pcap.h + pcap/pcap.h + pcap.h + HINTS + ${PCAP_ROOT}/include + $ENV{PCAP_ROOT}/include ) - find_library(PCAP_LIBRARY NAMES pcap + HINTS + ${PCAP_ROOT}/lib + $ENV{PCAP_ROOT}/lib ) endif() diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake index da7de4188..236a4c95a 100644 --- a/cmake/Modules/FindPUGIXML.cmake +++ b/cmake/Modules/FindPUGIXML.cmake @@ -26,28 +26,36 @@ find_path(PUGIXML_INCLUDE_DIR NAMES pugixml.hpp PATHS ${PUGIXML_HOME}/include - /usr/include - /usr/local/include - /opt/local/include) + /usr/include + /usr/local/include + /opt/local/include + ${PUGIXML_ROOT}/include + $ENV{PUGIXML_ROOT}/include +) find_library(PUGIXML_LIBRARY NAMES pugixml PATHS ${PUGIXML_HOME}/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/aarch64-linux-gnu - /usr/lib/arm-linux-gnueabi - /usr/lib/arm-linux-gnueabihf - /usr/lib/i386-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/mipsel-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/local/lib - /opt/local/lib - /usr/lib - /usr/lib64 - /usr/local/lib64) + /usr/lib/x86_64-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/i386-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/local/lib + /opt/local/lib + /usr/lib + /usr/lib64 + /usr/local/lib64 + ${PUGIXML_ROOT}/lib + $ENV{PUGIXML_ROOT}/lib + ${PUGIXML_ROOT}/lib64 + $ENV{PUGIXML_ROOT}/lib64 +) # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindTELEORBIT.cmake b/cmake/Modules/FindTELEORBIT.cmake index 0f78ed339..eb2420687 100644 --- a/cmake/Modules/FindTELEORBIT.cmake +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -18,27 +18,31 @@ include(FindPkgConfig) pkg_check_modules(PC_TELEORBIT teleorbit) -find_path( - TELEORBIT_INCLUDE_DIRS +find_path(TELEORBIT_INCLUDE_DIRS NAMES teleorbit/api.h HINTS $ENV{TELEORBIT_DIR}/include - ${PC_TELEORBIT_INCLUDEDIR} + ${PC_TELEORBIT_INCLUDEDIR} PATHS ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /usr/include + ${TELEORBIT_ROOT}/include + $ENV{TELEORBIT_ROOT}/include ) -find_library( - TELEORBIT_LIBRARIES +find_library(TELEORBIT_LIBRARIES NAMES gnuradio-teleorbit HINTS $ENV{TELEORBIT_DIR}/lib - ${PC_TELEORBIT_LIBDIR} + ${PC_TELEORBIT_LIBDIR} PATHS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64 /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 + ${TELEORBIT_ROOT}/lib + $ENV{TELEORBIT_ROOT}/lib + ${TELEORBIT_ROOT}/lib64 + $ENV{TELEORBIT_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake index fc12a9cdd..31d299937 100644 --- a/cmake/Modules/FindUHD.cmake +++ b/cmake/Modules/FindUHD.cmake @@ -22,21 +22,21 @@ include(FindPkgConfig) pkg_check_modules(PC_UHD uhd) -find_path( - UHD_INCLUDE_DIRS +find_path(UHD_INCLUDE_DIRS NAMES uhd/config.hpp HINTS $ENV{UHD_DIR}/include - ${PC_UHD_INCLUDEDIR} + ${PC_UHD_INCLUDEDIR} PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${UHD_ROOT}/include + $ENV{UHD_ROOT}/include ) -find_library( - UHD_LIBRARIES +find_library(UHD_LIBRARIES NAMES uhd HINTS $ENV{UHD_DIR}/lib - ${PC_UHD_LIBDIR} + ${PC_UHD_LIBDIR} PATHS /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu @@ -64,6 +64,10 @@ find_library( /usr/lib64 /usr/lib ${GNURADIO_INSTALL_PREFIX}/lib + ${UHD_ROOT}/lib + $ENV{UHD_ROOT}/lib + ${UHD_ROOT}/lib64 + $ENV{UHD_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindVOLK.cmake b/cmake/Modules/FindVOLK.cmake index d491c08b0..97191179c 100644 --- a/cmake/Modules/FindVOLK.cmake +++ b/cmake/Modules/FindVOLK.cmake @@ -22,18 +22,18 @@ include(FindPkgConfig) pkg_check_modules(PC_VOLK volk) -find_path( - VOLK_INCLUDE_DIRS +find_path(VOLK_INCLUDE_DIRS NAMES volk/volk.h HINTS $ENV{VOLK_DIR}/include ${PC_VOLK_INCLUDEDIR} PATHS /usr/local/include /usr/include ${CMAKE_INSTALL_PREFIX}/include + ${VOLK_ROOT}/include + $ENV{VOLK_ROOT}/include ) -find_library( - VOLK_LIBRARIES +find_library(VOLK_LIBRARIES NAMES volk HINTS $ENV{VOLK_DIR}/lib ${PC_VOLK_LIBDIR} @@ -65,6 +65,10 @@ find_library( /usr/lib/alpha-linux-gnu /usr/lib64 ${CMAKE_INSTALL_PREFIX}/lib + ${VOLK_ROOT}/lib + $ENV{VOLK_ROOT}/lib + ${VOLK_ROOT}/lib64 + $ENV{VOLK_ROOT}/lib64 ) include(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/FindVOLKGNSSSDR.cmake b/cmake/Modules/FindVOLKGNSSSDR.cmake index cd5cac918..5cdc4e61d 100644 --- a/cmake/Modules/FindVOLKGNSSSDR.cmake +++ b/cmake/Modules/FindVOLKGNSSSDR.cmake @@ -22,26 +22,30 @@ include(FindPkgConfig) pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) -find_path( - VOLK_GNSSSDR_INCLUDE_DIRS +find_path(VOLK_GNSSSDR_INCLUDE_DIRS NAMES volk_gnsssdr/volk_gnsssdr.h HINTS $ENV{VOLK_GNSSSDR_DIR}/include - ${PC_VOLK_GNSSSDR_INCLUDEDIR} + ${PC_VOLK_GNSSSDR_INCLUDEDIR} PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${VOLKGNSSSDR_ROOT}/include + $ENV{VOLKGNSSSDR_ROOT}/include ) -find_library( - VOLK_GNSSSDR_LIBRARIES +find_library(VOLK_GNSSSDR_LIBRARIES NAMES volk_gnsssdr HINTS $ENV{VOLK_GNSSSDR_DIR}/lib - ${PC_VOLK_GNSSSDR_LIBDIR} + ${PC_VOLK_GNSSSDR_LIBDIR} PATHS /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 ${GNURADIO_INSTALL_PREFIX}/lib + ${VOLKGNSSSDR_ROOT}/lib + $ENV{VOLKGNSSSDR_ROOT}/lib + ${VOLKGNSSSDR_ROOT}/lib64 + $ENV{VOLKGNSSSDR_ROOT}/lib64 ) include(FindPackageHandleStandardArgs)