Comments (7)
The second command (ament build_pkg . --cmake-args -DCMAKE_BUILD_TYPE=Debug -- --force-cmake-configure
) is the "correct" way of entering an argument group to --cmake-args
. It sounds like you're expecting extract_argument_group
to find the next delimiter for you.
I think this convention for disambiguating arguments is fairly common, although I would ask @wjwwood for more information about why this method for argument parsing was chosen. I think the main reason for requiring the extra delimiter is if ament and CMake happen to accept some of the same flags, then it's ambiguous which flags after --cmake-args
are being passed to ament and which are passed to CMake.
from ament_tools.
This is a common limitation of argparse. To avoid the extra delimiter you can pass all other arguments before "catch all" options like --cmake-args.
So in your case the following will work:
ament build . --force-cmake-configure --cmake-args -DCMAKE_BUILD_TYPE=Release
If nobody objects I would close this as wontfix
since there is nothing we can do to change how argparse
works.
from ament_tools.
Ok, thanks for the info
I guess it took me by surprise because the majority of time I had been passing multiple arguments without a problem.
I realise now that I must have just been 'lucky' in the sense that I wasn't using an argument that extract_argument_group
ever detected, or that when I was, that argument group was at the end (indeed ament build . --force-cmake-configure --cmake-args -DCMAKE_BUILD_TYPE=Debug
works fine).
Probably no need to keep this issue open then - documentation will explain it one day if not already and I just missed it. I might add a bit to the 'Tips' section of https://github.com/ros2/ros2/wiki/Ament-Tutorial if I've understood the situation correctly
from ament_tools.
thanks @dirk-thomas, didn't see that you had already replied. I've edited the tutorial.
from ament_tools.
Well we could change it so that ament build . --cmake-args -DCMAKE_BUILD_TYPE=Debug --force-cmake-configure
would work, by closing the --cmake-args
list of arguments whenever --
OR any known command line arguments are encountered, but that would make it impossible to pass --force-cmake-configure
as an option to CMake via the --cmake-args
, which is obviously not desired, but there are other less obvious arguments that might exist for both, e.g. -v
or something like that.
I agree there's nothing to change here other than documentation.
from ament_tools.
For what it's worth this is mentioned in the -h
:
--cmake-args [CMAKE_ARGS [CMAKE_ARGS ...]]
Arbitrary arguments which are passed to all CMake
projects. Argument collection can be terminated with
'--'.
But I understand that it isn't immediately obvious.
from ament_tools.
The tutorial changes lgtm, thanks @dhood. I'll close this for now, but feel free to continue discussion and we can reopen if necessary.
from ament_tools.
Related Issues (20)
- changing ament install prefix doesn't change the cmake install prefix HOT 2
- uninstalling after installing to a different directory HOT 5
- uninstall verb fails HOT 1
- We should validate ament_cmake packages after installation HOT 6
- Sourcing overlay workspace's setup file isn't enough for python packages HOT 2
- ament build_pkg doesn't respect other verbs HOT 10
- assert that ament_cmake packages register in the ament_index HOT 2
- No setup.bash for --isolated compilation HOT 2
- Add error summary at the end of `ament test` HOT 4
- Proposal: make `ament test` return non-zero on test failure HOT 5
- Parallel build waiting for package forever HOT 1
- Symlinked overlay installation doesn't have preference for ament_python packages HOT 8
- option to build only a package and its dependencies HOT 6
- Build of package on windows hangs sometimes HOT 2
- Because of unquoted path ament fails on Windows HOT 3
- ament build fails to find solution file when cmake project name differs from package manifest name HOT 4
- Test Report Generation for ament test tools HOT 2
- SyntaxError when building pure Python package with Extension HOT 6
- Failed to compile extension due to out-of-source build HOT 5
- python3-pytest doesn't support option "-o" and it results in error while running python unittest of a ros2 component HOT 5
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 ament_tools.