Making AUnit available to gprbuild

That was it! Adjusting the install path for aunit when installing made it available.

Related question
Is it it possible to adjust the globally searched paths using some environment variable or some setting that GPRBuild will use? The suggested GPR_PROJECT_PATH did not seem to take effect, or it was perhaps used incorrectly.

Thanks!

Details

Showing the default project search directories

aunit/examples/simple_test on  master [!?]
✦ ❯ gprbuild -vm
GPRBUILD 24.0.0 (2024-08-01) (x86_64-pc-linux-gnu)
Copyright (C) 2004-2024, AdaCore
using project file harness.gpr
 33 lines: No errors
TMPDIR = "/tmp/GPR.49115"
gprconfig --batch -o /tmp/GPR.49115/GNAT-TEMP-000001.TMP --target=x86_64-linux --fallback-targets --config=ada,,,,
Checking configuration /tmp/GPR.49115/GNAT-TEMP-000001.TMP
Setting the default project search directories
   Adding directory "/opt/gnat-x86_64-linux-14.2.0-1/x86_64-linux/share/gpr"
   Adding directory "/opt/gnat-x86_64-linux-14.2.0-1/x86_64-linux/lib/gnat"
   Adding directory "/opt/gnat-x86_64-linux-14.2.0-1/share/gpr"
   Adding directory "/opt/gnat-x86_64-linux-14.2.0-1/lib/gnat"

This shows that the sub directories of the gprbuild install was not being searched.

Adjusting the install path for AUnit

 make install INSTALL=/opt/gnat-x86_64-linux-14.2.0-1

Now I could revert the change from using absolute directory paths to using global shared libraries, such as with "aunit";

✦ ❯ git diff
diff --git a/examples/simple_test/harness.gpr b/examples/simple_test/harness.gpr
index f445b8d..a12f6fd 100644
--- a/examples/simple_test/harness.gpr
+++ b/examples/simple_test/harness.gpr
@@ -1,4 +1,10 @@
-with "aunit";
+-- Requires Aunit to be globally available
+-- See https://forum.ada-lang.io/t/making-aunit-available-to-gprbuild/1879/2
+ with "aunit";
+-- If AUnit has not been made available, it will need to be included by path
+--with "../../lib/gnat/aunit.gpr";
+--with "/opt/gprbuild-x86_64-linux-24.0.0-2/share/gpr/aunit.gpr";
+
 with "tested_lib/testlib";

 project Harness is