From 4896fe6e05bafe3ca24d28bf229a33185f2b2313 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 11 Dec 2008 17:00:40 +0000 Subject: [PATCH] From Mattias Helsing, "When building osg static on Windows the _declspec's wasn't escaped for applications, examples or wrappers. Attached are the CMakeLists I had to change to make these compile. " --- applications/CMakeLists.txt | 5 +++++ examples/CMakeLists.txt | 2 ++ src/osgPlugins/CMakeLists.txt | 3 +++ src/osgWrappers/CMakeLists.txt | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/applications/CMakeLists.txt b/applications/CMakeLists.txt index 0e56415cc..ed6018f31 100644 --- a/applications/CMakeLists.txt +++ b/applications/CMakeLists.txt @@ -1,5 +1,10 @@ PROJECT(OSG_APPLICATIONS) +IF (NOT DYNAMIC_OPENSCENEGRAPH) + # need to define this on win32 or linker cries about _declspecs + ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) +ENDIF(NOT DYNAMIC_OPENSCENEGRAPH) + SET(OSGCORE_BUNDLED TRUE) IF(NOT OSGCORE_BUNDLED) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 220f20290..c2999f010 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -193,6 +193,8 @@ IF(DYNAMIC_OPENSCENEGRAPH) #to add subject to find socket#ADD_SUBDIRECTORY(osgcluster) ELSE(DYNAMIC_OPENSCENEGRAPH) + #needed on win32 or the linker get confused by _declspec declarations + ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_SUBDIRECTORY(osgstaticviewer) diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt index 8f0f5156f..e19be35ba 100644 --- a/src/osgPlugins/CMakeLists.txt +++ b/src/osgPlugins/CMakeLists.txt @@ -6,6 +6,9 @@ PROJECT(OSG_PLUGINS_MASTER) +IF (NOT DYNAMIC_OPENSCENEGRAPH) + ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) +ENDIF(NOT DYNAMIC_OPENSCENEGRAPH) IF(NOT MSVC) SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}") diff --git a/src/osgWrappers/CMakeLists.txt b/src/osgWrappers/CMakeLists.txt index d50b4cfd0..2d6e3f26a 100644 --- a/src/osgWrappers/CMakeLists.txt +++ b/src/osgWrappers/CMakeLists.txt @@ -1,5 +1,9 @@ PROJECT(OSG_WRAPPERS) +IF (NOT DYNAMIC_OPENSCENEGRAPH) + ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) +ENDIF(NOT DYNAMIC_OPENSCENEGRAPH) + SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}") SET(CMAKE_SHARED_MODULE_PREFIX ${OSG_PLUGIN_PREFIX})