Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,11 @@ install (TARGETS OpenCL
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

if (UNIX)
configure_file(OpenCL.pc.in OpenCL.pc @ONLY)
set(pkg_config_location ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.pc
DESTINATION ${pkg_config_location})
endif()
8 changes: 8 additions & 0 deletions OpenCL.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: OpenCL
Description: Khronos OpenCL ICD Loader
Version: 3.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming: It's OK if this version number is different than our SOVERSION?

If so, this is another place that would be great to automate with #182!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming: It's OK if this version number is different than our SOVERSION?

This mimics what ocl-icd does here: https://github.com/OCL-dev/ocl-icd/blob/master/OpenCL.pc.in where @OPENCL_VERSION@ is currently evaluated to 3.0

If so, this is another place that would be great to automate with #182!

Indeed

Libs: -L${libdir} -lOpenCL
Cflags: -I${includedir}