Hi Jan,

Could the CMakeFile.txt be fixed that if no debug version is found cmake doesn't fail? I want to build a release (default) and it fails because the debug version of OSG is not there - it shouldn't be required for building release and/or if not on Windows (you can safely mix debug/release except on Windows). Also, on Linux there is usually no "d" suffix for debug versions - OSG has a macro to deal with that.

The OSG libraries are found using the Findosg*.cmake that come with CMake. Looking at Findosg_functions.cmake (in <my CMake install dir>/share/cmake-2.6/Modules) I see this:

   if(NOT ${module_uc}_LIBRARY_DEBUG)
      # They don't have a debug library
      set(${module_uc}_LIBRARY_DEBUG ${${module_uc}_LIBRARY} PARENT_SCOPE)
      set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARY} PARENT_SCOPE)
   else()
      # They really have a FOO_LIBRARY_DEBUG
      set(${module_uc}_LIBRARIES
          optimized ${${module_uc}_LIBRARY}
          debug ${${module_uc}_LIBRARY_DEBUG}
          PARENT_SCOPE
      )
   endif()

Which if I'm reading right, means that if no debug library was found, it will set the debug library to the same value as the release library. I think that should do what you want?

Maybe check which version of CMake you have, and whether your Findosg_functions.cmake has this code.

In any case, tweaking how the OSG libraries are found/used will mean copying the Findosg*.cmake modules to be local to the project, and tweaking them there. I'd be hesitant to do that since we then take on the responsibility of maintaining our copies of them in the future. So if you can live with manually setting the debug library to the same value as the release library (which you'll need to do only once because then the values are cached for the next time you need to run cmake) then that might be better.

Or perhaps we can submit a patch to the Findosg*.cmake modules that come with CMake to add an option to do what you want. If you want you can investigate this path.

In any case, I'm not that familiar with CMake so I just read the code and try to make sense of it, if we want to do something more complicated I'd consult Philip Lowman who seems to be really comfortable with CMake :-)

Furthermore, you may want to fix the following to bring osgOcean in line with the other plugins/nodekits regarding installation - headers should be installed under osgOcean subdir and the shared lib should go into the lib not bin subdirectory.

Committed to SVN trunk. Thanks for the patch.

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to