Files
test/extern/draco/CMakeLists.txt
Jonas Holzman c08d42aebf macOS: Support Xcode Archiving for distributing application bundles
This is a port of iOS commit f3f8647 to main, for Xcode archiving to
also work for macOS bundles, allowing the bundle to be archived and
later distributed via Testflight, App Store Connect, etc...

Additonal Xcode property also had to be added to the extern draco shared
library target to prevent it from being included in the Xcode archive
(an implicit behavior for `SHARED` CMake libraries), without this,
the archive would get polluted, preventing it from being properly
recognized as a proper app bundle archive.

Pull Request: https://projects.blender.org/blender/blender/pulls/146027
2025-09-23 20:56:18 +02:00

42 lines
1.0 KiB
CMake

# SPDX-FileCopyrightText: 2019 Blender Foundation
#
# SPDX-License-Identifier: GPL-2.0-or-later
# Build Draco library.
add_subdirectory(draco)
set(INC
draco/src
)
# Build Draco-Blender bridging module.
set(SRC
src/common.cpp
src/decoder.cpp
src/encoder.cpp
src/common.h
src/decoder.h
src/encoder.h
)
set(LIB
draco
)
add_library(extern_draco SHARED "${SRC}")
target_include_directories(extern_draco PUBLIC "${INC}")
target_link_libraries(extern_draco PUBLIC "${LIB}")
blender_source_group(extern_draco "${SRC}")
if (APPLE)
# On macOS, prevent the draco library (already present in the application bundle) from being wrongly copied into the
# Xcode archive used for application distribution, which pollutes the archive and prevents it from being properly
# recognized. This effectively corrects a bad implicit CMake behavior for `SHARED` library targets on Xcode.
set_target_properties(extern_draco PROPERTIES
XCODE_ATTRIBUTE_SKIP_INSTALL "YES"
XCODE_ATTRIBUTE_INSTALL_PATH ""
)
endif()