OpenSceneGraph icon indicating copy to clipboard operation
OpenSceneGraph copied to clipboard

osg CMake target does not include auto-generated osg/Config

Open mmurrian opened this issue 2 years ago • 2 comments

target_include_directories(osg ...) does not include the directory that contains the autogenerated osg/Config.

This prevents building and linking against OpenSceneGraph as part of a larger CMake build (e.g., via add_subdirectory(OpenSceneGraph)) without explicitly installing OSG.

I fixed this by adding $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> in TARGET_INCLUDE_DIRECTORIES in the SETUP_LIBRARY macro of OsgMacroUtils.cmake

mmurrian avatar Nov 18 '21 15:11 mmurrian

Please generate a PR if you think you have a useful fix.

robertosfield avatar Nov 18 '21 16:11 robertosfield

Will do. I don't understand your build system well enough to know if there's a reason why you wouldn't want it fixed this way... but I'll let you answer that question in a PR.

mmurrian avatar Nov 18 '21 16:11 mmurrian