On Fri, Aug 22, 2008 at 2:06 AM, Mattias Helsing <[EMAIL PROTECTED]>wrote:

> Hi Philip,
>
> It's complaining about all osg libraries since they (when using the
> MSVC_IDE generator) don't have a valid libary name according to cmake
> (osg while camke expects osg.lib I guess). Extract from
> OsgMacroUtils.cmake line 35-37
>
> ELSE(NOT MSVC_IDE)
>  TARGET_LINK_LIBRARIES(${TRGTNAME} optimized
> "${OUTPUT_LIBDIR}/${LINKLIB}" debug
> "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
> ENDIF(NOT MSVC_IDE)


Grrrr...

Ok, so the whole section from lines 27 to 42 can, I'm nearly 100% certain,
can safely be replaced by one line:
TARGET_LINK_LIBRARIES(${TRGTNAME} ${ARGN})

I believe all of the complication in this section is due to an obscure
use-case conceived by the original designers of the OSG adaption to CMake
which is no longer relevant.

The simple fact of the matter is CMake automatically handles linking
internally generated debug targets against internally generated debug
libraries (and same for release) and has done so since at least CMake 2.4.0,
probably before that.

I'd be confident sending this change to osg-submissions if I knew how to
regression test the NOT MSVC_IDE use case.  I wonder if this means building
the OSG with nmake or some other command line build?  Perhaps someone on
here more familiar with the VS tools could use the attached file on CMake
2.4.8 and see if NMake causes MSVC_IDE to be false and see if everything
builds fine?

Alternatively, we could simply submit the fix and handle any repercussions
later.  If TARGET_LINK_LIBRARIES(${TRGTNAME} ${ARGN}) doesn't work it is
most definitely a CMake bug.

A less risky fix to elliminate the warning would be to append ".lib" to line
36 and collapse that conditional block.

-- 
Philip Lowman
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to