Skip to content

cmake: avoid non-intentional call of "include(FindPkgConfig)" - #14426

Merged
opencv-pushbot merged 1 commit into
opencv:masterfrom
alalek:cmake_fix_include_pkgconfig
Apr 26, 2019
Merged

opencv-pushbot merged 1 commit into
opencv:masterfrom
alalek:cmake_fix_include_pkgconfig

Conversation

@alalek

@alalek alalek commented Apr 26, 2019 •

Copy link
Copy Markdown
Member

It should be handled in the root CMakeLists.txt (safely for cross-compiling)


Update 2020-02-29:

Unconditional include(FindPkgConfig) during cross-compilation should not be called:

  • it may find "host" pkgconfig (CMake's FindPkgConfig doesn't care about that). Like it finds host "git" or other tools.
  • misconfigured "pkgconfig" finds invalid "host" packages

You can still enable pkgconfig on cross-compiling mode with:

  • setting of PKG_CONFIG_SYSROOT_DIR or PKG_CONFIG_LIBDIR environment variables. Usually it is done by toolchain setupenv scripts (examples: 1, 2)
  • or forcing OPENCV_ENABLE_PKG_CONFIG=ON CMake variable (it is user responsibility to check that weird items above doesn't happen).

Avoid non-intentional call of "include(FindPkgConfig)"
It should be handled in the root CMakeLists.txt (safely for cross-compiling)
@mshabunin mshabunin self-assigned this Apr 26, 2019
@opencv-pushbot
opencv-pushbot merged commit c9f3f4d into opencv:master Apr 26, 2019
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: build/install port/backport done Label for maintainers. Authors of PR can ignore this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants