1# ~~~
2# Copyright (c) 2023 Valve Corporation
3# Copyright (c) 2023 LunarG, Inc.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# ~~~
17cmake_minimum_required(VERSION 3.17.2)
18
19project(INTEGRATION LANGUAGES C)
20
21find_package(VulkanLoader REQUIRED CONFIG)
22
23# The intent is ensuring we don't accidentally change the names of these
24# targets. Since it would break downstream users.
25if (NOT TARGET Vulkan::Loader)
26    message(FATAL_ERROR "Vulkan::Loader target not defined!")
27endif()
28
29if (NOT DEFINED VulkanLoader_VERSION)
30    message(FATAL_ERROR "VulkanLoader_VERSION not defined!")
31endif()
32message(STATUS "VulkanLoader_VERSION = ${VulkanLoader_VERSION}")
33
34# NOTE: This check is NOT sufficient to ensure vulkan.pc is actually valid
35find_package(PkgConfig)
36if(PKG_CONFIG_FOUND)
37    find_file(VULKAN_PC vulkan.pc PATH_SUFFIXES lib/pkgconfig REQUIRED)
38    execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --validate ${VULKAN_PC})
39endif()
40