Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.1.2, 6.2.3, 6.3.0
-
None
-
QtCreator v4.15.1
cmake version 3.20.5
-
-
c0188b2dbd (qt/qtbase/dev) c0188b2dbd (qt/tqtc-qtbase/dev) b5254073fd (qt/qtbase/6.3) b5254073fd (qt/tqtc-qtbase/6.3) b5254073fd (qt/qtbase/6.3.1)
Description
When building a simple library project with "install" target:
CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(Test)
add_library(Test STATIC test.cpp)
install(TARGETS Test DESTINATION "${PROJECT_BINARY_DIR}/expexted_install_dir")
test.cpp
class Test{
};
...then the binaries are not copied because the build type is changed to "Debug-iphoneos" instead of a plain "Debug" but several CMake generated files don't support that name:
- cmake_install.cmake
"${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Dd][Ee][Bb][Uu][Gg])$"
- Debug-iphoneos/install.build/Script-93426DA6A4AC2C2AC9CE883C.sh
/Applications/CMake.app/Contents/bin/cmake -DBUILD_TYPE=$CONFIGURATION$EFFECTIVE_PLATFORM_NAME -P cmake_install.cmake
CMake by default handles EFFECTIVE_PLATFORM_NAME correctly because building the project for iOS without Qt works correctly and the install script is generated differently where DBUILD_TYPE and DEFFECTIVE_PLATFORM_NAME are separated:
- Debug-iphoneos/install.build/Script-93426DA6A4AC2C2AC9CE883C.sh
/Applications/CMake.app/Contents/bin/cmake -DBUILD_TYPE=$CONFIGURATION -DEFFECTIVE_PLATFORM_NAME=$EFFECTIVE_PLATFORM_NAME -P cmake_install.cmake
So it must be in the way Qt configures CMake and I narrowed it down to the following argument. It is caused by CMAKE_TOOLCHAIN_FILE
CMAKE_TOOLCHAIN_FILE Qt/6.1.2/ios/lib/cmake/Qt6/qt.toolchain.cmake
...but could not go deeper anymore.
Attachments
Issue Links
- is required for
-
QTBUG-95838 Improve experience of building iOS projects with CMake
- Closed
- relates to
-
QTBUG-93268 target_link_libraries does not work with a target name on iOS
- Closed