Fix find package process

This commit is contained in:
Allen Byrne 2017-09-19 12:39:45 -05:00
parent 32777d015b
commit 0a9bc574e8

View File

@ -158,9 +158,17 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
set (hdf5_comp2 "hdf5_hl_f90cstub")
set (hdf5_comp "hdf5_hl_fortran")
endif ()
list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP)
if (${comp} STREQUAL "Java")
list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}" HAVE_COMP)
else ()
list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP)
endif ()
if (${HAVE_COMP} LESS 0)
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0)
if (${comp} STREQUAL "Java")
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0)
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0)
endif ()
else ()
if (hdf5_comp2)
list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp2}-${libtype}" HAVE_COMP2)
@ -171,6 +179,10 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp2}-${libtype} @HDF5_PACKAGE@::${hdf5_comp}-${libtype})
endif ()
elseif (${comp} STREQUAL "Java")
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY)
set (${COMP_LIBRARY} ${${COMP_LIBRARY}} hdf5::${hdf5_comp})
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)