Small fixes in CMake modules

This commit is contained in:
Carles Fernandez 2019-06-20 11:58:50 +02:00
parent 58f8db6080
commit 11ed0d3703
2 changed files with 4 additions and 11 deletions

View File

@ -48,18 +48,17 @@ find_path(GROSMOSDR_INCLUDE_DIR
osmosdr/source.h
osmosdr/api.h
PATHS
${GROSMOSDR_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
/opt/local/include
${GROSMOSDR_ROOT}/include
$ENV{GROSMOSDR_ROOT}/include
${GROSMOSDR_PKG_INCLUDEDIR}
)
find_library(GROSMOSDR_LIBRARIES
NAMES gnuradio-osmosdr
PATHS
${GROSMOSDR_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
/opt/local/lib
@ -91,6 +90,7 @@ find_library(GROSMOSDR_LIBRARIES
$ENV{GROSMOSDR_ROOT}/lib
${GROSMOSDR_ROOT}/lib64
$ENV{GROSMOSDR_ROOT}/lib64
${GROSMOSDR_PKG_LIBDIR}
)
include(FindPackageHandleStandardArgs)

View File

@ -111,13 +111,11 @@ 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)
@ -134,13 +132,8 @@ set(CMAKE_REQUIRED_LIBRARIES ${OLD_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()
if(PCAP_FOUND AND PC_PCAP_VERSION)
set(PCAP_VERSION ${PC_PCAP_VERSION})
endif()
if(PCAP_FOUND AND NOT TARGET Pcap::pcap)