Skip to content
Snippets Groups Projects
Commit ef4c85ff authored by Markus Blatt's avatar Markus Blatt Committed by Christoph Grüninger
Browse files

[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
parent 3ff22a8e
Branches
No related tags found
1 merge request!1473[dunecontrol] Skip directories without CMake config files for module_DIR
Pipeline #77054 passed
Pipeline: Dune Nightly Test

#77062

    Pipeline: Dune Nightly Test

    #77061

      ......@@ -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
      ......
      0% Loading or .
      You are about to add 0 people to the discussion. Proceed with caution.
      Please register or to comment