Show
Ignore:
Timestamp:
03/10/10 18:19:35 (5 years ago)
Author:
robert
Message:

From David Fries,"We are needing to compile Debug, Release, and MinSizeWithDebInfo?, but
currently only Debug appends "d" so the Release and MinSizeWithDebInfo?
(and MinSizeRel?) all produce the same filenames. This set of changes
lets each build type have a cmake defined string appended, defaulting
to Release none, Debug d, RelWithDebInfo? rd, MinSizeRel? s. But a user
still can have Release, RelWithDebInfo?, and MinSizeRel? to produce the
same filenames. It does so by setting the preprocessor define
OSG_LIBRARY_POSTFIX in src/osgDB/CMakeLists.txt to one of the
previously defined cmake variables CMAKE_DEBUG_POSTFIX
CMAKE_RELEASE_POSTFIX CMAKE_RELWITHDEBINFO_POSTFIX
CMAKE_MINSIZEREL_POSTFIX. This method cuts down on the #ifdef _DEBUG
#else preprocessor directives in Registry.cpp as the extension is
always passed in OSG_LIBRARY_POSTFIX. That and MINGW32 didn't
have the _DEBUG check which looks like a bug."

Files:
1 modified

Legend:

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

    r11162 r11197  
    55#  NAME of the variables, so the macro gets as arguments the target name and the following list of parameters 
    66#  is intended as a list of variable names each one containing  the path of the libraries to link to 
    7 #  The existance of a varibale name with _DEBUG appended is tested and, in case it' s value is used 
     7#  The existance of a variable name with _DEBUG appended is tested and, in case it' s value is used 
    88#  for linking to when in debug mode  
    99#  the content of this library for linking when in debugging 
     
    3131                # so we full path name to specify linkage, this prevent automatic inferencing of dependencies, so we add explicit depemdencies 
    3232                #to library targets used 
    33                 TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib") 
     33                TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_RELEASE_POSTFIX}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib") 
    3434                ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB}) 
    3535            ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL) 
    36                 TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}") 
     36                TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}${CMAKE_RELEASE_POSTFIX}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}") 
    3737            ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL) 
    3838        ENDFOREACH(LINKLIB) 
     
    268268 
    269269    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}") 
    270     SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}") 
    271270    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES OUTPUT_NAME ${TARGET_NAME}) 
     271    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_OUTPUT_NAME "${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}") 
     272    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES RELEASE_OUTPUT_NAME "${TARGET_NAME}${CMAKE_RELEASE_POSTFIX}") 
     273    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES RELWITHDEBINFO_OUTPUT_NAME "${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}") 
     274    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES MINSIZEREL_OUTPUT_NAME "${TARGET_NAME}${CMAKE_MINSIZEREL_POSTFIX}") 
    272275 
    273276    IF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)