[cmake-developers] [patch] Support debug libraries for TIFF and Xerces-C libraries

Brad King brad.king at kitware.com
Tue Aug 11 09:13:01 EDT 2015


On 08/07/2015 09:59 AM, rleigh at codelibre.net wrote:
> Please find attached two patches which allow these libraries to detect
> debug versions of the libraries on Windows.  I copied the behaviour from
> the PNG module as suggested on #cmake.

Thanks.  Here are some comments:

> +if(NOT TIFF_LIBRARY)
> +  find_library(TIFF_LIBRARY_RELEASE NAMES ${TIFF_NAMES})
> +  find_library(TIFF_LIBRARY_DEBUG NAMES ${TIFF_NAMES_DEBUG})
> +  include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
> +  mark_as_advanced(TIFF_LIBRARY_RELEASE TIFF_LIBRARY_DEBUG)
> +endif()

This appears to be missing a call to select_library_configurations.

> -# Find all XercesC libraries
> -find_library(XercesC_LIBRARY NAMES "xerces-c" "xerces-c_3" "xerces-c_2"
> -  DOC "Xerces-C++ libraries")
> -mark_as_advanced(XercesC_LIBRARY)
> +if(NOT XercesC_LIBRARY)
> +  # Find all XercesC libraries
> +  find_library(XercesC_LIBRARY_RELEASE
> +               NAMES "xerces-c" "xerces-c_3"
> +               DOC "Xerces-C++ libraries (release)")
> +  find_library(XercesC_LIBRARY_DEBUG
> +               NAMES "xerces-cd" "xerces-c_3D" "xerces-c_3_1D"
> +               DOC "Xerces-C++ libraries (debug)")
> +  include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
> +  select_library_configurations(XercesC)
> +  mark_as_advanced(XercesC_LIBRARY_RELEASE XercesC_LIBRARY_DEBUG)
> +endif()

This changes the set of version numbers considered.  Please start
with a patch to do just the debug libraries for the same version
numbers and then add the new versions as a separate patch.

Thanks,
-Brad



More information about the cmake-developers mailing list