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

Import libraries not specified for debug version

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.4.0
    • Build System: CMake
    • None
    • Windows

    Description

      After building the project from the git sources for MSVC, the release version can be used in cmake projects as expected, the debug version complains about the IMPORTED_IMPLIB and IMPORTED_LOCATION target properties not being set:

       

      ...
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_IMPLIB not set for imported target "Qt6::Core" configuration
      1> [CMake] "Debug".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_IMPLIB not set for imported target "Qt6::Gui" configuration
      1> [CMake] "Debug".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_IMPLIB not set for imported target "Qt6::Core" configuration
      1> [CMake] "Release".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_IMPLIB not set for imported target "Qt6::Gui" configuration
      1> [CMake] "Release".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_IMPLIB not set for imported target "Qt6::Core" configuration
      1> [CMake] "MinSizeRel".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_IMPLIB not set for imported target "Qt6::Gui" configuration
      1> [CMake] "MinSizeRel".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_IMPLIB not set for imported target "Qt6::Core" configuration
      1> [CMake] "RelWithDebInfo".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_IMPLIB not set for imported target "Qt6::Gui" configuration
      1> [CMake] "RelWithDebInfo".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_LOCATION not set for imported target "Qt6::Core" configuration
      1> [CMake] "Debug".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_LOCATION not set for imported target "Qt6::Core" configuration
      1> [CMake] "Release".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_LOCATION not set for imported target "Qt6::Core" configuration
      1> [CMake] "MinSizeRel".
      1> [CMake] 
      1> [CMake] 
      1> [CMake] CMake Error in D:\path\to\my\CMakeLists.txt:
      1> [CMake] IMPORTED_LOCATION not set for imported target "Qt6::Core" configuration
      1> [CMake] "RelWithDebInfo".

       

      The notable difference in the CMake directories that seem to be relevant is the lack of a per-configuration export script being installed:

      release-install-prefix\lib\cmake\Qt6Core\Qt6CoreTargets-release.cmake is present

      debug-install-prefix\lib\cmake\Qt6Core\Qt6CoreTargets-debug.cmake is missing though. (install_manifest.txt s are attached)

       

      The build was done from the same sources, but using different build/install directories

       

      CMake Version 3.22

      Visual Studio Community 17.2.5

      Ninja 1.10.2

      The build was configured via

      ../qt5/configure.bat <options>

      command run from the build directory; for the options, see the attached config.release.opt and config.debug.opt files; those were the files written to as configure.opt to the build directory (note: install manifests paths were replaced; the actual paths did match the ones provided via -prefix option).

      Command to build:

      cmake --build . --parallel

      Command to install:

      cmake --install .

      Note: at least for one of the builds I needed to repeat the `cmake --build .` call since an the build aborted because one of the build steps failed; calling the build command again did seem to result in a successful completion of the build process in the end though.

      All the steps were run from "x64 Native Tools Command Prompt for VS 2022" without any additional modifications of the environment before the build.

       

      Attachments

        1. qt-install_manifest-release.txt
          1.14 MB
        2. qt-install_manifest-debug.txt
          1.10 MB
        3. config.debug.opt
          0.0 kB
        4. config.release.opt
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            abc3 Fabian Klein
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes