if(WIN32) find_package(OpenSceneGraph REQUIRED COMPONENTS osgViewer osgGA osgText osgDB osgUtil osgFX) set(OSG_INCLUDE_DIR ${OPENSCENEGRAPH_INCLUDE_DIRS}) set(OSG_LIBS ${OPENSCENEGRAPH_LIBRARIES}) else(WIN32) # install OpenSceneGraph with sudo apt install libopenscenegraph-3.4-dev find_package(osg REQUIRED COMPONENTS osgViewer osgGA osgText osgDB osgUtil osgFX) set(OSG_LIBS osg osgViewer osgGA osgText osgDB osgUtil osgFX) endif(WIN32)
时间: 2024-01-31 19:04:10 浏览: 74
win32编译osg
这段代码是用来做什么的?
这段代码是用来查找和链接 OpenSceneGraph 库的,其中根据平台不同使用不同的方式进行查找和链接。在 Windows 平台下使用 find_package 命令进行查找,然后设置 OSG_INCLUDE_DIR 和 OSG_LIBS 变量;在其他平台下,需要先安装 OpenSceneGraph 库,然后使用 find_package 命令进行查找并设置 OSG_LIBS 变量。
阅读全文