Version 8 (modified by osg, 9 years ago)


CPack support in the OpenSceneGraph source tree

The OpenSceneGraph build system can generate packaging targets for you if you have cmake version 2.6.0 or higher. Versions of cmake from 2.6.1 works better in that it can generate packaging targets for the non-standard plugins (e.g. vnc, dae (COLLADA), vrml...). To enable generation of package targets run cmake with -DBUILD_PACKAGES=ON or check to box next to BUILD_PACKAGES in cmake-gui.

The following targets (at least) will be generated

Package Namemake targetMSVC projectContents
libopenthreadspackage_libopenthreadsPackage libopenthreadsThe OpenThreads? library. On windows using shared binaries it includes the dll
libopenthreads-devpackage_libopenthreads-devPackage libopenthreads-devOpenThreads? headers. If building static binaries this package includes the library. On windows and building shared binaries this package contains the link library
libopenscenegraphpackage_libopenscenegraphPackage libopenscenegraphThe OpenSceneGraph library.
libopenscenegraph-devpackage_libopenscenegraph-devPackage libopenscenegraph-devOpenSceneGraph headers. Static libraries. On windows the .lib files for linking with the dlls

The following packaging targets will be generated depending on certain prereqs

Package NamePre-reqmake targetMSVC projectContents
openscenegraphBUILD_APPLICATIONS=ONpackage_openscenegraphPackage openscenegraphThe OSG applications, e.g. osgviewer, osgversino
openscenegraph-examplesBUILD_EXAMPLES=ONpackage_openscenegraph-examplesPackage openscenegraph-examplesThe OSG examples, e.g. osgvolume, osganimate, osg2cpp
openthreads-docBUILD_DOCUMENTATION=ONpackage_openthreads-docPackage openthreads-docThe OpenThreads? reference documentation
openscenegraph-docBUILD_DOCUMENTATION=ONpackage_openscenegraph-docPackage openscenegraph-docThe OpenSceneGraph reference documentation

If you are building non-standard plugins the following targets might be generated. Generating these targets will happen only with cmake-2.6.1 or higher

Package Namemake targetMSVC projectContentsDependencies
libopenscenegraph-ivpackage_libopenscenegraph-ivPackage libopenscenegraph-ivThe inventor pluginCoin
libopenscenegraph-daepackage_libopenscenegraph-daePackage libopenscenegraph-daeThe COLLADA pluginCOLLADA versino-??
libopenscenegraph-dicompackage_libopenscenegraph-dicomPackage libopenscenegraph-dicomThe dicom pluginITK or DCMT
libopenscenegraph-gdalpackage_libopenscenegraph-gdalPackage libopenscenegraph-gdalThe GDAL pluginGDAL
libopenscenegraph-geckopackage_libopenscenegraph-geckoPackage libopenscenegraph-geckoThe Gecko pluginlibxul-1.8.x
libopenscenegraph-pdfpackage_libopenscenegraph-pdfPackage libopenscenegraph-pdfThe pdf pluginCairo, Poppler
libopenscenegraph-svgpackage_libopenscenegraph-svgPackage libopenscenegraph-svgThe svg pluginCairo/SVGR
libopenscenegraph-vncpackage_libopenscenegraph-vncPackage libopenscenegraph-vncThe VNC pluginlibVNCServer
libopenscenegraph-vrmlpackage_libopenscenegraph-vrmlPackage libopenscenegraph-vrmlThe VRML pluginVRML-14.3

Platform specifics


* CPack looks for 7-zip ( or Winzip in the %ProgramFiles?% folder. I use only 7-zip and it works great for generating tgz's or zips if you like. * The cmake scripts tries to determine what compiler you have. Especially it tries to distinguish between vc80 and vc80sp1 since vc80 (msvs 2005) is known to generate "false" error reports on osg-users

Deb, rpm, Stgz and zip archives

It is always possible to generate archives in other formats using generated ${OSG_BINARY_DIR}/CPackConfig-xxxxx.cmake. You just need to invoke cpack yourself, e.g.

cpack -G ZIP --config <OSG_BUILD_DIR>/CPackConfig-libopenscenegraph.cmake
cpack -G RPM --config <OSG_BUILD_DIR>/CPackConfig-openscenegraph-doc.cmake
cpack -G STGZ --config <OSG_BUILD_DIR>/CPackConfig-libopenthreads.cmake

Package names

Package names are created on the form

<package>-<osg version>-<platform>-<arch>[-<compiler>]-<build_type>[-static].tar.gz

where package::

is the component, e.g. libopenscenegraph, openscenegraph

osg version::

major, minor and patch verison of your osg source


win32, win64, Linux etc.


i386, x86, ia64 etc.


If OSG_CPACK_COMPILER is set it will get put here. A default is generated for msvc but anyone can set OSG_CPACK_COMPILER


Corresponds to CMAKE_BUILD_TYPE. Debug or Release on unices. On windows might be RelWithDebugInfo? or MinSize? too.


If you are building static libraries the package name ends with static