dreamworksanimation / openmoonray

MoonRay is DreamWorks’ open-source, award-winning, state-of-the-art production MCRT renderer.
https://openmoonray.org/
Apache License 2.0
4.32k stars 254 forks source link

OpenImageIO path #131

Open meerfrau opened 1 year ago

meerfrau commented 1 year ago

I've got oiio headers present at /usr/include/OpenImageIO/ . So OpenImageIO_INCLUDE_DIR should be /usr/include like I've set it, or not?

CMake Error at /lib/cmake/Imath/ImathConfig.cmake:24 (message):
  File or directory /include referenced by variable OpenImageIO_INCLUDE_DIR
  does not exist !
Call Stack (most recent call first):
  /lib/cmake/OpenImageIO/OpenImageIOConfig.cmake:90 (set_and_check)
  arras/arras_render/CMakeLists.txt:46 (find_package)
jlanz commented 1 year ago

Hi @meerfrau , Can you tell us a little more about how you are building? Which instruction set you are following?

I think typically you would not set OpenImageIO_INCLUDE_DIR directly, but rather rely on it being set by the OpenImageIOConfig.cmake config.

ccronix commented 1 year ago

you can try install OpenImageIO to /home/tom/OpenImageIO for somewhere and set CMAKE_PREFIX_PATH to the installation dir.

teachmain commented 2 months ago

I met the same problem. I just run cmake -B build . under openmoonray project root directory. I using Archlinux , Imath 3.1.12 and openimageio 2.5.15.0, all install by the pacman.

teachmain commented 2 months ago

I think it fail in find_package(OpenImageIO REQUIRED), but I try this on other project in my computer, it works, so it must be something wrong with cmake path setting staff.

teachmain commented 2 months ago

I think I fix the problem, see the file openmoonray/CMakeLists.txt in line 15:

set(ENV{PATH} "${CUDAToolkit_ROOT}/bin:$ENV{PATH}")

if CUDATookit_ROOT is not set, this will put /bin into the first position in the PATH. In my computer, even this is soft link to /usr/bin, cmake will still think it's start from /bin. Then, it will try to use find_package modules from /lib , instead of /usr/lib . Again, even /lib is soft link to /usr/lib, the find_package of OpenImageIO will gave the OpenImageIO_INCLUDE_DIR as /include instead of /usr/include. In my setup, path /include dose not exist, so there is an error of set_and_check