This article is written to show how CMake can be used to build OpenCL related application.

The sample code used here was grabbed from here and its main job is to apply simple Gaussian blur filter on test input image and saving output into a file. For better understanding about how OpenCL code works for Gaussian blur filtering, refer to the above link. I just wanted to build it on my machine to know how OpenCL application work so all credit on the source code should be given to Anteru which can be reached via https://anteru.net/2012/11/05/2022/.



Tested environment


1. Windows 7 with AMD OpenCL SDK

2. Windows 7 with Intel OpenCL SDK

3. MAC OSX 10.7


Below is CMakeLists.txt file used in this project.


CMakeLists.txt


As you can see, it is simple and no description on kernel CL source code because exe file will seek and compile it on run time. Please note that exe file should be located in the same folder with main source code to be able to read test input image and kernel CL code file.


For ones seeking zip file, use this file.

Anteru-opencltutorial.7z




Posted by kevino
,