MantisBT - CMake
View Issue Details
0015257CMakeCMakepublic2014-11-19 14:032016-06-10 14:31
Javier 
Kitware Robot 
normalmajoralways
closedmoved 
x86Windows7
CMake 2.8.12.2 
 
0015257: CMake from command line using wrong generator
I'm trying to generate NMake Makefiles with cmake from the command line, but I'm getting the wrong generator:

c:\gitbuild\x>cmake –G "NMake Makefiles" c:\gitbuild\cc_vob\tcs
-- Building for: Visual Studio 8 2005
-- The C compiler identification is MSVC 14.0.50727
-- The CXX compiler identification is MSVC 14.0.50727
-- Check for working C compiler using: Visual Studio 8 2005
-- Check for working C compiler using: Visual Studio 8 2005 -- works
-- Detecting C compiler ABI info
1) I open a Visual Studio 2005 command line (yes 2005, it's a legacy project).
2) I add cmake path:
   set PATH="c:\Program Files (x86)\CMake 2.8\bin";%path%
3) I run:
   cmake –G "NMake Makefiles" c:\gitbuild\cc_vob\tcs
4) Instead of generating nmake makefiles, I get a VS Solution:
-- Building for: Visual Studio 8 2005
-- The C compiler identification is MSVC 14.0.50727
-- The CXX compiler identification is MSVC 14.0.50727
- If I don't add CMake bin to Path variable, it sometimes uses the correct generator, however, I have to call cmake with a fully qualified name:

c:\gitbuild\p>"c:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -G "NMake Makefiles" ..\cc_vob\tcs
-- The C compiler identification is MSVC 14.0.50727
-- The CXX compiler identification is MSVC 14.0.50727
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done

- I'm using Visual Studio Command Line Prompt shell (x86).
No tags attached.
Issue History
2014-11-19 14:03JavierNew Issue
2014-11-19 16:26Brad KingNote Added: 0037235
2014-11-20 06:45JavierNote Added: 0037236
2014-11-20 08:44Brad KingNote Added: 0037238
2016-06-10 14:29Kitware RobotNote Added: 0042672
2016-06-10 14:29Kitware RobotStatusnew => 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
(0037235)
Brad King   
2014-11-19 16:26   
Be sure to use a fresh build tree.
(0037236)
Javier   
2014-11-20 06:45   
Yes, I'm using a fresh build tree every time, and the issue reproduces.
(0037238)
Brad King   
2014-11-20 08:44   
I can't reproduce this. It is very basic functionality that is covered every day by our test infrastructure. There must be something particular about your setup.

Please post a CMakeLists.txt file for a project that reproduces the problem.

Also make sure there is no CMakeCache.txt or CMakeFiles/ directory in your source tree.
(0042672)
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.