Comments (2)
Ah that makes sense, I hadn't considered the LLVM project when I created the target names. To not break existing workflows, perhaps it would make sense to add an option CMAKE_FORMAT_PREFIX
that adds a prefix to the target names to avoid such collisions?
Thanks for raising the issue!
from format.cmake.
I have the same issue, triggered by find_package(Clang)
CMake Error at /usr/lib/llvm-10/lib/cmake/clang/ClangTargets.cmake:37 (message):
Some (but not all) targets in this export set were already defined.
Targets Defined: clang-format
My current fix is to add CPMAddPackage("gh:TheLartians/[email protected]")
at the end of my CMakeLists.txt
, after the find_package(Clang)
statement. Adding a CMAKE_FORMAT_PREFIX
option would work, but I believe you should ultimately change the default name of the target (such name collision can happen really easily).
from format.cmake.
Related Issues (13)
- Fix failure on systems with only Python 3.x HOT 2
- Update About to mention cmake-format HOT 1
- How to exclude subdirectories? HOT 4
- Add more information about `CMAKE_FORMAT_EXCLUDE` HOT 2
- Format.cmake directory path appears in the list of cmake-format arguments
- CI failing with `cmake --build build --target check-format`, complains about CPM.cmake even though it is excluded HOT 3
- Check Format Fails on Windows HOT 10
- Proto files get formatted with 4 spaces instead of the default recommendation of 2 spaces HOT 1
- fix-format and check-format does not give same result HOT 1
- Respect Skipping CMake Formatting Based on Setting in Top Level Project HOT 3
- `clang-format` target conflicts with other libraries HOT 1
- How to ignore file mode in check format? HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from format.cmake.