Changeset 11354

Show
Ignore:
Timestamp:
04/20/10 18:27:54 (5 years ago)
Author:
robert
Message:

From Wang Rui, "The OSG book I'm working on will focus on helping beginners build
latest OSG source code with Visual Studio 2010 express, without
setting too many options and without facing unexpected errors. But at
present, the compilation process will fail because the INSTALL project
'cannot find' generated DLLs while copying files. I have looked into
the build directory and found that the places of generated file
folders were just different from previous VS versions. In this case,
the old hack in OsgMacroUtils?.cmake may become invalid:

MACRO(HANDLE_MSVC_DLL)

#this is a hack... the build place is set to lib/<debug or

release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR

#the .lib will be crated in ../ so going straight in lib by

the IMPORT_PREFIX property

#because we want dll placed in OUTPUT_BINDIR ie the bin folder

sibling of lib, we can use ../../bin to go there,

...
ELSE(NOT MSVC_IDE)

SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX

"../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")

ENDIF(NOT MSVC_IDE)

ENDMACRO(HANDLE_MSVC_DLL)

Here the prefix "../../bin" may need to be fixed. I just modified it to:

IF(MSVC_VERSION LESS 1600)

SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX

"../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
ENDIF()

It should keep compatible with old MSVC versions. There are similar
fixes in the SETUP_PLUGIN and SETUP_EXE macros. I haven't tested them
on more platforms.
"

Files:
1 modified

Legend:

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

    r11197 r11354  
    171171                SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")                      
    172172            ELSE(NOT MSVC_IDE) 
    173                 SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../${OSG_PLUGINS}/") 
     173                IF(MSVC_VERSION LESS 1600) 
     174                    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../${OSG_PLUGINS}/") 
     175                ENDIF() 
    174176            ENDIF(NOT MSVC_IDE) 
    175177        ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4) 
     
    275277 
    276278    IF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL) 
     279        IF(MSVC_VERSION LESS 1600) 
    277280            SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../")     
     281        ENDIF() 
    278282    ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL) 
    279283 
     
    374378            ENDIF (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)  
    375379        ELSE(NOT MSVC_IDE)  
    376             SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../") 
     380            IF(MSVC_VERSION LESS 1600) 
     381                SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../") 
     382            ENDIF() 
    377383        ENDIF(NOT MSVC_IDE)  
    378384