File: CMakeLists.txt

package info (click to toggle)
darktable 5.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 61,256 kB
  • sloc: ansic: 358,383; cpp: 100,542; xml: 19,788; lisp: 14,579; sh: 3,692; javascript: 3,264; perl: 1,888; python: 1,475; ruby: 975; makefile: 542; asm: 46; sql: 38; awk: 21
file content (45 lines) | stat: -rw-r--r-- 1,648 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
#
# install opencl kernel source files
#
FILE(GLOB DT_OPENCL_KERNELS "*.cl")
FILE(GLOB DT_OPENCL_EXTRA "programs.conf" "common.h" "rgb_norms.h" "noise_generator.h" "color_conversion.h" "colorspace.h")

add_custom_target(testcompile_opencl_kernels ALL)

macro (testcompile_opencl_kernel IN)
  get_filename_component(KERNAME ${IN} NAME)

  set(TOUCH "${CMAKE_CURRENT_BINARY_DIR}/${KERNAME}.touch")

  set(KERNAME_OUT "opencl-program-${KERNAME}")

  add_custom_command(
    OUTPUT  ${TOUCH}
    COMMAND ${CLANG_OPENCL_COMPILER} -cc1 -cl-std=CL1.2 -isystem ${CLANG_OPENCL_INCLUDE_DIR} -finclude-default-header -I${CMAKE_CURRENT_SOURCE_DIR} ${IN}
    COMMAND ${CMAKE_COMMAND} -E touch ${TOUCH} # will be empty!
    DEPENDS ${IN}
    COMMENT "Test-compiling OpenCL program ${KERNAME}"
  )

  add_custom_target(
    ${KERNAME_OUT}
    DEPENDS ${TOUCH} # will be empty!
    DEPENDS ${IN}
  )

  add_dependencies(testcompile_opencl_kernels ${KERNAME_OUT})
endmacro (testcompile_opencl_kernel)

if (TESTBUILD_OPENCL_PROGRAMS)
  foreach(KERNEL IN ITEMS ${DT_OPENCL_KERNELS})
    testcompile_opencl_kernel(${KERNEL})
  endforeach()
endif()

install(FILES ${DT_OPENCL_KERNELS} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/darktable/kernels COMPONENT DTApplication)
# Need to copy to have kernels all in one path like after installing
file(COPY ${DT_OPENCL_KERNELS} DESTINATION ${DARKTABLE_DATADIR}/kernels)

install(FILES ${DT_OPENCL_EXTRA} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/darktable/kernels COMPONENT DTApplication)
# Need to copy to have kernels all in one path like after installing
file(COPY ${DT_OPENCL_EXTRA} DESTINATION ${DARKTABLE_DATADIR}/kernels)