[CMake] [CMAKE] PROJECT command and CMAKE_SYSTEM_NAME

Bill Hoffman bill.hoffman at kitware.com
Wed Feb 10 11:21:47 EST 2010


Tyler Roscoe wrote:
> On Wed, Feb 10, 2010 at 04:54:47PM +0100, Martin Guillon wrote:
>> Let s say we have a very simple CMakeLists.txt Like that
>>
>> cmake_minimum_required(VERSION 2.6)
>> MESSAGE (STATUS "The system is \"${CMAKE_SYSTEM_NAME}\"")
>>
>> Now as is the CMakelists works fine.
>>
>> The problem appears when we add a PROJECT(TOTO)
>> If I do so wherever I put it I get
>> -- The system is ""
> 
> The project() command does a bunch of stuff, including defining and
> redefining various variables.
> 
> What are you trying to do?
> 

In addition to that, if the top level CMakeLists.txt file is missing a 
project command, CMake will insert one for you at the very top...

So:
make_minimum_required(VERSION 2.6)
MESSAGE (STATUS "The system is \"${CMAKE_SYSTEM_NAME}\"")

is really:
project(Project)
make_minimum_required(VERSION 2.6)
MESSAGE (STATUS "The system is \"${CMAKE_SYSTEM_NAME}\"")

-Bill

-- 
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573


More information about the CMake mailing list