[CMake] opencl and visual studio

Nagy-Egri Máté Ferenc nagymatef at freemail.hu
Wed Jul 16 04:16:29 EDT 2014


I’m rather new to CMake myself, so I’d pretty much do what you could as well: look through the docs. All I know is that much much more complicated things can be done with CMake, and many things can be done multiple ways.


I’d rather call on the other mail list users to answer this one: how to copy a group of source files to the build directory on every build? (Or just if they changed since the last build.)


I’m making the assumption that if that kernel files appear in VS, then they have already been collected to a variable in CMake and passed on to the build command. (AFAIK that is the only way to make them appear inside the IDE. VS will not compile them, as it has no idea what to do with .cl files, but if I don’t pass it on to the target_build() command they will not appear inside the solution.)


Cheers,

Máté






Feladó: Boxer, Aaron
Elküldve: ‎kedd‎, ‎2014‎. ‎július‎ ‎15‎. ‎22‎:‎40
Címzett: Máté Ferenc Nagy-Egri, cmake at cmake.org






Thanks for your suggestions.  I like the first options. So, how may I create a cmake build rule to do this?

 

Thanks,

Aaron

 



From: outlook_f942cba43dcb6260 at outlook.com [mailto:outlook_f942cba43dcb6260 at outlook.com] On Behalf Of Nagy-Egri Máté Ferenc
Sent: Monday, July 14, 2014 4:11 PM
To: Boxer, Aaron; cmake at cmake.org
Subject: Re: [CMake] opencl and visual studio

 



There are two ways to solve your problem I think.


 

Either create a build rule that copies the .cl files over to your build directory on every build.

Use a config file that creates a #define with the absolute/relative path to the .cl files.


 


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.


 



Feladó: Boxer, Aaron
Elküldve: ‎hétfő‎, ‎2014‎. ‎július‎ ‎14‎. ‎15‎:‎56
Címzett: cmake at cmake.org


 



Hello List,

 

I have a cmake project that I am adding opencl support to.

I am using the Intel OpenCL sdk, which integrates with Visual Studio.

 

So far, I do the following:

 

1)      I have a cmake script that finds the opencl libraries and include files

2)      I manually enable opencl support in visual studio in the Tools menu

 

With these steps, all opencl files are statically checked by the compiler. So far, so good.

 

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.

 

Has anyone encountered a similar problem? Is there a way of setting the *.cl folder path in cmake? Currently I have to

Hard code this into my code, which is hacky.

 

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.

 

Thanks,

Aaron

 

 

 

 

 

 

 


This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient. 
Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. 
If you have received this e-mail in error, please contact the sender and delete all copies. 
Opinions, conclusions or other information contained in this e-mail may not be that of the organization.


This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient. 
Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. 
If you have received this e-mail in error, please contact the sender and delete all copies. 
Opinions, conclusions or other information contained in this e-mail may not be that of the organization.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140716/96669d13/attachment.html>


More information about the CMake mailing list