Unable to configure libtiff with CMake 3.21 when building for iOS
Summary
When attempt to configure libtiff with CMake 3.21+ for iOS, the configuration step fails due to the install(TARGETS)
command within the libtiff/CMakeLists.txt missing the BUNDLE DESTINATION argument.
With CMake 3.21, it now errors when attempting to install a target with the MACOSX_BUNDLE property set to true: https://cmake.org/cmake/help/latest/policy/CMP0006.html
Now when configuring for iOS, by default the CMAKE_MACOSX_BUNDLE Cache variable is set to TRUE
This causes the cmake configuration step to fail with the following error
install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
Version
master branch as of commit 788c5f24 (latest version tag is v4.3.0rc1
)
Steps to reproduce
- Configure for iOS
cmake -S temp/src -B temp/build -G Xcode -DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_C_FLAGS="-fPIC" \
-DBUILD_SHARED_LIBS=OFF
- Notice the configuration fails
A workaround to the issue is by supplying the -DCMAKE_MACOSX_BUNDLE=OFF
parameter when configuring
Platform
MacOS Catalina 10.15.7 x86_64