mosra / magnum

Lightweight and modular C++11 graphics middleware for games and data visualization
https://magnum.graphics/
Other
4.82k stars 439 forks source link

How to point to a local installation of `corrade` without using the bootstrap project? #614

Closed vittorioromeo closed 1 year ago

vittorioromeo commented 1 year ago

I would like to build magnum with a local installation of corrade (i.e. a local build installed in an arbitrary folder on my system).

I can specify -DCORRADE_INCLUDE_DIR="/c/whatever/corrade/build/install/include, but CMake fails to find corrade-rc, Utility and other things. I tried specifying those manually, but FindCorrade doesn't expose all the required variables.

I propose adding a CORRADE_ROOT variable that can be pointed to "/c/whatever/corrade/build/install" in my case, and CORRADE_INCLUDE_DIR defaulted to ${CORRADE_ROOT}/include if CORRADE_ROOT is specified.

mosra commented 1 year ago

CMake has a <PackageName>_ROOT builtin since 3.12, but I'd have to enable policy CMP0074 to make that work. (I thought I already enabled it but apparently not, heh -- will do.) Then you could use Corrade_ROOT (not uppercase) and it'd "just work" without any other changes needed from my side.

Until then, putting the installation path to CMAKE_PREFIX_PATH should work, separate with semicolons if you have more of them. So for example -DCMAKE_PREFIX_PATH="/c/whatever/corrade/build/install;/c/whatever/magnum/build/install", or install everything into a single location.

mosra commented 1 year ago

Fixed in 888ba08569ee0f167410cdd5145b3c2ad14faf08, corresponding changes in other repos will follow.

vittorioromeo commented 1 year ago

Thank you for the quick turnaround!