[CMake] using cmake on windows - query on existing targets

Chauhan, Vikas vikas.chauhan at anritsu.com
Mon Jan 11 16:52:46 EST 2010


> > I understand what you mean and it is similar to what the macro suggested
> > by Alex does.
> > However, I do not want a developer to have a need to change setting in
> > the cmake GUI for what I need.
> >
> > What I want is that:
> > 1. the user should be able to see a list of components & sub-components,
> > using a command from the cmd window from the location where the cmake
> > GUI has generated the build files.
> 
> Did you try the Nmake generator and call
> 
> nmake help
> 
Thanks, I tried using nmake generator i.e. - cmake ../ -G "NMake Makefiles"-  but it does not work in cmake 2.8. It fails to find the compiler. However the command - cmake ../ -G "Visual Studio 9 2008" - works fine. The errors I get are as:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error: your RC compiler: "CMAKE_RC_COMPILER-NOTFOUND" was not found.   Please set CMAKE_RC_COMPILER to a valid compiler path or name.
-- Check for CL compiler version
-- Check for CL compiler version - failed
-- Check if this is a free VC compiler
-- Check if this is a free VC compiler - yes
-- Check CL platform
-- Check CL platform - 64 bit
-- Using FREE VC TOOLS, NO DEBUG available
-- Check for working C compiler: cl
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeRCInformation.cmake:22 (GET_FILENAME_COMPONENT):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-cl.cmake:32 (ENABLE_LANGUAGE)
  C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:58 (INCLUDE)
  CMakeLists.txt:2 (PROJECT)


CMake Error: CMAKE_RC_COMPILER not set, after EnableLanguage
CMake Error: your C compiler: "cl" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: cl -- broken
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE):
  The C compiler "cl" is not able to compile a simple test program.

  It fails with the following output:


  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


CMake Error: your C compiler: "cl" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "cl" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!

> > 2. the user should be able to choose a sub-component to build without
> > asking to build the whole component. Also, I do not want to be
> > generating build files every time I choose to build a different
> > sub-component.
> 
> nmake subcomponent

I will try once I get nmake generation to work.
> 
> > Is this possible?
> >
> > Please note that I am on windows. I guess this is easily possible on
> > Linux. As make allows you to query a list of targets & can build
> > specific targets as well. Please correct me if I am wrong.
> 
> I bet nmake should support more or less the same set
> of target than unix make, but since I'm not a experienced Windows user
> I may be wrong.
> 
> If the Nmake generator does not suit your need may be the MSYS Makefile would?
> 
> 
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org


More information about the CMake mailing list