RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1.02k stars 186 forks source link

Using ospray_testing needs extra include directory #415

Open paulmelis opened 4 years ago

paulmelis commented 4 years ago

Even though the ospray_testing headers are included in the superbuild using only -I <ospray>/include isn't enough, as one of the headers is then not found due to an incorrect quoted reference in ospray/ospray_testing/builders/Builder.h:

melis@juggle 19:15:~/concepts/blender-ospray-engine$ cat t.cc
#include <ospray/ospray.h>
#include <ospray/ospray_testing/ospray_testing.h>

melis@juggle 19:15:~/concepts/blender-ospray-engine$ g++ -c -I ~/software/ospray-superbuild-git/include/ t.cc
In file included from /home/melis/software/ospray-superbuild-git/include/ospray/ospray_testing/detail/ospray_testing.inl:4,
                 from /home/melis/software/ospray-superbuild-git/include/ospray/ospray_testing/ospray_testing.h:39,
                 from t.cc:2:
/home/melis/software/ospray-superbuild-git/include/ospray/ospray_testing/detail/../builders/Builder.h:12:10: fatal error: ospray_testing_export.h: No such file or directory
   12 | #include "ospray_testing_export.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
johguenther commented 4 months ago

If you like to use ospray_testing please add target ospray::ospray_testing to target_link_libraries, which will add the proper include path for it. ospray_Exports.cmake has

set_target_properties(ospray::ospray_testing PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/ospray/ospray_testing"
  INTERFACE_LINK_LIBRARIES "ospray::ospray_sdk"
)