<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=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
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";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p.msolistparagraphcxspfirst, li.msolistparagraphcxspfirst, div.msolistparagraphcxspfirst
        {mso-style-name:msolistparagraphcxspfirst;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        line-height:115%;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.msolistparagraphcxspmiddle, li.msolistparagraphcxspmiddle, div.msolistparagraphcxspmiddle
        {mso-style-name:msolistparagraphcxspmiddle;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        line-height:115%;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.msolistparagraphcxsplast, li.msolistparagraphcxsplast, div.msolistparagraphcxsplast
        {mso-style-name:msolistparagraphcxsplast;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        line-height:115%;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {mso-style-name:msochpdefault;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";}
span.emailstyle17
        {mso-style-name:emailstyle17;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
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-size:10.0pt;
        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;}
/* List Definitions */
@list l0
        {mso-list-id:1285699512;
        mso-list-template-ids:-1448543166;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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"><span style="color:#1F497D">Thanks for your suggestions.  I like the first options. So, how may I create a cmake build rule to do this?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Aaron<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<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""> outlook_f942cba43dcb6260@outlook.com [mailto:outlook_f942cba43dcb6260@outlook.com]
<b>On Behalf Of </b>Nagy-Egri Máté Ferenc<br>
<b>Sent:</b> Monday, July 14, 2014 4:11 PM<br>
<b>To:</b> Boxer, Aaron; cmake@cmake.org<br>
<b>Subject:</b> Re: [CMake] opencl and visual studio<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt">There are two ways to solve your problem I think.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
</div>
<div>
<ol start="1" type="1">
<li class="MsoNormal" style="color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
<span style="font-size:12.0pt">Either create a build rule that copies the .cl files over to your build directory on every build.<o:p></o:p></span></li></ol>
</div>
<div>
<ol start="2" type="1">
<li class="MsoNormal" style="color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
<span style="font-size:12.0pt">Use a config file that creates a #define with the absolute/relative path to the .cl files.<o:p></o:p></span></li></ol>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">As for the OpenCL integration, I did not know that the Intel SDK checks the validity of the kernel files. That indeed makes life easier. In case you would need something a little more lightweight,
 AMD’s CodeXL also provides some nice features, and as far as syntax highlighting goes, it does not depend on any feature being turned on inside the project. It just uses the extension of the source file to turn on highlighting.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
</div>
<div style="border:none;border-top:solid #E5E5E5 1.0pt;padding:4.0pt 0in 0in 0in">
<div>
<p class="MsoNormal"><b><span style="font-size:12.0pt;letter-spacing:.25pt">Feladó:</span></b><span style="font-size:12.0pt;letter-spacing:.25pt"> <a href="mailto:Aaron.Boxer@uhn.ca" target="_parent">Boxer, Aaron</a><br>
<b>Elküldve:</b> ‎hétfő‎, ‎2014‎. ‎július‎ ‎14‎. ‎15‎:‎56<br>
<b>Címzett:</b> <a href="mailto:CMake@cmake.org" target="_parent">cmake@cmake.org</a></span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal">Hello List,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I have a cmake project that I am adding opencl support to.<o:p></o:p></p>
<p class="MsoNormal">I am using the Intel OpenCL sdk, which integrates with Visual Studio.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">So far, I do the following:<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in">1)<span style="font-size:7.0pt;font-family:"Times New Roman","serif"">     
</span>I have a cmake script that finds the opencl libraries and include files<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in">2)<span style="font-size:7.0pt;font-family:"Times New Roman","serif"">     
</span>I manually enable opencl support in visual studio in the Tools menu<o:p></o:p></p>
<p class="MsoListParagraph"> <o:p></o:p></p>
<p class="MsoNormal">With these steps, all opencl files are statically checked by the compiler. So far, so good.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">However, to actually compile The files with opencl, I need to pass the absolute file path of the *.cl file into opencl. This is because, as is typical With cmake, the build files reside in a folder separate from the source files.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Has anyone encountered a similar problem? Is there a way of setting the *.cl folder path in cmake? Currently I have to<o:p></o:p></p>
<p class="MsoNormal">Hard code this into my code, which is hacky.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Also, it would be nice if cmake could automatically switch on opencl support in the visual studio project, but I have no idea how this could be done.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Aaron<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoListParagraph"> <o:p></o:p></p>
</div>
<p><span style="font-family:"Calibri","sans-serif""><br>
This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient.
<br>
Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited.
<br>
If you have received this e-mail in error, please contact the sender and delete all copies.
<br>
Opinions, conclusions or other information contained in this e-mail may not be that of the organization.<o:p></o:p></span></p>
</div>
</div>
</div>
<p><br>
This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient. <br>
Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. <br>
If you have received this e-mail in error, please contact the sender and delete all copies. <br>
Opinions, conclusions or other information contained in this e-mail may not be that of the organization.</p></body>
</html>