[cmake-developers] [CMake 0012361]: Undesirable cmake path behavior, ill defined usage

Mantis Bug Tracker mantis at public.kitware.com
Wed Jul 27 11:56:19 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=12361 
====================================================================== 
Reported By:                Christopher Sean Morrison
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12361
Category:                   CMake
Reproducibility:            always
Severity:                   feature
Priority:                   low
Status:                     new
====================================================================== 
Date Submitted:             2011-07-27 11:56 EDT
Last Modified:              2011-07-27 11:56 EDT
====================================================================== 
Summary:                    Undesirable cmake path behavior, ill defined usage
Description: 
cmake usage lists two separate meanings of the path specified as either
path-to-source or path-to-existing-build.  On more than one occasion, our users
have encountered unexpected (and undesirable) behavior where the path they
specified was a path-to-source, yet they got the latter path-to-existing-build
behavior.

The usage is ill-defined in the sense that you cannot know which usage was
intended by the user which invariably leads to unexpected behavior if a build
was (at any point in time) performed in the source directory.  Sure, out of
source builds are better and recommended and documented as such, but if project
developers merely occasionally ensure that in-source builds work for the sake of
their non-educated users, they run into this usability problem.

As the latter path-to-existing build "feature" merely saves the caller from
changing their directory, e.g., "cd path-to-existing-build; cmake .", I'd
propose/request that the usage be simplified to the single unambiguous usage
case of the path always meaning path-to-source.

That simplified usage improves usability by making the path behavior
deterministic.  Cmake doesn't have to inspect the contents of the path to infer
that it was a source or build directory, and consequently would allow a use case
(in-dir builds alongside out-of-dir builds) that presently is not possible.


Steps to Reproduce: 
cd source
cmake .
make
mkdir .build
cd .build
cmake ..
# files output to the "wrong" directory since there was a CMakeCache.txt in the
source dir.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-07-27 11:56 Christopher Sean MorrisonNew Issue                             
      
======================================================================




More information about the cmake-developers mailing list