Hi Stephan, I'm not CMake guru that I'd like to be so I can't right away decide whether your change is appropriate or not.
Could those more expert in CMake through some light on this matter? Cheers, Robert. On Oct 26, 2007 4:28 PM, Stephan Maximilian Huber <[EMAIL PROTECTED]> wrote: > Hi > > I am trying a static build os osg 2.2 with Visual Studio. I set the > cmake options, generated the solution files and started the build inside > VS. The linker could not link the applications (osgviewer etc) because > it could not find the lib OpenThreadsd.lib (I can only found a > ot9-openthreadsd.lib) It looks like a mistake in the cmakelist-files. > > More important for my own code: I get errors of multiple defined > symbols, because the osg-libs include the OpenThreads as if they were > linked dynamically, which is not the case. > > I had to modify the CMakeLists-files inside the various src-folders from: > > > IF (DYNAMIC_OPENSCENEGRAPH) > ADD_DEFINITIONS(-DOSGSIM_LIBRARY) > ELSE (DYNAMIC_OPENSCENEGRAPH) > ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) > ENDIF(DYNAMIC_OPENSCENEGRAPH) > > > to > > IF (DYNAMIC_OPENSCENEGRAPH) > ADD_DEFINITIONS(-DOSGSIM_LIBRARY) > ELSE (DYNAMIC_OPENSCENEGRAPH) > ADD_DEFINITIONS(-DOT_LIBRARY_STATIC) > ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) > ENDIF(DYNAMIC_OPENSCENEGRAPH) > > My experience wuth CMake is very limited, so I don't know if these > changes are ok. Perhaps someone wants to build Openthreads dynamically > and osg statically, then my hack will not work. > > If my changes look sensible, I can submit the new CMakeLists files to > osg-submissions. > > BTW: is there a nicer way to define these compile-flags in a central file? > > > cheers, > Stephan > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

