# Copyright (C) 2010 Martin Lambers # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject # to the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # OpenSceneGraph # # Using static OpenSceneGraph libraries requires some changes to your source: # - Define OSG_LIBRARY_STATIC # - Use the macro USE_GRAPHICSWINDOW() to explicitly reference your graphics system # - Use the macro USE_OSGPLUGIN() to explicitly reference any plugin # you might want to use # # Look at OpenSceneGraph-2.8.2/examples/osgstaticviewer/osgstaticviewer.cpp # for an example. This example can be compiled with: # # i686-pc-mingw32-g++ -W -Wall -o osgstaticviewer.exe \ # examples/osgstaticviewer/osgstaticviewer.cpp \ # -DOSG_LIBRARY_STATIC \ # -I/path/to/mingw-cross-env-2.10/usr/i686-pc-mingw32/include \ # -L/path/to/mingw-cross-env-2.10/usr/i686-pc-mingw32/lib \ # -L/path/to/mingw-cross-env-2.10/usr/i686-pc-mingw32/lib/osgPlugins-2.8.2 \ # -losgdb_ive -losgdb_freetype -losgdb_osg -losgdb_rgb -losgdb_openflight \ # -losgViewer -losgDB -losgText -losgGA -losgSim -losgTerrain -losgFX -losgUtil \ # -losg -lOpenThreads \ # -lfreetype -lz -lgdi32 -lopengl32 -lglu32 # # If you use other plugins, you need to add them and their dependencies in the # right places. For example, put -losgdb_png after the other plugins and -lpng # before -lz for the PNG plugin. # PKG := openscenegraph $(PKG)_IGNORE := $(PKG)_VERSION := 2.8.2 $(PKG)_CHECKSUM := f2f0a3285a022640345a81f536459f37f3f38d01 $(PKG)_SUBDIR := OpenSceneGraph-$($(PKG)_VERSION) $(PKG)_FILE := $($(PKG)_SUBDIR).zip $(PKG)_WEBSITE := http://www.openscenegraph.org/ $(PKG)_URL := http://www.openscenegraph.org/downloads/stable_releases/$($(PKG)_SUBDIR)/source/$($(PKG)_FILE) $(PKG)_DEPS := gcc curl giflib jpeg tiff libpng jasper openexr gdal freetype zlib define $(PKG)_UPDATE false endef define $(PKG)_BUILD # The first lines (up to and including -DCMAKE_INSTALL_PREFIX) set up cmake # for cross-compilation. These should probably be the same for all # cmake-based packages in mingw-cross-env. See also # . # The last lines set OpenSceneGraph-specific flags. cd '$(1)' && cmake . \ -DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_FIND_ROOT_PATH=$(PREFIX)/$(TARGET) \ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ -DCMAKE_C_COMPILER=$(PREFIX)/bin/$(TARGET)-gcc \ -DCMAKE_INCLUDE_PATH=$(PREFIX)/$(TARGET)/include \ -DCMAKE_LIB_PATH=$(PREFIX)/$(TARGET)/lib \ -DCMAKE_INSTALL_PREFIX=$(PREFIX)/$(TARGET) \ -DCMAKE_BUILD_TYPE=Release \ -DDYNAMIC_OPENTHREADS=OFF \ -DDYNAMIC_OPENSCENEGRAPH=OFF \ -DBUILD_OSG_APPLICATIONS=OFF $(MAKE) -C '$(1)' -j '$(JOBS)' install endef