From f1cacaa8304860c9db4ee5a469518a1a25e60e43 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 15 Apr 2024 14:01:33 -0400 Subject: Tests/RunCMake/CMakePackage: Define variable closer to where it is used --- Tests/RunCMake/CMakePackage/RunCMakeTest.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake b/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake index 1551b55..848c36d 100644 --- a/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake @@ -48,9 +48,6 @@ if(APPLE) endif() if(APPLE AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang") - set(apple_install ${RunCMake_BINARY_DIR}/apple-install) - file(REMOVE_RECURSE "${apple_install}") - if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 12) set(macos_archs "x86_64;arm64") set(tvos_sim_archs "x86_64;arm64") @@ -78,6 +75,10 @@ if(APPLE AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang") set(enable_visionos 1) endif() + # Place all export/import steps in a single install prefix. + set(apple_install ${RunCMake_BINARY_DIR}/apple-install) + file(REMOVE_RECURSE "${apple_install}") + apple_export(macos Darwin "${macos_archs}" macosx) apple_export(ios iOS "arm64" iphoneos) apple_export(tvos tvOS "arm64" appletvos) -- cgit v0.12