OpenCL+ CMake @ iMac

Hi,

When I compile a simple opencl code in a Mac, I must simply write:

g++ -o hello hello.cpp -framework OpenCL 

But currently I working with CMake and I need to “include” this “-framework OpenCL” in the CMakeLists.txt.

Does anyone know how I could make it?

This is my CMakeLists.txt which works perfectly at Linux

cmake_minimum_required(VERSION 2.8)

PROJECT(KdV)

# Set your files and resources here..
SET(KdVSrcs main.cpp ReferenceElement.cpp ComputationalMesh.cpp Function1D.cpp LocalMatrices.cpp MatrixAssemble.cpp)
SET(KdVHeaders ReferenceElement.h ComputationalMesh.h Definitions.h Function1D.h LocalMatrices.h MatrixAssemble.h /usr/local/include/eigen3/Eigen /usr/local/include/CL/cl.hpp /usr/local/include/viennacl)

ADD_EXECUTABLE( KdV 
               ${KdVSrcs}
               ${KdVHeaders}
               )

TARGET_LINK_LIBRARIES( KdV OpenCL )

Thanks!