Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-95381

CMake library install target does not copy binaries on iOS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.1.2
    • Fix Version/s: None
    • Component/s: Build System: CMake
    • Labels:
      None
    • Environment:
      QtCreator v4.15.1

      cmake version 3.20.5
    • Platform/s:
      iOS/tvOS/watchOS

      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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              qtbuildsystem Qt Build System Team
              Reporter:
              kiibimees Lauri Laanmets
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes