Hi again, replying to myself with some progress.

> For some reason, 
> the additional dependencies list, for example:
> 
> ..\..\lib\OpenThreads
> ..\..\lib\osg
> 
> instead of
> 
> ..\..\lib\OpenThreads.lib
> ..\..\lib\osg.lib
> 
> so that the linker looks for OpenThreads.obj/osg.obj etc. instead of 
> .lib .

First of all, according to 
http://www.cmake.org/HTML/cmake-2.6.html#command_CMP0003 the directory 
should not be listed in the library name (TARGET_LINK_LIBRARIES) but in 
a separate LINK_DIRECTORIES directive. But setting

cmake_policy(SET CMP0003 OLD)

in the top-level CMakeLists.txt makes it use the old behavior, so I 
could side-step that issue. (though it should probably be fixed 
sometime, since CMake 2.6 has been out for a while now)

The problem in my quote above seems to be caused by (in 
CMakeModules/OsgMacroUtils.cmake):

MACRO(LINK_INTERNAL TRGTNAME)
     FOREACH(LINKLIB ${ARGN})
         IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
             #when using versioned names, the .dll name differ from .lib 
name, there is a problem with that:
             #CMake 2.4.7, at least seem to use PREFIX instead of 
IMPORT_PREFIX  for computing linkage info to use into projects,
             # so we full path name to specify linkage, this prevent 
automatic inferencing of dependencies, so we add explicit depemdencies
             #to library targets used
         IF(NOT MSVC_IDE)
             TARGET_LINK_LIBRARIES(${TRGTNAME} optimized 
"${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug 
"${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib")
         ELSE(NOT MSVC_IDE)
             TARGET_LINK_LIBRARIES(${TRGTNAME} optimized 
"${OUTPUT_LIBDIR}/${LINKLIB}" debug 
"${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
         ENDIF(NOT MSVC_IDE)
             ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB})
         ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL)
             TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" 
debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
         ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
     ENDFOREACH(LINKLIB)
ENDMACRO(LINK_INTERNAL TRGTNAME)

(sorry for my e-mail client wrapping the lines)

I don't understand the reason for the ELSE(NOT MSVC_IDE) part (i.e. when 
it *is* an MSVC IDE). MSVC seems to think it wants to link to an .obj if 
you don't specify an extension, and that's exactly what the line there 
does... It does not specify the .lib extension, unlike the line above 
it. When I remove that (i.e. just use the TARGET_LINK_LIBRARIES line 
above, with the .lib extensions) it links fine.

I wonder, did those lines change recently? I've never had a problem with 
that before, and I really wonder why those lines exist at all in the 
first place...

Calling our CMake experts? Anyone? :-)

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

Reply via email to