MantisBT - CMake
View Issue Details
0014861CMakeCMakepublic2014-04-03 12:122016-06-10 14:31
irwin 
Kitware Robot 
normalminoralways
closedmoved 
Both Linux and Windows
CMake 2.8.12.2 
 
0014861: cmake consumes command-line arguments it does not understand without a WARNING message
The commands

cmake -whatever ..

or

cmake whatever ..

currently work fine with no warning messages at all about the "-whatever" and "whatever" arguments that it ignores. I believe I ran into this issue years ago so it is probably a long-standing bug that has long been tolerated, but from recent rather bizarre experience as a result of this bug that I just learned about, I think this bug should be addressed.

What happened is one of our knowlegeable PLplot users could not get the cmake command-line to work properly on a Windows platform. After a lot of head-scratching and nobody getting anywhere with this, it turned out he was taking notes using Microsoft Word, and cut and pasted from that to the command-line. Unfortunately, Microsoft word had quietly inserted a non-ascii hyphen in that command-line so all the -D options did not have the correct hyphen and were quietly ignored because of this CMake bug! Instead, cmake should have given loud warnings that it could not understand parts of his command line.
Create a CMakeLists.txt file consisting of the following two lines:

cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR)
project(test_cmake NONE)

Then create an empty build subdirectory, cd to it, and try either
one of the above cmake commands (or try specifying some -D options
with non-ascii hyphens). The (bad) result is there are no warning messages about the parts of the command line that cmake could not understand.
No tags attached.
Issue History
2014-04-03 12:12irwinNew Issue
2014-04-03 12:50Brad KingNote Added: 0035632
2014-04-03 12:50Brad KingStatusnew => backlog
2016-06-10 14:29Kitware RobotNote Added: 0042527
2016-06-10 14:29Kitware RobotStatusbacklog => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0035632)
Brad King   
2014-04-03 12:50   
This is known, and major internal refactoring of how the command line is processed will be needed to fix it. The problem is that we basically just pass all the arguments to everything that might need them and each place just uses what it knows and ignores the rest.
(0042527)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.