diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index 8cb18127366958..c3daa6c109eb03 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -55,6 +55,7 @@ vcpkg_cmake_configure( -DPROVIDE_UNINSTALL_TARGET=OFF -DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT_VALUE} -DLIB_SUFFIX=${LIB_SUFFIX} + -DIOS_DEPLOYMENT_TARGET=15 ) vcpkg_cmake_install() diff --git a/ports/opencv4/portfile.cmake b/ports/opencv4/portfile.cmake index 5694c5c53e55c4..c4402da44685a4 100644 --- a/ports/opencv4/portfile.cmake +++ b/ports/opencv4/portfile.cmake @@ -359,6 +359,12 @@ if("contrib" IN_LIST FEATURES) endif() endif() +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "visionOS") + list(APPEND ADDITIONAL_BUILD_FLAGS "-DIOS=1") + list(APPEND ADDITIONAL_BUILD_FLAGS "-DWITH_AVFOUNDATION=OFF") + list(APPEND ADDITIONAL_BUILD_FLAGS "-DBUILD_opencv_videoio=OFF") +endif() + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index 58730a89780d14..53be0f11f0ec20 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -9,6 +9,8 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(VCPKG_TARGET_IS_OSX ON) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS") set(VCPKG_TARGET_IS_IOS ON) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "visionOS") + set(VCPKG_TARGET_IS_IOS ON) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") set(VCPKG_TARGET_IS_LINUX ON) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") diff --git a/triplets/community/arm64-ios-iphonesimulator.cmake b/triplets/community/arm64-ios-iphonesimulator.cmake new file mode 100644 index 00000000000000..b8538be1a33b69 --- /dev/null +++ b/triplets/community/arm64-ios-iphonesimulator.cmake @@ -0,0 +1,10 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME iOS) +set(VCPKG_OSX_DEPLOYMENT_TARGET 15.0) +set(VCPKG_BUILD_TYPE release) +execute_process(COMMAND xcodebuild -version -sdk iphonesimulator Path + OUTPUT_VARIABLE VCPKG_OSX_SYSROOT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) diff --git a/triplets/community/arm64-ios-xros.cmake b/triplets/community/arm64-ios-xros.cmake new file mode 100644 index 00000000000000..08a625ccf95513 --- /dev/null +++ b/triplets/community/arm64-ios-xros.cmake @@ -0,0 +1,11 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME visionOS) +set(VCPKG_OSX_DEPLOYMENT_TARGET 1.0) +set(VCPKG_BUILD_TYPE release) +execute_process(COMMAND xcodebuild -version -sdk xros Path + OUTPUT_VARIABLE VCPKG_OSX_SYSROOT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/scripts/toolchains/ios.cmake) diff --git a/triplets/community/arm64-ios-xrsimulator.cmake b/triplets/community/arm64-ios-xrsimulator.cmake new file mode 100644 index 00000000000000..5b4604f0c74683 --- /dev/null +++ b/triplets/community/arm64-ios-xrsimulator.cmake @@ -0,0 +1,11 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME visionOS) +# set(VCPKG_OSX_DEPLOYMENT_TARGET 1.0) # Setting this breaks simulator builds due to a bug in CMake +set(VCPKG_BUILD_TYPE release) +execute_process(COMMAND xcodebuild -version -sdk xrsimulator Path + OUTPUT_VARIABLE VCPKG_OSX_SYSROOT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/scripts/toolchains/ios.cmake)