From cba84f74aa7a502168269f8f6a86fdad385b8c0f Mon Sep 17 00:00:00 2001 From: Laurens Voerman Date: Fri, 30 Sep 2016 14:59:51 +0200 Subject: [PATCH] adaptations for cmake changes mid 2015 (SelectLibraryConfigurations.cmake) with SelectLibraryConfigurations.cmake collada zlib debug library linking added --- CMakeModules/FindCOLLADA.cmake | 11 ++++++++++- CMakeModules/OsgMacroUtils.cmake | 6 +++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeModules/FindCOLLADA.cmake b/CMakeModules/FindCOLLADA.cmake index 9e7d4df51..ac054e508 100644 --- a/CMakeModules/FindCOLLADA.cmake +++ b/CMakeModules/FindCOLLADA.cmake @@ -186,7 +186,16 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG FIND_PACKAGE(ZLIB) IF (ZLIB_FOUND) - SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE) + IF (ZLIB_LIBRARY_RELEASE) + SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY_RELEASE}" CACHE FILEPATH "" FORCE) + ELSE(ZLIB_LIBRARY_RELEASE) + SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE) + ENDIF(ZLIB_LIBRARY_RELEASE) + IF (ZLIB_LIBRARY_DEBUG) + SET(COLLADA_ZLIB_LIBRARY_DEBUG "${ZLIB_LIBRARY_DEBUG}" CACHE FILEPATH "" FORCE) + ELSE(ZLIB_LIBRARY_DEBUG) + SET(COLLADA_ZLIB_LIBRARY_DEBUG "${COLLADA_ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE) + ENDIF(ZLIB_LIBRARY_DEBUG) ELSE(ZLIB_FOUND) IF(WIN32) FIND_LIBRARY(COLLADA_ZLIB_LIBRARY diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake index 6639462c6..71a95c8d4 100644 --- a/CMakeModules/OsgMacroUtils.cmake +++ b/CMakeModules/OsgMacroUtils.cmake @@ -38,7 +38,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)