CMakeLists: install rules + pkg-config for daedalus_core

Make daedalus_core installable so sibling consumers (Phase 8 V4L2
daemon, future libva-v4l2-request-fourier integration tests, etc.)
can `pkg_check_modules(DAEDALUS REQUIRED daedalus-fourier)` against
a system-installed copy.

Installs:
  - lib/libdaedalus_core.a
  - include/daedalus.h
  - lib/pkgconfig/daedalus-fourier.pc
  - share/daedalus-fourier/shaders/*.spv  (only when
    DAEDALUS_BUILD_VULKAN is ON; consumers using
    daedalus_ctx_create_no_qpu() don't need them)

pkg-config surfaces the static-archive transitive deps via
Libs.private (-lpthread -ldl -lm) and Requires.private (vulkan),
so a consumer doing `pkg-config --static --libs daedalus-fourier`
gets the full link line.  Non-static consumers (using the
no_qpu path) get just `-ldaedalus_core`.

No behaviour change to existing tests / benches.

Verified on hertz (Pi 5, dev host): clean build, all 7 SPIR-V
shaders + the static lib + the header + the .pc file land in
the install prefix.
This commit is contained in:
2026-05-21 17:49:49 +02:00
parent 0e4caae006
commit 47d0107809
+62
View File
@@ -376,6 +376,68 @@ if (DAEDALUS_BUILD_VULKAN)
add_dependencies(daedalus_core daedalus_shaders) add_dependencies(daedalus_core daedalus_shaders)
endif() endif()
# ---- Install rules for sibling consumers (Phase 8 V4L2 daemon, etc.) -------
#
# Installs:
# - libdaedalus_core.a → ${CMAKE_INSTALL_LIBDIR}
# - include/daedalus.h → ${CMAKE_INSTALL_INCLUDEDIR}
# - daedalus-fourier.pc → ${CMAKE_INSTALL_LIBDIR}/pkgconfig
# - V3D SPIR-V shaders → ${CMAKE_INSTALL_DATADIR}/daedalus-fourier/shaders
# (only when DAEDALUS_BUILD_VULKAN is ON; consumers using
# daedalus_ctx_create_no_qpu() don't need them)
#
# pkg-config tells consumers what to link; the static-archive
# dependencies (Vulkan, pthread, and the vendored asm symbols)
# are surfaced through Requires.private + Libs.private so a
# consumer doing `pkg-config --libs daedalus-fourier` gets the
# right transitive link line.
include(GNUInstallDirs)
install(TARGETS daedalus_core
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(FILES include/daedalus.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
if (DAEDALUS_BUILD_VULKAN)
install(FILES
${NOOP_SPV}
${IDCT8_SPV}
${LPF_SPV}
${MC_SPV}
${LPF8_SPV}
${CDEF_SPV}
${H264DEBLOCK_SPV}
DESTINATION ${CMAKE_INSTALL_DATADIR}/daedalus-fourier/shaders
)
endif()
# pkg-config file. Vulkan goes in Requires.private (consumer's
# pkg-config call gets it via --static). pthread + dl are needed
# by the static archive's runtime helpers.
set(PKGCONFIG_OUT ${CMAKE_CURRENT_BINARY_DIR}/daedalus-fourier.pc)
file(WRITE ${PKGCONFIG_OUT}
"prefix=${CMAKE_INSTALL_PREFIX}
exec_prefix=\${prefix}
libdir=\${prefix}/${CMAKE_INSTALL_LIBDIR}
includedir=\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}
shadersdir=\${prefix}/${CMAKE_INSTALL_DATADIR}/daedalus-fourier/shaders
Name: daedalus-fourier
Description: VP9/AV1/H.264 back-end kernels for VC VII (V3D 7.1) + ARM NEON
Version: 0.1.0
Libs: -L\${libdir} -ldaedalus_core
Libs.private: -lpthread -ldl -lm
Requires.private: vulkan
Cflags: -I\${includedir}
")
install(FILES ${PKGCONFIG_OUT}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
add_executable(test_api_idct add_executable(test_api_idct
tests/test_api_idct.c tests/test_api_idct.c
tests/vp9_idct8_ref.c tests/vp9_idct8_ref.c