[CMake] MSVC71 problems when upgrading to CMake 2.6.2

Luke Kucalaba lkucalaba at dsci.com
Thu Oct 9 15:18:35 EDT 2008


Good catch.  That seems to have fixed the example--I'll try to apply the
same fix to the real project to see if this is going to be resolved now.
Thanks for looking into this for me, I really appreciate your time and
effort.

The only reason that I wanted to use the cache is to hide certain cmake
variables from the typical end user, even if they click "Show Advanced
Values".  I'm the primary CMake maintainer for our software team, and I
don't want the other developers to be monkeying around with some of
these CMake variables (like CMAKE_CXX_FLAGS_DEBUG), although others are
OK to change (like CMAKE_VERBOSE_MAKEFILE for instance).  I figured
these variables were cached anyway because they show up in the cache
when you check "Show Advanced Values".  What does it even mean then when
you show advanced variables like CMAKE_CXX_FLAGS_DEBUG in the cache
window (using CMakeSetup), when it is actually being used as a "local
variable"?  Are there global equivalents to these CMake variables?

I suppose we'll just go with what works and have to remind everyone to
just ignore the "show advanced values" option at all costs.

Thanks
Luke


-----Original Message-----
From: Bill Hoffman [mailto:bill.hoffman at kitware.com] 
Sent: Thursday, October 09, 2008 2:58 PM
To: Luke Kucalaba
Cc: cmake at cmake.org
Subject: Re: [CMake] MSVC71 problems when upgrading to CMake 2.6.2

Luke Kucalaba wrote:
> The attachment was shot down.  I renamed to .png and reattached.  So
you
> will have to rename from .png to .zip when you download it.  Maybe
this
> will work?  Any suggestions on how to post this project?
> 

I should have looked at your example closer....

I think the problem is that you are using the CACHE.   If you just 
create local variables they will override the cache.

Something like this:



Set(CMAKE_CXX_FLAGS_DEBUG "/D _DEBUG /D WIN32 /DENABLE_EXEC_FLAG1 
/DENABLE_EXEC_FLAG2" )
Set(CMAKE_CXX_FLAGS_RELEASE "/D NDEBUG /D WIN32 /DENABLE_EXEC_FLAG1 
/DENABLE_EXEC_FLAG2" )
Set(CMAKE_EXE_LINKER_FLAGS     "/SUBSYSTEM:CONSOLE" )
Set(CMAKE_MODULE_LINKER_FLAGS  "/SUBSYSTEM:CONSOLE" )
Set(CMAKE_SHARED_LINKER_FLAGS  "/SUBSYSTEM:CONSOLE" )
Add_Executable(Exec WIN32 Exec.cpp)


If you remove the CACHE force stuff from your example everything works 
fine.  Not really sure how this worked before....

-Bill


More information about the CMake mailing list