Fix Dependency Installer and Improve Build System #8711
      
        
          +118
        
        
          −52
        
        
          
        
      
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Fix Dependency Installer and Improve Build System
This PR introduces a series of improvements to the build system, focusing on making dependency handling more robust, predictable, and user-friendly. The changes address build failures in custom environments and enhance the clarity of the installation summary.
Bug Fix
This PR resolves a critical build failure that occurred when dependencies were installed in a custom directory using the
-prefixoption (e.g.,./dependencies). The root cause was that the CMake configuration did not fully respect custom dependency paths, leading to linker errors. By enforcing the correct CMake policies, this change ensures that the project builds reliably, regardless of where the dependencies are located.Key Changes
1. Robust Dependency Handling with Custom Prefixes
File changed:
etc/DependencyInstaller.shThe dependency installation script has been refactored to correctly prioritize custom installation prefixes provided with the
-prefixflag.--prefixargument now accepts relative paths, which are automatically converted to absolute paths. This adds flexibility when running the script from different directories.2. Enhanced Installation Summary
File changed:
etc/DependencyInstaller.shThe installation summary table has been significantly improved to provide a clearer and more informative overview of the dependency landscape:
3. Consistent CMake Dependency Resolution
File changed:
CMakeLists.txtThe root
CMakeLists.txthas been updated to ensure consistent behavior across all environments, from local development to CI.CMP0144Policy: TheCMP0144policy has been added to ensure thatfind_packagecorrectly uses<PACKAGENAME>_ROOTvariables. This was the root cause of build failures when using a custom prefix, as CMake was ignoring some of the provided paths.CMP0074andCMP0144, documenting why both are necessary for backward and forward compatibility in CMake's dependency resolution.