Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
Qt Creator 7.0.0-rc1
-
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.