[CMake] Concern with 2.6.3

Bill Hoffman bill.hoffman at kitware.com
Mon Mar 9 12:31:58 EDT 2009


Pau Garcia i Quiles wrote:
> On Mon, Mar 9, 2009 at 4:24 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>> Pau Garcia i Quiles wrote:
>>
>>> Yes, I'm using QT4_WRAP_CPP (with plans to move to automoc), but that
>>> "right-click, compile to run moc" is useful  (no need to close the
>>> solution or reload projects) and it's what VC++ developers are used
>>> to.
>>>
>> With CMake, you can still right click and compile, it will run the custom
>> command.  You just need to find the output file in VS.
> 
> I guess you mean finding the moc_blah.cxx file in the "CMake Rules"
> filter in VC++. Yes, that works.
Yes, that is what I mean.
> 
> What does not work is what I am doing: I'm listing the .h files as
> source files so that they show in the VC++ project. Now, given that
> header files are marked as "excluded from build", VC++ disables
> right-click-and-compile for those header files.
The .h file is not compiled, so that would not work anyway in a CMake 
generated project. If the .h file where the input to a custom command 
then it would work.  That is how the VTK wrappers work.  Each .h file is 
"compiled" by a custom command into a .cxx file.
> 
> By the way, is there any way to set an internal global variable in a
> VC++ project? Currently, CMake-generated Qt projects may show a wrong
> version in the property browser if the default (in the registry) Qt
> version is not the same as the Qt version you told in CMake (i. e. the
> qmake). What's required is adding something like this in the .vcproj :
> 
> <Globals>
> ...
> <Global
> Name="QtVersion"
> Value="4.4.3"
> />
> 
> (where the Qt version would be what FindQt4.cmake has found)
> 
> Would something like SET_TARGET_PROPERTIES ( thetarget PROPERTIES
> VS_GLOBAL "property" "value" ) be accepted if I provide a patch?
> 
Sure, there are already some examples of this:
   ("VS_KEYWORD", cmProperty::TARGET,
      "Visual Studio project keyword.",
      "Can be set to change the visual studio keyword, for example "
      "QT integration works better if this is set to Qt4VSv1.0. ");
   cm->DefineProperty
     ("VS_SCC_PROVIDER", cmProperty::TARGET,
      "Visual Studio Source Code Control Provider.",
      "Can be set to change the visual studio source code control "
      "provider property.");
   cm->DefineProperty
     ("VS_SCC_LOCALPATH", cmProperty::TARGET,
      "Visual Studio Source Code Control Provider.",
      "Can be set to change the visual studio source code control "
      "local path property.");
   cm->DefineProperty
     ("VS_SCC_PROJECTNAME", cmProperty::TARGET,
      "Visual Studio Source Code Control Project.",
      "Can be set to change the visual studio source code control "
      "project name property.");


-Bill



More information about the CMake mailing list