-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cmake and compiler warnings (#29)
- Loading branch information
1 parent
e0358b5
commit 1be30c3
Showing
2 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,44 @@ | ||
INCLUDE(FindPkgConfig) | ||
PKG_CHECK_MODULES(PC_LIBAIRSPY libairspy) | ||
# - Try to find LibAIRSPY | ||
# Once done this will define | ||
# | ||
# LibAIRSPY_FOUND - System has libairspy | ||
# LibAIRSPY_INCLUDE_DIRS - The libairspy include directories | ||
# LibAIRSPY_LIBRARIES - The libraries needed to use libairspy | ||
# LibAIRSPY_DEFINITIONS - Compiler switches required for using libairspy | ||
# LibAIRSPY_VERSION - The librtlsdr version | ||
# | ||
|
||
FIND_PATH( | ||
LIBAIRSPY_INCLUDE_DIRS | ||
find_package(PkgConfig) | ||
pkg_check_modules(PC_LibAIRSPY libairspy) | ||
set(LibAIRSPY_DEFINITIONS ${PC_LibAIRSPY_CFLAGS_OTHER}) | ||
|
||
find_path( | ||
LibAIRSPY_INCLUDE_DIRS | ||
NAMES libairspy/airspy.h | ||
HINTS $ENV{LIBAIRSPY_DIR}/include | ||
${PC_LIBAIRSPY_INCLUDEDIR} | ||
HINTS $ENV{LibAIRSPY_DIR}/include | ||
${PC_LibAIRSPY_INCLUDEDIR} | ||
PATHS /usr/local/include | ||
/usr/include | ||
) | ||
|
||
FIND_LIBRARY( | ||
LIBAIRSPY_LIBRARIES | ||
find_library( | ||
LibAIRSPY_LIBRARIES | ||
NAMES airspy | ||
HINTS $ENV{LIBAIRSPY_DIR}/lib | ||
${PC_LIBAIRSPY_LIBDIR} | ||
HINTS $ENV{LibAIRSPY_DIR}/lib | ||
${PC_LibAIRSPY_LIBDIR} | ||
PATHS /usr/local/lib | ||
/usr/lib | ||
) | ||
|
||
INCLUDE(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBAIRSPY DEFAULT_MSG LIBAIRSPY_LIBRARIES LIBAIRSPY_INCLUDE_DIRS) | ||
MARK_AS_ADVANCED(LIBAIRSPY_LIBRARIES LIBAIRSPY_INCLUDE_DIRS) | ||
set(LibAIRSPY_VERSION ${PC_LibAIRSPY_VERSION}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set LibAIRSPY_FOUND to TRUE | ||
# if all listed variables are TRUE | ||
# Note that `FOUND_VAR LibAIRSPY_FOUND` is needed for cmake 3.2 and older. | ||
find_package_handle_standard_args(LibAIRSPY | ||
FOUND_VAR LibAIRSPY_FOUND | ||
REQUIRED_VARS LibAIRSPY_LIBRARIES LibAIRSPY_INCLUDE_DIRS | ||
VERSION_VAR LibAIRSPY_VERSION) | ||
|
||
mark_as_advanced(LibAIRSPY_LIBRARIES LibAIRSPY_INCLUDE_DIRS) |