1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-18 00:02:21 +08:00

bootstrap: Allow --boostrap-system-* libraries custom prefixes

If pkg-config is available, we can query it for the correct -l/-L flags.
This fixes the --boostrap-libuv build for me with libuv installed into
$HOME and PKG_CONFIG_PATH set appropriately
This commit is contained in:
Alex Richardson
2024-03-03 23:02:36 -08:00
parent debf777290
commit da5de7f9f3

View File

@@ -1787,20 +1787,26 @@ if test "x${bootstrap_system_libuv}" = "x"; then
else else
if test `which pkg-config`; then if test `which pkg-config`; then
use_uv_flags="`pkg-config --cflags libuv`" use_uv_flags="`pkg-config --cflags libuv`"
use_uv_ldflags="`pkg-config --libs libuv`"
cmake_c_flags="${cmake_c_flags} ${use_uv_flags}" cmake_c_flags="${cmake_c_flags} ${use_uv_flags}"
cmake_cxx_flags="${cmake_cxx_flags} ${use_uv_flags}" cmake_cxx_flags="${cmake_cxx_flags} ${use_uv_flags}"
else
use_librhash_ldflags="-luv"
fi fi
libs="${libs} -luv" libs="${libs} ${use_uv_ldflags}"
fi fi
librhash_c_flags="-DNO_IMPORT_EXPORT" librhash_c_flags="-DNO_IMPORT_EXPORT"
if test "x${bootstrap_system_librhash}" != "x"; then if test "x${bootstrap_system_librhash}" != "x"; then
if test `which pkg-config`; then if test `which pkg-config`; then
use_librhash_flags="`pkg-config --cflags librhash`" use_librhash_flags="`pkg-config --cflags librhash`"
use_librhash_ldflags="`pkg-config --libs librhash`"
cmake_c_flags="${cmake_c_flags} ${use_librhash_flags}" cmake_c_flags="${cmake_c_flags} ${use_librhash_flags}"
cmake_cxx_flags="${cmake_cxx_flags} ${use_librhash_flags}" cmake_cxx_flags="${cmake_cxx_flags} ${use_librhash_flags}"
else
use_librhash_ldflags="-lrhash"
fi fi
libs="${libs} -lrhash" libs="${libs} ${use_librhash_ldflags}"
fi fi
jsoncpp_cxx_flags= jsoncpp_cxx_flags=
@@ -1809,9 +1815,12 @@ if test "x${bootstrap_system_jsoncpp}" = "x"; then
else else
if test `which pkg-config`; then if test `which pkg-config`; then
use_jsoncpp_flags="`pkg-config --cflags jsoncpp`" use_jsoncpp_flags="`pkg-config --cflags jsoncpp`"
use_jsoncpp_ldflags="`pkg-config --libs jsoncpp`"
cmake_cxx_flags="${cmake_cxx_flags} ${use_jsoncpp_flags}" cmake_cxx_flags="${cmake_cxx_flags} ${use_jsoncpp_flags}"
else
use_librhash_ldflags="-ljsoncpp"
fi fi
libs="${libs} -ljsoncpp" libs="${libs} ${use_jsoncpp_ldflags}"
fi fi
if test "x${cmake_ansi_cxx_flags}" != "x"; then if test "x${cmake_ansi_cxx_flags}" != "x"; then