colcon / colcon-cmake

Extension for colcon to support CMake packages
http://colcon.readthedocs.io
Apache License 2.0
16 stars 25 forks source link

fix help how to pass CMake args on Windows #6

Closed sloretz closed 6 years ago

sloretz commented 6 years ago

Platform: windows 10 Shell: cmd Installed via pip (freeze below)

The documentation for --cmake-args says arugments beginning with - must have an escaped space in front. It looks like escaping a space does not stop colcon's argument parser from trying to parse the cmake argument using the cmd shell on windows.

D:\overlay-ros2>colcon build --cmake-args \ -DCMAKE_BUILD_TYPE=Debug
usage: colcon [-h] [--log-level LOG_LEVEL]
              {build,extension-points,extensions,info,list,metadata,test,test-result}
              ...
colcon: error: unrecognized arguments: -DCMAKE_BUILD_TYPE=Debug

Quoting a space in front of the cmake argument works fine.

D:\overlay-ros2>colcon build --cmake-args " -DCMAKE_BUILD_TYPE=Debug"

Installed versions

C:\Users\osrf>pip freeze
attrs==17.4.0
colcon-cmake==0.1.1
colcon-common-extensions==0.1.1
colcon-core==0.1.0
colcon-defaults==0.1.0
colcon-devtools==0.1.0
colcon-library-path==0.1.0
colcon-metadata==0.1.0
colcon-notification==0.1.1
colcon-output==0.1.1
colcon-package-information==0.1.0
colcon-package-selection==0.1.0
colcon-parallel-executor==0.1.0
colcon-powershell==0.1.0
colcon-python-setup-py==0.1.0
colcon-recursive-crawl==0.1.0
colcon-ros==0.1.0
colcon-test-result==0.1.0
colorama==0.3.9
coloredlogs==9.0
coverage==4.5.1
cycler==0.10.0
empy==3.3.2
enum34==1.1.6
flake8==3.5.0
flake8-blind-except==0.1.1
flake8-builtins==1.0.post0
flake8-class-newline==1.6.0
flake8-comprehensions==1.4.1
flake8-deprecated==1.3
flake8-docstrings==1.3.0
flake8-import-order==0.17
flake8-polyfill==1.0.2
flake8-quotes==0.14.0
humanfriendly==4.10
matplotlib==2.0.2
mccabe==0.6.1
mock==2.0.0
nose==1.3.7
numpy==1.13.1
pbr==3.1.1
pep8==1.7.1
pluggy==0.6.0
py==1.5.2
pycodestyle==2.3.1
pydocstyle==2.1.1
pyflakes==1.6.0
pyparsing==2.2.0
pypiwin32==223
pyreadline==2.1
pytest==3.4.1
pytest-cov==2.5.1
pytest-runner==4.0
python-dateutil==2.6.1
pytz==2017.2
pywin32==223
PyYAML==3.12
six==1.10.0
snowballstemmer==1.2.1
trollius==2.1
vcstool==0.1.32
mikaelarguedas commented 6 years ago

Can you try quoting the argument? colcon build --cmake-args " -DCMAKE_BUILD_TYPE=Debug" (from the windows nightly console output https://ci.ros2.org/view/nightly/job/nightly_win_deb/860)

Edit: Oh I missed the end of the comment, sorry about that

dirk-thomas commented 6 years ago

Addressed by the referenced PRs.