openscenegraph / OpenSceneGraph

OpenSceneGraph git repository
http://www.openscenegraph.org
Other
3.24k stars 1.42k forks source link

When using cmake to create the osgstaticviewer example ,can't find plugins-{$version} path #1240

Closed AlexOct closed 1 year ago

AlexOct commented 1 year ago

When I created the example like osgstaticviewer by using cmake.I can't load static lib from the path to plugins-{$version} (eg. plugins-3.6.5),during compilation.so i cant find lib like ..\..\lib\osgPlugins-3.6.5\osgdb_ive.lib I load other lib in the way likes :find_package(osgText REQUIRED) and target_link_libraries($OSGTEXT_LIBRARY_RELEASE)

Is there any function in cmake that can help me find the path to plugins.

robertosfield commented 1 year ago

There a CMake mechanism I know of that can be used directly with osgstaticviewer.

Building the OSG static adds complexity to build and is rather niche for OSG usage which is designed primarily to work with shared libraries and use the plugins dynamically, unless you really need it I'd not bother.

If static build is important to your project then perhaps just moving onto the VulkanSceneGraph would be helpful, it builds by default as static lib and the loaders are designed from day one to support static builds.