mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-02-15 02:20:09 +00:00
Improving cmake FindGrOsmoSDR module to support user-mode gnuradio installations
This commit is contained in:
parent
85012b3d74
commit
5812a66fbf
@ -17,35 +17,33 @@
|
||||
# GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr)
|
||||
# GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers
|
||||
|
||||
|
||||
|
||||
FIND_PATH(GROSMOSDR_INCLUDE_DIR
|
||||
NAMES osmosdr/source.h
|
||||
osmosdr/api.h
|
||||
HINTS ${GrOsmoSDR_ROOT_DIR}/include
|
||||
PATHS /usr/local/include
|
||||
/usr/include
|
||||
)
|
||||
|
||||
|
||||
find_library(GROSMOSDR_LIBRARIES
|
||||
NAMES gnuradio-osmosdr
|
||||
HINTS ${GrOsmoSDR_ROOT_DIR}/lib
|
||||
PATHS /usr/local/lib
|
||||
/usr/lib
|
||||
if(NOT GROSMOSDR_FOUND)
|
||||
pkg_check_modules (GROSMOSDR_PKG gnuradio-osmosdr)
|
||||
find_path(GROSMOSDR_INCLUDE_DIR
|
||||
NAMES osmosdr/source.h
|
||||
osmosdr/api.h
|
||||
PATHS
|
||||
${GROSMOSDR_PKG_INCLUDE_DIRS}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
)
|
||||
|
||||
find_library(GROSMOSDR_LIBRARIES
|
||||
NAMES gnuradio-osmosdr
|
||||
PATHS
|
||||
${GROSMOSDR_PKG_LIBRARY_DIRS}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
GrOsmoSDR
|
||||
DEFAULT_MSG
|
||||
GROSMOSDR_LIBRARIES
|
||||
GROSMOSDR_INCLUDE_DIR
|
||||
)
|
||||
if(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES)
|
||||
set(GROSMOSDR_FOUND TRUE CACHE INTERNAL "gnuradio-osmosdr found")
|
||||
message(STATUS "Found gnuradio-osmosdr: ${GROSMOSDR_INCLUDE_DIR}, ${GROSMOSDR_LIBRARIES}")
|
||||
else(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES)
|
||||
set(GROSMOSDR_FOUND FALSE CACHE INTERNAL "gnuradio-osmosdr found")
|
||||
message(STATUS "gnuradio-osmosdr not found.")
|
||||
endif(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES)
|
||||
|
||||
mark_as_advanced(
|
||||
GrOsmoSDR_ROOT_DIR
|
||||
GROSMOSDR_LIBRARIES
|
||||
GROSMOSDR_INCLUDE_DIR
|
||||
)
|
||||
mark_as_advanced(GROSMOSDR_INCLUDE_DIR GROSMOSDR_LIBRARIES)
|
||||
|
||||
endif(NOT GROSMOSDR_FOUND)
|
||||
|
Loading…
x
Reference in New Issue
Block a user