1 diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt
2 index 3dd2ea4..aeae6e9 100644
3 --- a/cl_headers/CMakeLists.txt
4 +++ b/cl_headers/CMakeLists.txt
5 @@ -11,12 +11,14 @@ add_custom_command(
10 - set(OPENCL_HEADERS_DIR
11 - "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/")
12 -else(USE_PREBUILT_LLVM)
13 - set(OPENCL_HEADERS_DIR "${CLANG_SOURCE_DIR}/lib/Headers")
14 -endif(USE_PREBUILT_LLVM)
15 +if(NOT DEFINED OPENCL_HEADERS_DIR)
16 + if(USE_PREBUILT_LLVM)
17 + set(OPENCL_HEADERS_DIR
18 + "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/")
19 + else(USE_PREBUILT_LLVM)
20 + set(OPENCL_HEADERS_DIR "${CLANG_SOURCE_DIR}/lib/Headers")
21 + endif(USE_PREBUILT_LLVM)
23 copy_file(${OPENCL_HEADERS_DIR}/opencl-c.h opencl-c.h)