1b2a28edaSopenharmony_cicmake_minimum_required(VERSION 3.14)
2b2a28edaSopenharmony_ci
3b2a28edaSopenharmony_ciproject(TEST_PKGCONFIG LANGUAGES CXX)
4b2a28edaSopenharmony_ci
5b2a28edaSopenharmony_ciadd_library(pkgconfig_example STATIC)
6b2a28edaSopenharmony_ci
7b2a28edaSopenharmony_citarget_sources(pkgconfig_example PRIVATE
8b2a28edaSopenharmony_ci    ${CMAKE_CURRENT_SOURCE_DIR}/../example.cpp
9b2a28edaSopenharmony_ci)
10b2a28edaSopenharmony_ci
11b2a28edaSopenharmony_cifind_package(PkgConfig REQUIRED)
12b2a28edaSopenharmony_ci
13b2a28edaSopenharmony_cipkg_check_modules(SPIRV_HEADERS REQUIRED IMPORTED_TARGET SPIRV-Headers)
14b2a28edaSopenharmony_ci
15b2a28edaSopenharmony_citarget_link_libraries(pkgconfig_example PRIVATE
16b2a28edaSopenharmony_ci    PkgConfig::SPIRV_HEADERS
17b2a28edaSopenharmony_ci)
18b2a28edaSopenharmony_ci
19b2a28edaSopenharmony_ciif (NOT DEFINED SPIRV_HEADERS_VERSION)
20b2a28edaSopenharmony_ci    message(FATAL_ERROR "SPIRV_HEADERS_VERSION not defined!")
21b2a28edaSopenharmony_ciendif()
22b2a28edaSopenharmony_ci
23b2a28edaSopenharmony_cimessage(STATUS "PkgConfig::SPIRV_HEADERS version = ${SPIRV_HEADERS_VERSION}")
24