View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006945CMakeCMakepublic2008-05-02 12:032008-08-19 15:43
ReporterDan Thill 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0006945: cmake -E chdir processes arguments improperly when arguments match cmake args
DescriptionCommandline arguments which match those of cmake are not passed to the program. Instead, they are intercepted by cmake and the program is not run.

$ cmake -E chdir / ls --help
cmake version 2.4-patch 8
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>

Command-Line Options
  -C <initial-cache> = Pre-load a script to populate the cache.
  -D <var>:<type>=<value> = Create a cmake cache entry.
  -G <generator-name> = Specify a makefile generator.

[snip]

Verified on Linux and Windows, on both 2.4.3 and 2.4.8.

Additional InformationThis was discovered when I was attempting to add a test case which tested my executable's --help output, e.g.:

ADD_TEST( HelpTest ${CMAKE_COMMAND} -E chdir Prog.exe --help )

WORKAROUND:

Write a CMake script (containing EXECUTE_PROCESS) and test that script instead.

ADD_TEST( HelpTest ${CMAKE_COMMAND} -S HelpTest.cmake )
TagsNo tags attached.
Attached Files

 Relationships
related to 0009965closed cmake -E chdir consumes command arguments when they match cmake arguments 

  Notes
(0011675)
Dan Thill (reporter)
2008-05-02 12:16

Oops. The line should read:

ADD_TEST( HelpTest ${CMAKE_COMMAND} -E chdir /working/dir Prog.exe --help )
(0013081)
Bill Hoffman (manager)
2008-08-19 15:43

cvs commit -m "BUG: fix 6647 arguments after -E should not be parsed by CMake"


Committer: Bill Hoffman <bill.hoffman@kitware.com>
/cvsroot/CMake/CMake/Source/cmDocumentation.cxx,v <-- cmDocumentation.cxx
new revision: 1.71; previous revision: 1.70
/cvsroot/CMake/CMake/Source/cmDocumentation.h,v <-- cmDocumentation.h
new revision: 1.34; previous revision: 1.33
/cvsroot/CMake/CMake/Source/cmakemain.cxx,v <-- cmakemain.cxx
new revision: 1.84; previous revision: 1.83

 Issue History
Date Modified Username Field Change
2008-05-02 12:03 Dan Thill New Issue
2008-05-02 12:16 Dan Thill Note Added: 0011675
2008-08-19 15:43 Bill Hoffman Status new => closed
2008-08-19 15:43 Bill Hoffman Note Added: 0013081
2008-08-19 15:43 Bill Hoffman Resolution open => fixed
2009-11-24 20:14 Bill Hoffman Relationship added related to 0009965


Copyright © 2000 - 2018 MantisBT Team