diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake index 1223a15..fafe0bf 100644 --- a/CMakeModules/OsgMacroUtils.cmake +++ b/CMakeModules/OsgMacroUtils.cmake @@ -43,9 +43,13 @@ SET(VALID_BUILDER_VERSION OFF) MACRO(LINK_WITH_VARIABLES TRGTNAME) FOREACH(varname ${ARGN}) IF(${varname}_DEBUG) - TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}") + IF(${varname}_RELEASE) + TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}_RELEASE}" debug "${${varname}_DEBUG}") + ELSE(${varname}_RELEASE) + TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}") + ENDIF(${varname}_RELEASE) ELSE(${varname}_DEBUG) - TARGET_LINK_LIBRARIES(${TRGTNAME} "${${varname}}" ) + TARGET_LINK_LIBRARIES(${TRGTNAME} ${${varname}} ) ENDIF(${varname}_DEBUG) ENDFOREACH(varname) ENDMACRO(LINK_WITH_VARIABLES TRGTNAME)