diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake index 3b751326d..07e33dcf0 100644 --- a/CMakeModules/OsgMacroUtils.cmake +++ b/CMakeModules/OsgMacroUtils.cmake @@ -43,7 +43,11 @@ 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}}" ) ENDIF(${varname}_DEBUG)