MantisBT - CMake
View Issue Details
0012641CMakeCMakepublic2011-12-26 13:062016-06-10 14:31
kesten 
Kitware Robot 
normalminoralways
closedmoved 
intel core i5 x86-64linuxubuntu 11.10
CMake 2.8.6 
 
0012641: cmake --build is ignored when combined with CMake's configure+generate step, please warn if --build ignored
Please issue a warning if "--build" is not honored.


with PROJECT_SOURCE_DIR = home/kesten/VersionControlProjects/Bazaar/Engines/Bullet/bullet-trunk/trunk

PROJECT_SOURCE_DIR$ cmake -G "Unix Makefiles" --build ../../cmake-build-svn-trunk

-- Build files have been written to: /home/kesten/VersionControlProjects/Bazaar/Engines/Bullet/bullet-trunk/trunk

If I supply a "." to take the place of path-to-source-dir then it works

PROJECT_SOURCE_DIR$ cmake -G "Unix Makefiles" --build ../../cmake-build-svn-trunk .

Expected Behaviour:
cmake can run with no paths given. cmake --build <dir> should put build files in <dir>. At the least, a warning should be issued that --build was ignored because cmake expected: cmake --build <dir> path-to-source (use "." for dir that cmake is issued from)
run cmake --build <dir> without specifying path-to-source or build-dir after <dir>

No tags attached.
Issue History
2011-12-26 13:06kestenNew Issue
2011-12-27 19:12David ColeNote Added: 0028075
2011-12-27 19:15David ColeSummarycmake --build <dir> confuses cmake. <dir> is treated as source to path or source to build dir => cmake --build is ignored when combined with CMake's configure+generate step, please warn if --build ignored
2011-12-27 19:15David ColeDescription Updatedbug_revision_view_page.php?rev_id=476#r476
2012-08-11 21:09David ColeStatusnew => backlog
2012-08-11 21:09David ColeNote Added: 0030342
2016-01-17 17:12Ashley WhetterNote Added: 0040252
2016-06-10 14:28Kitware RobotNote Added: 0041948
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0028075)
David Cole   
2011-12-27 19:12   
That's not the way "cmake --build" is intended to be used. Try this instead:

PROJECT_SOURCE_DIR = home/kesten/VersionControlProjects/Bazaar/Engines/Bullet/bullet-trunk/trunk

PROJECT_BUILD_DIR = ${PROJECT_SOURCE_DIR}/../../cmake-build-svn-trunk

PROJECT_SOURCE_DIR$ mkdir ../../cmake-build-svn-trunk
PROJECT_SOURCE_DIR$ cd ../../cmake-build-svn-trunk

PROJECT_BUILD_DIR$ cmake -G "Unix Makefiles" ../bullet-trunk/trunk
PROJECT_BUILD_DIR$ cmake --build .

CMake cannot be run with no paths given. You have to run "cmake source_dir" with the build_dir as the current directory for the initial configure. On subsequent configures, you can run "cmake ." in the build tree to re-run cmake's configure+generate steps, and then "cmake --build ." in the build tree to build.


"At the least, a warning should be issued that --build was ignored..." -- this is a good idea. I'll leave the bug open and change the title to request a warning when "--build" is not honored. I'd have to look at the source to be 100% certain, but I think it is only honored if it is the very first argument to cmake.
(0030342)
David Cole   
2012-08-11 21:09   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0040252)
Ashley Whetter   
2016-01-17 17:12   
I've submitted an idea for patch for this: http://public.kitware.com/pipermail/cmake-developers/2016-January/027496.html [^]
(0041948)
Kitware Robot   
2016-06-10 14:28   
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.