[CMake] [PATCh] Precompiled headers support for VC++ 7.x generator

speedy speedy at 3d-io.com
Mon Jul 10 11:48:35 EDT 2006


Hello David,

      I assume you mean something in the line of extending CMake
      API with ADD_PRECOMPILED_HEADER(cpp_file_name, h_file_name)?

      ps. things to note:

      * .cpp is used for creation of .pch, and .h for inclusion per
        source file at compile time. Visual C++ allows defining those
        on per source granularity with per target default value, but CMake
        could get away with a target property for a start
      * Visual C++ automatic .pch /Ya generation is quite broken, I'd
        leave the support for that one out if I were you
      * .pch path should be carefully set in vc++ nmake generators, to
        support out-of-tree builds

Monday, July 10, 2006, 5:06:03 PM, you wrote:

DC> To implement this properly across the board, we should allow an 
DC> arbitrary string as the name of the precompiled header file. ("stdafx.h"
DC> is default, but a developer should be able to have a "myproject.h" 
DC> header, i.e. - don't force me to use a "stdafx.h")

DC> Also, we should support it in as many generators as possible. (DevStudio
DC> 6, NMake, Xcode)

DC> speedy wrote:

>>Hello Cmake crew,
>>
>>      attached to the email is the patch for VC++ 7.x generator which
>>      adds proper(?) support for precompiled headers to generated
>>      .vcproj files.
>>
>>      Usage is pretty straightforward:
>>      
>># Create a library called "Hello" which includes the source file "hello.cxx".
>># The extension is already found.  Any number of sources could be listed here.
>>add_library (Hello hello.cxx hello.h stdafx.cpp stdafx.h)
>>
>>SET_TARGET_PROPERTIES(Hello PROPERTIES COMPILE_FLAGS "/Yu")
>>
>>SET_SOURCE_FILES_PROPERTIES(stdafx.cpp COMPILE_FLAGS "/Yc")
>>
>>      All comments and corrections are welcome. :)
>>      
>>  
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>CMake mailing list
>>CMake at cmake.org
>>http://www.cmake.org/mailman/listinfo/cmake
>>



-- 
Best regards,
 speedy                            mailto:speedy at 3d-io.com



More information about the CMake mailing list