forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hdf5] Use cmake wrapper to ensure consuming libraries link to szip (m…
…icrosoft#5467) * [hdf5] Use cmake wrapper to ensure consuming libraries link to szip in static build * [hdf5] Move hdf5 cmake code from vcpkg.cmake to vcpkg-cmake-wrapper * [hdf5] Do not force search in config mode * [hdf5] balance needs of vtk and kealib
- Loading branch information
Showing
3 changed files
with
35 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
if (NOT PROJECT_NAME STREQUAL "VTK") | ||
_find_package(${ARGS} CONFIG) | ||
# Fill in missing static/shared targets | ||
foreach(HDF5TARGET hdf5 hdf5_hl hdf5_cpp hdf5_hl_cpp) | ||
if(TARGET hdf5::${HDF5TARGET}-static AND NOT TARGET hdf5::${HDF5TARGET}-shared) | ||
_add_library(hdf5::${HDF5TARGET}-shared INTERFACE IMPORTED) | ||
set_target_properties(hdf5::${HDF5TARGET}-shared PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-static") | ||
elseif(TARGET hdf5::${HDF5TARGET}-shared AND NOT TARGET hdf5::${HDF5TARGET}-static) | ||
_add_library(hdf5::${HDF5TARGET}-static INTERFACE IMPORTED) | ||
set_target_properties(hdf5::${HDF5TARGET}-static PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-shared") | ||
endif() | ||
endforeach() | ||
else () | ||
_find_package(${ARGS}) | ||
endif() | ||
|
||
if("static" STREQUAL "static") | ||
find_package(SZIP CONFIG REQUIRED) | ||
foreach(HDF5TARGET hdf5 hdf5_hl hdf5_cpp hdf5_hl_cpp) | ||
if(TARGET hdf5::${HDF5TARGET}-static) | ||
if (TARGET szip-shared) | ||
set_property(TARGET hdf5::${HDF5TARGET}-static APPEND PROPERTY INTERFACE_LINK_LIBRARIES szip-shared) | ||
else () | ||
set_property(TARGET hdf5::${HDF5TARGET}-static APPEND PROPERTY INTERFACE_LINK_LIBRARIES szip-static) | ||
endif () | ||
endif() | ||
endforeach() | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters