EXPORT
cmake
config_error
ai_generated
true
CMake Error: install EXPORT target conflicts with existing
ID: cmake/export-target-conflict
80%Fix Rate
84%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3 | active | — | — | — |
Root Cause
CMake export/install target name conflicts.
genericWorkarounds
-
90% success Use unique namespace for export: install(EXPORT FooTargets NAMESPACE Foo::)
-
88% success Check for existing targets before defining: if(NOT TARGET Foo::Bar)
Dead Ends
Common approaches that don't work:
-
Use FORCE to override
78% fail
May break dependent projects
-
Skip install entirely
72% fail
Package not distributable