KhronosGroup / KhronosGroup/OpenCL-SDK

OpenCL_INCLUDE_DIRS and OpenCL_LIBRARIES are not set.

Open
#85 1 comment 0 reactions 1 assignee Claimed by @MathiasMagnus View on GitHub
Dominant language
C++
Stars
777
Forks
163
Avg merge
6d 17h
Merged PRs (30d)
2

Description

Hello, I'm currently building and testing the OpenCL-SDK, and I have a question.

First, I built and installed the OpenCL-SDK using CMake. Then, in another CMake project, I called `find_package(OpenCL REQUIRED)` to use OpenCL.

The `OpenCL_FOUND` variable is set to 1, and I can successfully build it by calling `target_link_libraries(MyProject OpenCL::OpenCL)`. However, the `OpenCL_INCLUDE_DIRS` and `OpenCL_LIBRARIES` variables are not being set and are empty.

As far as I know, when `find_package` succeeds, it's a standard CMake practice for `_INCLUDE_DIRS` and `_LIBRARIES` variables to be set. I might be wrong since I'm not very familiar with CMake, but I believe this is the typical behavior in CMake.

I'm building other projects that use OpenCL, such as clFFT. In these projects, they directly reference the `OpenCL_INCLUDE_DIRS` and `OpenCL_LIBRARIES` variables in their `CMakeLists.txt` to build. Of course, I could modify the `CMakeLists.txt` files of these projects to call `target_link_libraries(SomeProject OpenCL::OpenCL)` directly, but it would be more convenient if `_INCLUDE_DIRS` and `_LIBRARIES` variables were automatically set when `find_package` succeeds. This would make it easier to work with a variety of projects.

If I'm mistaken about something, please let me know. Thanks.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.