Skip to content

Commit 33200e7

Browse files
committed
Manually supply pkgconfig hints in the absense of pc file
1 parent 3ecd4f1 commit 33200e7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

components/core/cmake/Modules/FindBZip2.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ endif()
3434
find_package(PkgConfig)
3535
pkg_check_modules(bzip2_PKGCONF QUIET "${bzip2_PKGCONFIG_NAME}")
3636

37+
# Manually set package finding hints in case of failure
38+
if(NOT bzip2_PKGCONF_FOUND)
39+
message(WARNING "Cannot find package config for ${bzip2_PKGCONFIG_NAME}")
40+
if(DEFINED BZip2_ROOT)
41+
set(bzip2_PKGCONF_INCLUDEDIR "${BZip2_ROOT}/include")
42+
set(bzip2_PKGCONF_LIBDIR "${BZip2_ROOT}/lib")
43+
endif()
44+
endif()
45+
3746
# Set include directory
3847
find_path(BZip2_INCLUDE_DIR ${bzip2_HEADER}
3948
HINTS ${bzip2_PKGCONF_INCLUDEDIR}

0 commit comments

Comments
 (0)