Changeset 9057

Show
Ignore:
Timestamp:
10/27/08 10:48:34 (6 years ago)
Author:
robert
Message:

From Mathieu Marache, "I came across a bug when building OpenSceneGraph with
MSVC_VERSIONED_DLL, NMake makefiles and CMake 2.6.2.
The compilation fails because it tries to copy ot11-OpenThreads?.lib to
OpenThreads?.lib which is valid for the 2.4.x era of CMake but not
anymore in 2.6.x era.
The provided file from the CMakeModules directory adds a tests on the
CMake version and corrects this. Works for me now."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/CMakeModules/OsgMacroUtils.cmake

    r8877 r9057  
    338338        IF(NOT MSVC_IDE)  
    339339            SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../bin/${LIB_PREFIX}${LIB_SOVERSION}-") 
    340             SET(NEW_LIB_NAME "${OUTPUT_BINDIR}/${LIB_PREFIX}${LIB_SOVERSION}-${LIB_NAME}") 
    341             ADD_CUSTOM_COMMAND( 
    342                 TARGET ${LIB_NAME} 
    343                 POST_BUILD 
    344                 COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.lib"  "${OUTPUT_LIBDIR}/${LIB_NAME}.lib" 
    345                 COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.exp"  "${OUTPUT_LIBDIR}/${LIB_NAME}.exp" 
    346                 COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.lib" 
    347                 COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.exp" 
    348                 ) 
    349         ELSE(NOT MSVC_IDE) 
     340            IF (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)  
     341                SET(NEW_LIB_NAME "${OUTPUT_BINDIR}/${LIB_PREFIX}${LIB_SOVERSION}-${LIB_NAME}") 
     342                ADD_CUSTOM_COMMAND( 
     343                    TARGET ${LIB_NAME} 
     344                    POST_BUILD 
     345                    COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.lib"  "${OUTPUT_LIBDIR}/${LIB_NAME}.lib" 
     346                    COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.exp"  "${OUTPUT_LIBDIR}/${LIB_NAME}.exp" 
     347                    COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.lib" 
     348                    COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.exp" 
     349                    ) 
     350            ENDIF (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)  
     351        ELSE(NOT MSVC_IDE)  
    350352            SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../") 
    351         ENDIF(NOT MSVC_IDE) 
     353        ENDIF(NOT MSVC_IDE)  
    352354 
    353355#     SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")