[CMake] Question about Windows support.

Ryan Connelly Ryan_Connelly at intercept.com
Mon Jun 5 10:37:40 EDT 2006


Sylvain,

I read your post about getting precompiled headers to work. However, I 
am still unclear how to do it.

I am able to set properties for all of my source files that need 
specific precompiled headers. However, by setting the "properties", I 
mean adding command line parameters to the compiler. It sort of works, 
but I have to first manually build the precompiled header generating 
files (i.e. dummy_prec.cpp -- that's what we call it).

What I need is a way to add in a specific attribute in the XML project 
(namely UsingPrecompiledHeaders = X). This will tell the ide what to do.

You said build a "generator", but I am unsure of how to do that. Will 
this solve my problem? If so, could you direct me to a good how-to document?

Ryan

Sylvain Benner wrote:
> I wrote a custom generator to do this. You must get the source 
> files from the CVS.
>  
> (1) You can disable the custom build rules by redefining :
> void cmLocalVisualStudio7GeneratorMP::AddVCProjBuildRule(cmTarget& tgt)
>  
> (2) For the source control part, a variable is set in our low-level 
> CMakeLists.txt files like this :
> SET(SOURCE_CONTROL "MSSCCI:NXN alienbrain" "Projectname")
> Then in the custom generator it generates the relative path to 
> Projectname in order to bind the files. It works with Alienbrain, only 
> the files are binded and not the project files (which should not be 
> binded, only the CMakeLists.txt has to).
> Note that the "SET" command is not the best choice, since the error 
> detection is performed during the generation process only (when you 
> click on OK button).
> With a custom command the error can be detected at the parsing 
> time (Configure button).
>  
> Cheers,
> Sylvain
>  
>  
>  
> ----- Original Message -----
> From: "David Cole" <david.cole at kitware.com 
> <mailto:david.cole at kitware.com>>
> To: "Sylvain Benner" <benner at virtools.com <mailto:benner at virtools.com>>
> Cc: <cmake at cmake.org <mailto:cmake at cmake.org>>
> Sent: Monday, June 05, 2006 1:45 PM
> Subject: Re: [CMake] Question about Windows support.
>
> > How did you (1) disable the custom build rules for the CMakeLists.txt
> > files and (2) add source control...? Do you do it by hand after running
> > CMake or do you have a script that does it? Would you mind posting
> > specific answers back to the list so that other Visual Studio users can
> > benefit from your suggestions?
> >
> > Thanks,
> > David
> >
> >
> > Sylvain Benner wrote:
> >
> >> I've posted a way to handle precompiled headers the 1st June. You
> >> should find it if you browse for the threads of june 2006, the name of
> >> the thread is "Precompiled Headers".
> >> I don't know if it's a good way to handle it but my main concern was
> >> to do a CMakeLists.txt that is friendly to edit, quickly
> >> understandable and with the possibility to add new properties easily,
> >> so I tried to it this way.
> >>
> >> A side note : If you are using CMake with a lot of projects in VS IDE
> >> I suggest to disable custom build rules for the CMakeLists.txt files
> >> and add the CMake GUI to the external tools. The developpers use the
> >> front-end when they need to do it by calling the GUI from the tools
> >> menu (I added source control so they should know when they check out a
> >> CMakeLists.txt), it speeds up the compilation time a bit and the
> >> "reload" popup will not interfere with the compilation (it needs to
> >> cancel the compilation every time and rerun it) which leads to a much
> >> more comfortable work environment.
> >>
> >> Sylvain
> >> ----- Original Message ----- From: "Bennett Smith" 
> <idvlpsw at gmail.com <mailto:idvlpsw at gmail.com>>
> >> To: "William A. Hoffman" <billlist at nycap.rr.com 
> <mailto:billlist at nycap.rr.com>>
> >> Cc: <cmake at cmake.org <mailto:cmake at cmake.org>>
> >> Sent: Friday, June 02, 2006 7:41 PM
> >> Subject: Re: [CMake] Question about Windows support.
> >>
> >>
> >>> Thank you for the reply.  This sounds very encouraging!  I have
> >>> ordered a copy of the book from Kitware about CMake.  In order to more
> >>> quickly come up to speed on how to do the things listed in my original
> >>> post can you suggest any resources?  Thus far in my searching of the
> >>> mailing list archive I have not found answers.
> >>>
> >>> Cheers
> >>>
> >>> -- Bennett
> >>>
> >>> On 6/2/06, William A. Hoffman <billlist at nycap.rr.com 
> <mailto:billlist at nycap.rr.com>> wrote:
> >>>
> >>>> At 12:38 PM 6/2/2006, Bennett Smith wrote:
> >>>> >Hi,
> >>>> >
> >>>> >I'm just starting to learn cmake, and am wondering what the level of
> >>>> >on-going support is for the Windows platform.  A couple things 
> that I
> >>>> >am hoping cmake can do are:
> >>>> >
> >>>> >1. Handle generation of library and executable targets with 
> different
> >>>> >names for debug and release configurations.
> >>>>
> >>>> This is done in CMake 2.4.2
> >>>>
> >>>> >2. Handle pre-compiled header files with Visual C++.
> >>>>
> >>>> This has been done, but is not directly supported.
> >>>>
> >>>>
> >>>> >3. Handle COM *.idl files and the invocation of MIDL.
> >>>>
> >>>> This can be done but is not directly supported.
> >>>>
> >>>> >4. Handle manifest files in association with executables.
> >>>>
> >>>> CMake 2.4.2 does this.
> >>>>
> >>>>
> >>>> >I have not been able to find any discussion and/or examples of how
> >>>> >cmake addresses these issues.  I have searched through the bug
> >>>> >database and it looks like there are some issues related to the 
> above
> >>>> >mentioned items.  Some of these issues were posted back in 2004, and
> >>>> >it doesn't look like anyone has been actively working on them.
> >>>>
> >>>> The bug tracker is in serious need of clean up.....
> >>>>
> >>>>
> >>>> >In general, are people using cmake for Windows projects?  Who 
> are the
> >>>> >active contributors to the windows specific aspects of cmake?  Can
> >>>> >anyone offer some historic perspective on how well the Windows
> >>>> >platform is supported by cmake in general?
> >>>>
> >>>> Windows Visual Studio is one of the major platforms for CMake, and is
> >>>> very actively supported.
> >>>>
> >>>>
> >>>> -Bill
> >>>>
> >>>>
> >>>
> >>>
> >>> --
> >>> --
> >>> Bennett Smith
> >>> iDevelopSoftware, Inc.
> >>> _______________________________________________
> >>> CMake mailing list
> >>> CMake at cmake.org <mailto:CMake at cmake.org>
> >>> http://www.cmake.org/mailman/listinfo/cmake
> >>>
> >>
> >> _______________________________________________
> >> CMake mailing list
> >> CMake at cmake.org <mailto:CMake at cmake.org>
> >> http://www.cmake.org/mailman/listinfo/cmake
> >>
> >
> ------------------------------------------------------------------------
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake

-- 
----------------------------------------------------------------------------
Ryan Connelly
Software Engineer                            (404)352-0111 (ext. 965)  (Tel)
Intercept Technology Inc.                    (404)352-3744             (Fax)
Ryan_Connelly at Intercept.com                  http://www.intercept.com
Intercept Design Group                       http://InterceptDG.org



More information about the CMake mailing list