1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

FreeDV modulator: compilation conditional to codec2 library found

This commit is contained in:
f4exb 2019-02-22 15:57:27 +01:00
parent 8ec923c746
commit f481a28a6c
2 changed files with 40 additions and 2 deletions

View File

@ -0,0 +1,36 @@
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_CODEC2 "libcodec2")
FIND_PATH(CODEC2_INCLUDE_DIR
NAMES codec2/codec2.h
HINTS ${PC_CODEC2_INCLUDE_DIR}
${CMAKE_INSTALL_PREFIX}/include
PATHS ${CODEC2_DIR}/include
/usr/local/include
/usr/include
)
FIND_LIBRARY(CODEC2_LIBRARIES
NAMES codec2 libcodec2
HINTS ${PC_CODEC2_LIBDIR}
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
PATHS ${CODEC2_DIR}/lib
${CODEC2_DIR}/lib64
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
)
if(CODEC2_INCLUDE_DIR AND CODEC2_LIBRARIES)
set(CODEC2_FOUND TRUE CACHE INTERNAL "CODEC2 found")
message(STATUS "Found Codec2: ${CODEC2_INCLUDE_DIR}, ${CODEC2_LIBRARIES}")
else()
set(CODEC2_FOUND FALSE CACHE INTERNAL "CODEC2 found")
message(STATUS "Codec2 not found")
endif()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CODEC2 DEFAULT_MSG CODEC2_LIBRARIES CODEC2_INCLUDE_DIR)
MARK_AS_ADVANCED(CODEC2_LIBRARIES CODEC2_INCLUDE_DIR)

View File

@ -20,5 +20,7 @@ if (BUILD_DEBIAN)
add_subdirectory(remotesource)
endif (BUILD_DEBIAN)
# TODO: add FreeDV stuff only if codec2 library is present
add_subdirectory(modfreedv)
find_package(Codec2)
if (CODEC2_FOUND)
add_subdirectory(modfreedv)
endif(CODEC2_FOUND)