<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>&gt; Has anyone had any luck with precompiled 
headers on visual studio 2005?<BR>&gt; <BR>&gt; For Visual Studio 6, i added 
additional parameters to each compiled <BR>&gt; file. I then told one specific 
file to build the precompiled headers. <BR>&gt; This worked in vs6, but in 2005 
the ide must have the actual projects <BR>&gt; setup for precompiled headers. 
This "hack" won't work on 2005.<BR>&gt; <BR>&gt; I know there have been requests 
to add precompiled headers, but I was <BR>&gt; wondering if anyone has written a 
custom add-in to cmake to do this. If <BR>&gt; not, I am going to have to write 
one.<BR>&gt; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I think the best way to achieve this is to write 
your own generator but I'm not a master of CMake so maybe there is a simplier 
way.</FONT></DIV>
<DIV><FONT face=Arial size=2>Anyway I will describe how I added precompiled 
header in case&nbsp;it can help you, or someone else.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The basic idea is to add properties to the files 
and retrieve them is a custom made generator. </FONT></DIV>
<DIV><FONT face=Arial size=2>To do this I have a module file which contains a 
big FOREACH loop. </FONT><FONT face=Arial size=2>It loops on the source list and 
add the properties to each file when it encounters one.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The list of files : </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>LIST(APPEND GLOBAL_FILE_DESC</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; "Source 
Files"</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; "Source 
Files/Module"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @CREATE_PCH 
"source/dummy.cpp"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"dummy.h"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @USE_PCH 
"source/dummy2.cpp"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"dummy2.h"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @NO_PCH 
"source/dummy3.cpp"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"dummy3.h"</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; "Source 
Files/Docs"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @EXCLUDE 
"dummy.dox"</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; "Resource 
Files"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"resources/dummy.rc"</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>This loop adds properties and sourcegroup. The sub 
loops allow to add properties or file groups&nbsp;from our master CMakeLists.txt 
directly.</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><FONT face="Courier New" 
size=2></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>FOREACH(SOURCE_DESCRIPTION 
${GLOBAL_FILE_DESC})</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; # look for the nature of 
the entry<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; IF(${SOURCE_DESCRIPTION} 
MATCHES "@.*")<BR>&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # this is a 
property<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 
------------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
FOREACH(FILE_PROPERTY 
${FILE_PROPERTIES})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
IF(${SOURCE_DESCRIPTION} MATCHES 
"@(${FILE_PROPERTY})$")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# add this property to the current 
properties<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
LIST(APPEND CUR_PROPERTIES ${${FILE_PROPERTY}_PROPERTY} 
${${FILE_PROPERTY}_VALUE})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ENDIF(${SOURCE_DESCRIPTION} MATCHES 
"@(${FILE_PROPERTY})$")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ENDFOREACH(FILE_PROPERTY 
${FILE_PROPERTIES})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp; ELSE(${SOURCE_DESCRIPTION} MATCHES 
"@.*")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF(${SOURCE_DESCRIPTION} 
MATCHES ".*[.].*$")</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # this 
is a file<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

--------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
FOREACH(FILE_GROUP 
${FILE_GROUPS})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
IF(${SOURCE_DESCRIPTION} MATCHES 
".*[.](${REGISTRED_${FILE_GROUP}_EXT})")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# add the file to its 
group<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
LIST(APPEND ${FILE_GROUP} 
${SOURCE_DESCRIPTION})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
IF(CUR_PROPERTIES)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# add current properties to the 
file<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
SET_SOURCE_FILES_PROPERTIES(${SOURCE_DESCRIPTION} PROPERTIES 
${CUR_PROPERTIES})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
SET(CUR_PROPERTIES 
"")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ENDIF(CUR_PROPERTIES)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ENDIF(${SOURCE_DESCRIPTION} MATCHES 
".*[.](${REGISTRED_${FILE_GROUP}_EXT})")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ENDFOREACH(FILE_GROUP 
${FILE_GROUPS})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# add the file to the current folder 
list<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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sp;&nbsp;&nbsp;&nbsp; 
SET(CUR_FOLDER 
${SOURCE_DESCRIPTION})&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDIF(${SOURCE_DESCRIPTION} 
MATCHES ".*[.].*$")<BR>&nbsp;&nbsp;&nbsp; ENDIF(${SOURCE_DESCRIPTION} MATCHES 
"@.*")&nbsp;&nbsp;&nbsp; <BR>ENDFOREACH(SOURCE_DESCRIPTION 
${GLOBAL_FILE_DESC})</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2># create the last source 
folder<BR>IF(CUR_FOLDER)<BR>&nbsp;&nbsp;&nbsp; SOURCE_GROUP(${CUR_FOLDER} FILES 
${CUR_FOLDER_LIST})<BR>ENDIF(CUR_FOLDER)</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2># merge all file groups into one 
group<BR>FOREACH(FILE_GROUP ${FILE_GROUPS})<BR>&nbsp;&nbsp;&nbsp; 
IF(${FILE_GROUP})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LIST(APPEND 
TARGET_FILES ${${FILE_GROUP}})<BR>&nbsp;&nbsp;&nbsp; 
ENDIF(${FILE_GROUP})<BR>ENDFOREACH(FILE_GROUP ${FILE_GROUPS})</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>After this, you create your own generator where you 
retrieve the properties and write them to the project files.</FONT></DIV>
<DIV><FONT face=Arial size=2>Hope that will help you a bit.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Sylvain</FONT></DIV></BODY></HTML>