summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorRon Economos <w6rz@comcast.net>2020-09-03 01:06:59 -0700
committerDerek Kozel <derek.kozel@gmail.com>2020-09-20 22:40:22 +0100
commitebf4b70e3fa9187c947b6b2f8352dafe36b7a77d (patch)
treecd5821c2b05447f5f8cdf359e5be89a8c8a83790 /cmake
parentc78198d72a5ae16c596c7bb9aa7768e43d6f1f94 (diff)
gr-blocks: More graceful error handling of missing sndfile dependency.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindSNDFILE.cmake2
-rw-r--r--cmake/Modules/GrPybind.cmake5
2 files changed, 5 insertions, 2 deletions
diff --git a/cmake/Modules/FindSNDFILE.cmake b/cmake/Modules/FindSNDFILE.cmake
index 97d6798ebb..e20a603efe 100644
--- a/cmake/Modules/FindSNDFILE.cmake
+++ b/cmake/Modules/FindSNDFILE.cmake
@@ -25,7 +25,7 @@ INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SNDFILE DEFAULT_MSG SNDFILE_LIBRARIES SNDFILE_INCLUDE_DIRS)
MARK_AS_ADVANCED(SNDFILE_LIBRARIES SNDFILE_INCLUDE_DIRS)
-if (SNDFILE_FOUND AND NOT TARGET SNDFILE::SNDFILE)
+if (SNDFILE_FOUND AND NOT TARGET sndfile::sndfile)
add_library(sndfile::sndfile INTERFACE IMPORTED)
set_target_properties(sndfile::sndfile PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SNDFILE_INCLUDE_DIRS}"
diff --git a/cmake/Modules/GrPybind.cmake b/cmake/Modules/GrPybind.cmake
index fd5c9a2511..bf4c9b45cd 100644
--- a/cmake/Modules/GrPybind.cmake
+++ b/cmake/Modules/GrPybind.cmake
@@ -154,6 +154,9 @@ target_include_directories(${name}_python PUBLIC
)
target_link_libraries(${name}_python PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} gnuradio-${MODULE_NAME})
target_compile_options(${name}_python PRIVATE -Wno-unused-variable) # disable warnings for docstring templates
+if(NOT SNDFILE_FOUND AND ${name} STREQUAL blocks)
+ target_compile_options(${name}_python PRIVATE -DNO_WAVFILE)
+endif()
add_dependencies(${name}_python ${name}_docstrings ${regen_targets})
endmacro(GR_PYBIND_MAKE_CHECK_HASH)
@@ -277,4 +280,4 @@ target_link_libraries(${name}_python PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIE
target_compile_options(${name}_python PRIVATE -Wno-unused-variable) # disable warnings for docstring templates
add_dependencies(${name}_python ${name}_docstrings ${regen_targets})
-endmacro(GR_PYBIND_MAKE_OOT) \ No newline at end of file
+endmacro(GR_PYBIND_MAKE_OOT)