-
Notifications
You must be signed in to change notification settings - Fork 1k
cmake build fails if more than one build_sketch definition is used #2282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@massonal any input for this? Did you try build with several sketches? Thanks. |
Hello, IIRC Unfortunately, this means than no more than one sketch is supported per CMake project. I think it's possible to change the name of the conventional targets to include some sketch-specific prefix. If you're interested in developing this, please feel free! - assuming @fpistm agrees on the idea ;) |
The targets that cause a clash seem to be more dependant on the variant selected and this is controlled by set_board and should not really change on a per sketch basis. I thin redefining them in each sketch is the issue. |
You're right. I have studied the issue in a bit more depth, and the limitation you're running into is that each variant has its own CMakeLists.txt file which defines a target named The simplest solution is, I think, to move the
|
Moving the |
Hey, I'm glad this solution works for you. Also, I did not know about Do you want to implement these changes and propose a pull request? |
@massonal I just noticed another issue in I will get a pull request together with these changes.
|
I am trying to build multiple sketches using a project wide CMakeLists.txt file. If I call the build_sketch() function with each of the targets then cmake reports an error about duplicated targets:
I have tried various cmake property settings but the error persists. I was able to get the builds to work by putting an
if (NOT TARGET variant)
guard around the add_subdirectory calls in build_sketch.cmake.If there is a better solution then I would love to know otherwise I can submit a pull request.
The text was updated successfully, but these errors were encountered: