Skip to content

Commit e248570

Browse files
committed
fix: disable Qt versionless targets to silence IMPORTED_LOCATION codemodel errors
Conan ships the Qt host tools as a single RelWithDebInfo config, so the versionless Qt:: tool targets only carry a config-less IMPORTED_LOCATION. On non-Release builds the IDE CMake file-API codemodel then reports "IMPORTED_LOCATION not set ... configuration <cfg>" for each of them. The project already references Qt solely through the versioned Qt6:: targets, so suppress the versionless aliases entirely via QT_NO_CREATE_VERSIONLESS_TARGETS.
1 parent b77659f commit e248570

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

CMake/Common.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,9 @@ if (${MSVC})
2929
NOMINMAX=1
3030
)
3131
endif ()
32+
33+
# This project and its downstream consumers reference Qt only through the versioned Qt6:: targets. Suppressing the
34+
# versionless Qt:: aliases stops the single-config Qt host tools from triggering "IMPORTED_LOCATION not set ...
35+
# configuration <cfg>" errors in the IDE file-API codemodel on non-Release builds, where they only carry a Release
36+
# import while Debug/RelWithDebInfo/MinSizeRel are mapped onto it.
37+
set(QT_NO_CREATE_VERSIONLESS_TARGETS TRUE)

0 commit comments

Comments
 (0)