View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011752CMakeModulespublic2011-01-25 11:372011-11-11 10:45
ReporterStephan Meister 
Assigned ToWill Dicharry 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformVisual Studio 2010OSWindowsOS Version7 x64
Product VersionCMake 2.8.3 
Target VersionCMake 2.8.5Fixed in VersionCMake 2.8.5 
Summary0011752: FindHDF5.cmake debug and release libraries get mixed in release configuration
DescriptionIf debug and release libraries for several components are found (e.g. hdf5, hdf5_cpp, hdf5_hl,...)
then using TARGET_LINK_LIBARARIES(Project ${HDF5_LIBRARIES}) will cause the Project to be linked against both debug and release libraries.
(For example hdf5.lib AND hdf5d.lib)

This is caused by lines 286+ in FindHDF5.cmake:
        set( HDF5_LIBRARIES
            debug ${HDF5_LIBRARIES_DEBUG}
            optimized ${HDF5_LIBRARIES_RELEASE} )
...

CMake does only treat the first library in HDF5_LIBRARIES_DEBUG as debug,
the others will default to optimized.

I suggest the following fix:
    if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
        set(HDF5_LIBRARIES)
    foreach(LIB ${HDF5_LIBRARIES_DEBUG})
        list(append HDF5_LIBRARIES debug ${LIB})
    endforeach()
    foreach(LIB ${HDF5_LIBRARIES_RELEASE})
        list(append HDF5_LIBRARIES optimized ${LIB})
    endforeach()
    else()
        set( HDF5_LIBRARIES ${HDF5_LIBRARIES_RELEASE} )
    endif()



TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0026876)
Will Dicharry (developer)
2011-06-15 12:28

Applied changes, they should make it into 2.8.5.
(0027768)
David Cole (manager)
2011-11-11 10:45

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-01-25 11:37 Stephan Meister New Issue
2011-01-26 09:08 David Cole Assigned To => Will Dicharry
2011-01-26 09:08 David Cole Status new => assigned
2011-06-15 12:28 Will Dicharry Note Added: 0026876
2011-06-15 12:28 Will Dicharry Status assigned => resolved
2011-06-15 12:28 Will Dicharry Fixed in Version => CMake 2.8.5
2011-06-15 12:28 Will Dicharry Resolution open => fixed
2011-06-17 18:23 David Cole Target Version => CMake 2.8.5
2011-11-11 10:45 David Cole Note Added: 0027768
2011-11-11 10:45 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team