From: Markus Blatt Date: Wed, 20 Nov 2024 10:39:10 +0000 (+0100) Subject: [PATCH] [dunecontrol] Skip directories without CMake config files for module_DIR X-Git-Tag: archive/raspbian/2.10.0-4+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9d0228ba884f6df2b20130b85ab528914f09bb8a;p=dune-common.git [PATCH] [dunecontrol] Skip directories without CMake config files for module_DIR find_package(module) will fail if the directory set with module_DIR does not contain CMake configuration file. Hence the current approach requires that there are pkgconfig files installed and found for each module to be used. With this change we fall back to installed modules if the directory does not contain any Cmake configuration files. This fixes problems with using OPM as DUNE modules (in Debian) which stopped shipping broken pkgconf file 2023-09 Gbp-Pq: Name dunecontrol-Skip-directories-without-CMake-config-fi.patch --- diff --git a/bin/dunecontrol b/bin/dunecontrol index 5b34333..35b6838 100755 --- a/bin/dunecontrol +++ b/bin/dunecontrol @@ -656,17 +656,20 @@ run_default_cmake () { name=$(eval "echo \$NAME_$m") local m_ABS_BUILDDIR=$(abs_builddir $m $BUILDDIR) + config_dir="$path" + for i in $MULTIARCH_LIBDIR lib lib64 lib32; do + if test -d "$path/$i/cmake/$name"; then + config_dir="$path/$i/cmake/$name" + break; + fi + done if test -d "$m_ABS_BUILDDIR"; then - CMAKE_PARAMS="$CMAKE_PARAMS \"-D""$name""_DIR=$m_ABS_BUILDDIR\"" - else - TMP_PARAMS="\"-D""$name""_DIR=$path\"" - for i in $MULTIARCH_LIBDIR lib lib64 lib32; do - if test -d "$path/$i/cmake/$name"; then - TMP_PARAMS="\"-D""$name""_DIR=$path/$i/cmake/$name\"" - break; - fi - done - CMAKE_PARAMS="$CMAKE_PARAMS $TMP_PARAMS" + config_dir="$m_ABS_BUILDDIR" + fi + # Only add directories with CMake config files to -Dmodule_DIR + # Then there is at least a chance to find packages in default locations + if ls "$config_dir"/*onfig.cmake 1> /dev/null 2>&1; then + CMAKE_PARAMS="$CMAKE_PARAMS \"-D""$name""_DIR=$config_dir\"" fi fi done