Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-27201

Not all target_link_directories used for "Add build library search path to PATH"

    XMLWordPrintable

Details

    • 06703e17d4 (qt-creator/qt-creator/7.0) 06703e17d4 (qt-creator/qt-creator/master) 06703e17d4 (qt-creator/qt-creator/qds-3.3) 06703e17d4 (qt-creator/tqtc-qt-creator/7.0)

    Description

      On Windows there is the situation that for build time linking the .lib file is needed, but for runtime linking the .dll file is needed.

      A 3rdparty library that a project links to can have the .dll in a different location than the .lib file, which results in "Add build library search path to PATH" adding the path to the .lib file, but not to the actually required .dll file.

      A workaround is of course to manually add the path to the PATH in the run configuration settings.

      It would be nicer to be able to just add the path in a target_link_directories call (even though not needed for building), but Qt Creator does not pick arbitrary directories there up for the "Add build library search path".

      With "target_link_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/sharedLib/dll)" the file-api response for the target contains

      {
          "backtrace" : 3,
          "fragment" : "-LIBPATH:C:\\work\\tickets\\00424726\\printSharedLib\\UsesSharedLib\\sharedLib\\dll",
          "role" : "libraryPath"
      },
      

      but that is not read/parsed by Qt Creator.

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-27201
        # Subject Branch Project Status CR V

        Activity

          People

            con Eike Ziller
            con Eike Ziller
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes