mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-08-27 13:57:56 -04:00
Modernize deprecated CMake usage and correct package-name mismatches reported by newer CMake versions. Replace exec_program() with execute_process(), use PkgConfig through find_package() while retaining fallback discovery, and align find_package_handle_standard_args() names with their corresponding find_package() calls. This removes most CMake developer warnings without changing the intended dependency discovery behavior. Signed-off-by: Robin Getz <rgetz503@gmail.com>
39 lines
1.1 KiB
CMake
39 lines
1.1 KiB
CMake
IF (NOT DAB_FOUND)
|
|
find_package(PkgConfig)
|
|
if(PkgConfig_FOUND)
|
|
PKG_CHECK_MODULES(LIBDAB_PKG libdab)
|
|
endif()
|
|
|
|
FIND_PATH(
|
|
DAB_INCLUDE_DIR
|
|
NAMES dab-api.h
|
|
HINTS ${DAB_DIR}/include/dab_lib
|
|
${LIBDAB_PKG_INCLUDE_DIRS}
|
|
PATHS /usr/include/dab_lib
|
|
/usr/local/include/dab_lib
|
|
)
|
|
|
|
FIND_LIBRARY(
|
|
DAB_LIBRARIES
|
|
NAMES dab_lib
|
|
HINTS ${DAB_DIR}/lib
|
|
${DAB_DIR}/lib64
|
|
${LIBDAB_PKG_LIBRARY_DIRS}
|
|
PATHS /usr/lib
|
|
/usr/lib64
|
|
/usr/local/lib
|
|
/usr/local/lib64
|
|
)
|
|
|
|
if (DAB_INCLUDE_DIR AND DAB_LIBRARIES)
|
|
set(DAB_FOUND TRUE CACHE INTERNAL "libdab found")
|
|
message(STATUS "Found libdab: ${DAB_INCLUDE_DIR}, ${DAB_LIBRARIES}")
|
|
else (DAB_INCLUDE_DIR AND DAB_LIBRARIES)
|
|
set(DAB_FOUND FALSE CACHE INTERNAL "libdab found")
|
|
message(STATUS "libdab not found.")
|
|
endif (DAB_INCLUDE_DIR AND DAB_LIBRARIES)
|
|
|
|
mark_as_advanced(DAB_INCLUDE_DIR DAB_LIBRARIES)
|
|
|
|
ENDIF (NOT DAB_FOUND)
|