Skip to content

preserve PKG_CONFIG_PATH instead of overwriting it#11

Merged
berndpfrommer merged 1 commit into
ros-misc-utilities:masterfrom
alistair-english:preserve-pkg-config-path
Mar 10, 2026
Merged

preserve PKG_CONFIG_PATH instead of overwriting it#11
berndpfrommer merged 1 commit into
ros-misc-utilities:masterfrom
alistair-english:preserve-pkg-config-path

Conversation

@alistair-english
Copy link
Copy Markdown
Contributor

Hi! I've come across this repo as a depenency for foxglove_compressed_video_transport - thanks for your work on both!

The Problem:
set(ENV{PKG_CONFIG_PATH} ${FFMPEG_PKGCONFIG}) unconditionally overwrites PKG_CONFIG_PATH. Since FFMPEG_PKGCONFIG defaults to an empty string, this blanks out the entire variable during cmake configure.

This works on Ubuntu by accident because ffmpeg's .pc files live in pkg-config's default search path. But it breaks when using Nix or cross-compilation setups.

Proposed fix:

  • Prepend FFMPEG_PKGCONFIG to PKG_CONFIG_PATH instead of replacing it, and only when it's non-empty

I also removed a duplicated pkg-config discovery block in CMakeLists.txt

Signed-off-by: Alistair English <alistair.e@greenforgelabs.com.au>
@berndpfrommer berndpfrommer merged commit 333cb93 into ros-misc-utilities:master Mar 10, 2026
7 of 8 checks passed
@berndpfrommer
Copy link
Copy Markdown
Contributor

Thank you for your contribution!
That left-over double block - embarrassing what junk code I commit. How did I not catch this? Time for some LLM to take over. Hopefully, not trained on my code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants