File: Package.cmake

package info (click to toggle)
khronos-opencl-clhpp 3.0~2024.10.24-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 984 kB
  • sloc: cpp: 13,856; makefile: 55; sh: 20
file content (47 lines) | stat: -rw-r--r-- 1,622 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
include("${CMAKE_CURRENT_LIST_DIR}/PackageSetup.cmake")

# Configuring pkgconfig

# We need two different instances of OpenCL.pc
# One for installing (cmake --install), which contains CMAKE_INSTALL_PREFIX as prefix
# And another for the Debian development package, which contains CPACK_PACKAGING_INSTALL_PREFIX as prefix

join_paths(OPENCLHPP_INCLUDEDIR_PC "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")

set(pkg_config_location ${CMAKE_INSTALL_DATADIR}/pkgconfig)
set(PKGCONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")
configure_file(
  OpenCL-CLHPP.pc.in
  ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig_install/OpenCL-CLHPP.pc
  @ONLY)
install(
  FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig_install/OpenCL-CLHPP.pc
  DESTINATION ${pkg_config_location}
  COMPONENT pkgconfig_install)

set(PKGCONFIG_PREFIX "${CPACK_PACKAGING_INSTALL_PREFIX}")
configure_file(
  OpenCL-CLHPP.pc.in
  ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig_package/OpenCL-CLHPP.pc
  @ONLY)
# This install component is only needed in the Debian package
install(
  FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig_package/OpenCL-CLHPP.pc
  DESTINATION ${pkg_config_location}
  COMPONENT pkgconfig_package
  EXCLUDE_FROM_ALL)

# By using component based packaging, component pkgconfig_install
# can be excluded from the package, and component pkgconfig_package
# can be included.
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_GROUPING "ALL_COMPONENTS_IN_ONE")

include(CPackComponent)
cpack_add_component(pkgconfig_install)
cpack_add_component(pkgconfig_package)
set(CPACK_COMPONENTS_ALL "Unspecified;pkgconfig_package")

set(CPACK_DEBIAN_PACKAGE_DEBUG ON)

include(CPack)