<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Arial","sans-serif";
        color:#7F7F7F;
        font-weight:bold;
        font-style:normal;
        text-decoration:none none;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'>I tried this out with VS 2010 SP0 Win64. Here’s my CMakeLists:<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'>cmake_minimum_required(VERSION 2.8)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'>project(Test CXX)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'>file(WRITE foo.h "//Some Foo Header ")<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'>file(WRITE foo.cpp "int main(int argc, char** argv) { return 0; }\n")<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'>file(WRITE foo.txt "This is the foo text file (simulated config)")<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'>set( etc_hdrs foo.h)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'>set( etc_srcs foo.cpp foo.txt)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Consolas'>add_custom_target( etc SOURCES ${etc_hdrs} ${etc_srcs} )<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'>For me, the resulting VS Solution has the text file as a member of the project:<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><img width=201 height=243 id="Picture_x0020_2" src="cid:image001.png@01CCF06D.172F2950"><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'>Also ended up with an item named ‘etc’, which seems wrong.. not sure why that would have happened. I’m using CMake 2.8.7 on Windows 7. I wonder if there is something else that is a problem. What version of CMake are you using?<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Aaron Meadows</span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'><o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> cmake-bounces@cmake.org [mailto:cmake-bounces@cmake.org] <b>On Behalf Of </b>walter.schwarz@dzbank.de<br><b>Sent:</b> Monday, February 20, 2012 5:37 AM<br><b>To:</b> cmake@cmake.org<br><b>Subject:</b> [CMake] custom command and differences between VS2005 and VS2010<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>our project contains a directory with config files. to make the config files (and other externally supplied header files) visible in the visual studio solution, the custom command shown below was specified in the directory.</span> <br><br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>this worked well with the generator for Visual Studio 2005. it doesn't any more with the generator for visual studio 2010.</span> <br><br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>- is this intentional or is it a bug?</span> <br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>- what can i do to fix this?</span> <br><br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>/regards Walter Schwarz</span> <br><br><br><span style='font-size:10.0pt;font-family:"Courier New"'># Targets: none - <u>placeholder</u> for <u>Murex</u> headers</span> <br><span style='font-size:10.0pt;font-family:"Courier New"'># ----------------------------------------------------------------------------</span> <br><span style='font-size:10.0pt;font-family:"Courier New"'># Library: none</span> <br><span style='font-size:10.0pt;font-family:"Courier New"'># ----------------------------------------------------------------------------</span> <br><br><span style='font-size:10.0pt;font-family:"Courier New"'>set( etc_hdrs</span> <br><span style='font-size:10.0pt;font-family:"Courier New"'> ${FLEX_INCLUDE_DIRS}/mdtypes.h</span> <br><span style='font-size:10.0pt;font-family:"Courier New"'> ... list shortened ...</span> <br><span style='font-size:10.0pt;font-family:"Courier New"'>)</span> <br><br><span style='font-size:10.0pt;font-family:"Courier New"'>set( etc_srcs FlexModelConfig.cfg configFile.txt )</span> <br><br><span style='font-size:10.0pt;font-family:"Courier New"'>include_directories(</span> <br><span style='font-size:10.0pt;font-family:"Courier New"'> ${FLEX_INCLUDE_DIRS} </span><br><span style='font-size:10.0pt;font-family:"Courier New"'>)</span> <br><br><span style='font-size:10.0pt;font-family:"Courier New"'>add_custom_target( etc SOURCES ${etc_hdrs} ${etc_srcs} )</span> <o:p></o:p></p></div> <br>
This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.</body></html>