diff options
author | Juan Ramos <[email protected]> | 2023-01-11 12:04:15 -0700 |
---|---|---|
committer | Juan Ramos <[email protected]> | 2023-01-11 12:26:22 -0700 |
commit | d0f8581c604de78d24762e7787cc19f9b252fd7f (patch) | |
tree | cb820d7cb4f8557ef2c7eabbb6a9a156272f3263 | |
parent | bc6beaa9602e94fa9c66a41c4a890884f6aaa661 (diff) | |
download | Vulkan-Headers-d0f8581c604de78d24762e7787cc19f9b252fd7f.tar.gz Vulkan-Headers-d0f8581c604de78d24762e7787cc19f9b252fd7f.zip |
ci: Test find_package support
-rw-r--r-- | .github/workflows/linux.yml | 4 | ||||
-rw-r--r-- | tests/find_package/CMakeLists.txt | 23 |
2 files changed, 26 insertions, 1 deletions
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 705d1a0..a45364d 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -34,7 +34,9 @@ jobs: - name: Configure Vulkan-Headers run: cmake -S . -B build - name: Install Vulkan-Headers - run: cmake --install build --prefix build/install + run: cmake --install build --prefix ${GITHUB_WORKSPACE}/build/install + - name: Test Vulkan-Headers find_package support + run: cmake -S tests/find_package -B build/tests/find_package -D CMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/build/install # Enable testing ubuntu-cmake-tests: diff --git a/tests/find_package/CMakeLists.txt b/tests/find_package/CMakeLists.txt new file mode 100644 index 0000000..f042bdc --- /dev/null +++ b/tests/find_package/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.10.2) + +project(TEST_VULKAN_HEADERS_FIND_PACKAGE_SUPPORT LANGUAGES C) + +find_package(VulkanHeaders REQUIRED CONFIG) + +if (NOT TARGET Vulkan::Headers) + message(FATAL_ERROR "Vulkan::Headers target not defined") +endif() + +if (NOT DEFINED VULKAN_HEADERS_REGISTRY_DIRECTORY) + message(FATAL_ERROR "VULKAN_HEADERS_REGISTRY_DIRECTORY not defined!") +endif() + +if (NOT EXISTS "${VULKAN_HEADERS_REGISTRY_DIRECTORY}/vk.xml") + message(FATAL_ERROR "VULKAN_HEADERS_REGISTRY_DIRECTORY not valid!") +endif() +message(STATUS "VULKAN_HEADERS_REGISTRY_DIRECTORY = ${VULKAN_HEADERS_REGISTRY_DIRECTORY}") + +if (NOT DEFINED VulkanHeaders_VERSION) + message(FATAL_ERROR "VulkanHeaders_VERSION not defined!") +endif() +message(STATUS "VulkanHeaders_VERSION = ${VulkanHeaders_VERSION}") |