Merge pull request 'CMakeLists: install rules + pkg-config for daedalus_core' (#1) from noether/installable-pkgconfig into main

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2026-05-21 15:53:37 +00:00
+62
View File
@@ -376,6 +376,68 @@ if (DAEDALUS_BUILD_VULKAN)
add_dependencies(daedalus_core daedalus_shaders)
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
tests/test_api_idct.c
tests/vp9_idct8_ref.c