From fa690e7b43632ede6f8bb1306d4317a91600fdd8 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 17 Mar 2026 10:45:49 -0500 Subject: [PATCH] Only export targets to build tree if cross-compiling --- CMakeInstallation.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 05f86878..951be7cd 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -34,12 +34,14 @@ endif () #) #----------------------------------------------------------------------------- -# Export all exported targets to the build tree for use by parent project +# If cross-compiling, export all exported targets to the build tree #----------------------------------------------------------------------------- -export ( - TARGETS ${HDF5_VOL_REST_LIBRARIES_TO_EXPORT} ${HDF5_VOL_REST_LIB_DEPENDENCIES} - FILE ${HDF5_VOL_REST_PACKAGE}${HDF5_VOL_REST_PACKAGE_EXT}-targets.cmake -) +if (CMAKE_CROSSCOMPILING) + export ( + TARGETS ${HDF5_VOL_REST_LIBRARIES_TO_EXPORT} ${HDF5_VOL_REST_LIB_DEPENDENCIES} + FILE ${HDF5_VOL_REST_PACKAGE}${HDF5_VOL_REST_PACKAGE_EXT}-targets.cmake + ) +endif () #----------------------------------------------------------------------------- # Set includes needed for build