From: Clayton Smith argilo@gmail.com
When gr-osmosdr was updated to GNU Radio 3.8, generation of gnuradio-osmosdr.pc was removed. Other software uses pkg-config to find gr-osmosdr, so I think we should add it back.
This fixes http://osmocom.org/issues/4423 --- CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++++ gnuradio-osmosdr.pc.in | 15 +++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 gnuradio-osmosdr.pc.in
diff --git a/CMakeLists.txt b/CMakeLists.txt index c23cb49530..868057dcc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,6 +275,43 @@ if(ENABLE_PYTHON) endif(ENABLE_PYTHON) add_subdirectory(docs)
+######################################################################## +# Create Pkg Config File +######################################################################## +FOREACH(inc ${Boost_INCLUDE_DIRS}) + LIST(APPEND GR_OSMOSDR_PC_CFLAGS "-I${inc}") +ENDFOREACH(inc) + +FOREACH(lib ${Boost_LIBRARY_DIRS}) + LIST(APPEND GR_OSMOSDR_PC_LIBS "-L${lib}") +ENDFOREACH(lib) + +# use space-separation format for the pc file +STRING(REPLACE ";" " " GR_OSMOSDR_PC_REQUIRES "${GR_OSMOSDR_PC_REQUIRES}") +STRING(REPLACE ";" " " GR_OSMOSDR_PC_CFLAGS "${GR_OSMOSDR_PC_CFLAGS}") +STRING(REPLACE ";" " " GR_OSMOSDR_PC_LIBS "${GR_OSMOSDR_PC_LIBS}") + +# unset these vars to avoid hard-coded paths to cross environment +IF(CMAKE_CROSSCOMPILING) + UNSET(GR_OSMOSDR_PC_CFLAGS) + UNSET(GR_OSMOSDR_PC_LIBS) +ENDIF(CMAKE_CROSSCOMPILING) + +# fake gnuradio cpack behavior as long as we don't use it directly +set(CPACK_PACKAGE_NAME "gnuradio-osmosdr") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GNU Radio block for various radio hardware") +set(CPACK_PACKAGE_VERSION ${VERSION}) + +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-osmosdr.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-osmosdr.pc +@ONLY) + +INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-osmosdr.pc + DESTINATION ${GR_LIBRARY_DIR}/pkgconfig +) + ######################################################################## # Print Summary ######################################################################## diff --git a/gnuradio-osmosdr.pc.in b/gnuradio-osmosdr.pc.in new file mode 100644 index 0000000000..5f1ae694e3 --- /dev/null +++ b/gnuradio-osmosdr.pc.in @@ -0,0 +1,15 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/@GR_LIBRARY_DIR@ +includedir=${prefix}/@GR_INCLUDE_DIR@ + +Name: @CPACK_PACKAGE_NAME@ +Description: @CPACK_PACKAGE_DESCRIPTION_SUMMARY@ +URL: http://sdr.osmocom.org/trac/wiki/GrOsmoSDR +Version: @CPACK_PACKAGE_VERSION@ +Requires: gnuradio-runtime gnuradio-blocks +Requires.private: @GR_OSMOSDR_PC_REQUIRES@ +Conflicts: +Cflags: -I${includedir} @GR_OSMOSDR_PC_CFLAGS@ +Libs: -L${libdir} -lgnuradio-osmosdr +Libs.private: @GR_OSMOSDR_PC_LIBS@
Other software should be fixed, not re-adding legacy to the code base.
Sylvain Munaut 246tnt@gmail.com writes:
From: Clayton Smith argilo@gmail.com
When gr-osmosdr was updated to GNU Radio 3.8, generation of gnuradio-osmosdr.pc was removed. Other software uses pkg-config to find gr-osmosdr, so I think we should add it back.
Other software should be fixed, not re-adding legacy to the code base.
Since when are .pc files "legacy". They have been the normal way for build systems to find out about other packages for a long time, and I think they are still normal.
Perhaps this is due to a view that $SHINY_NEW_BUILD_SYSTEM is the one true way and that any other software that does not immediately change to that build system is old - but if so I think that's unresonable.
If you mean something else, please explain.
I mean this is a gnuradio OOT, you can only use it with gnuradio. And gnuradio now has its own way of finding oot that doesn't use the .pc files, so there is no point in including one. Whatever legacy gnuradio app still uses the .pc file should move to the new way of gnuradio to do stuff.
On Wed, Nov 18, 2020 at 3:14 PM Greg Troxel gdt@lexort.com wrote:
Sylvain Munaut 246tnt@gmail.com writes:
From: Clayton Smith argilo@gmail.com
When gr-osmosdr was updated to GNU Radio 3.8, generation of gnuradio-osmosdr.pc was removed. Other software uses pkg-config to find gr-osmosdr, so I think we should add it back.
Other software should be fixed, not re-adding legacy to the code base.
Since when are .pc files "legacy". They have been the normal way for build systems to find out about other packages for a long time, and I think they are still normal.
Perhaps this is due to a view that $SHINY_NEW_BUILD_SYSTEM is the one true way and that any other software that does not immediately change to that build system is old - but if so I think that's unresonable.
If you mean something else, please explain.
Sylvain Munaut 246tnt@gmail.com writes:
I mean this is a gnuradio OOT, you can only use it with gnuradio. And gnuradio now has its own way of finding oot that doesn't use the .pc files, so there is no point in including one. Whatever legacy gnuradio app still uses the .pc file should move to the new way of gnuradio to do stuff.
Thanks; that makes sense. I am used to seeing osmo stuff used in the rtl-sdr world, but I guess not this module.