Commit graph

42 commits

Author SHA1 Message Date
Charles Giessen
fc6c06ac52 Disable VulkanHppModule support in clang-cl
Some checks failed
ci / cmake-unix (3.15, macos-latest) (push) Has been cancelled
ci / cmake-unix (3.15, ubuntu-latest) (push) Has been cancelled
ci / cmake-unix (latest, macos-latest) (push) Has been cancelled
ci / cmake-unix (latest, ubuntu-latest) (push) Has been cancelled
ci / cmake-windows (3.15) (push) Has been cancelled
ci / cmake-windows (latest) (push) Has been cancelled
ci / windows_clang (clang) (push) Has been cancelled
ci / windows_clang (clang-cl) (push) Has been cancelled
ci / reuse (push) Has been cancelled
The current released versions of clang-cl does not work with CMakes
module implementation. Rather than break downstream users, just disable
the module support for the time being.
2024-07-12 14:13:48 -05:00
Charles Giessen
78a92e2c7c build: Require MSVC 17.11 for module support
Some checks failed
ci / cmake-unix (3.15, macos-latest) (push) Has been cancelled
ci / cmake-unix (3.15, ubuntu-latest) (push) Has been cancelled
ci / cmake-unix (latest, macos-latest) (push) Has been cancelled
ci / cmake-unix (latest, ubuntu-latest) (push) Has been cancelled
ci / cmake-windows (3.15) (push) Has been cancelled
ci / cmake-windows (latest) (push) Has been cancelled
ci / reuse (push) Has been cancelled
17.10 and before has a bug that prevents the vulkan.cppm module from
compiling. The module support wont be enabled unless the MSVC version
contains the fix.
2024-07-10 11:12:48 -05:00
Charles Giessen
e3c37e6e18 cmake: Workaround MSVC module support compiler bug
Adds the VULKAN_HEADERS_ENABLE_MODULE option to control whether to build the Vulkan-Hpp module.
This is necessary to allow CI to pass while waiting for the MSVC version 17.11, which fixes an
internal compiler bug, to be added to github actions runners.
2024-06-18 14:25:22 -06:00
Charles Giessen
7dacb97fba cmake: Remove explicit install of Vulkan-Module
Installing a C++ module in CMake isn't something which is well defined currently.
Rather than add code which behaves poorly or flat out wrong, it is better to not
try to install a binary module for the time being. The vulkan.cppm file is still
included in the install so downstream users can still create a module from it.
2024-06-18 14:25:22 -06:00
Sharadh Rajaraman
85256c712c Add vulkan.cppm as a separate library: Vulkan::VulkanHppModule
- Guarded behind `if()` version and compiler test
- Linked to `Vulkan-Headers` as a dependency
- Also added `CXX` to the `LANGUAGES` property of the project
2024-06-18 14:25:22 -06:00
David Neto
8f034f6b48 cmake: Allow external control of whether to test or install
This makes the project more composable: It can be built and
tested as part of a larger set of projects, from source.
2024-06-14 14:42:51 -06:00
Juan Ramos
a32b2b412b Use ctest for integration testing 2023-11-20 14:18:09 -07:00
Juan Ramos
a0c76b4ef7 cmake: Document vlk_get_header_version 2023-08-28 16:16:25 -06:00
Juan Ramos
bc14fdad60 Add REUSE compliance checker to CI 2023-07-14 09:57:20 -06:00
Juan Ramos
2565ffa31e cmake: Use share instead of DATADIR for CMake config files
See the following discussion for context:
https://discourse.cmake.org/t/what-should-the-destination-be-for-a-header-only-librarys-cmake-config-file/8473/3

TLDR: `DATADIR` can be `share` but it doesn't have to be. It can
be changed by the user.
2023-07-10 13:02:41 -06:00
Juan Ramos
482af6d865 cmake: Remove VULKAN_HEADERS_INSTALL
VULKAN_HEADERS_INSTALL was added since it was believed there was
a valid use case for it.

After looking into the use case that provoked this change there is
no reason to keep VULKAN_HEADERS_INSTALL as an option.

Here is the use case we do NOT want to support:
https://github.com/KhronosGroup/Vulkan-Headers/pull/416#issuecomment-1622318949

Fundamentally this problem is caused add_subdirectory/find_package
not being able to work together flawlessly.

Which isn't the responsibility of Vulkan-Headers to fix.

It's the responsibility of projects that consume Vulkan-Headers
to account for either method.

As described by the CMake maintainers:
https://discourse.cmake.org/t/idiomatic-way-to-handle-packages-and-add-subdirectory/8400
2023-07-05 15:22:17 -06:00
Juan Ramos
6f34ca5a37 cmake: Remove usage of configure_package_config_file
Fixes issue shown here:
https://github.com/KhronosGroup/Vulkan-Headers/pull/415
2023-07-05 10:19:57 -06:00
Juan Ramos
ad5f8ee975 cmake: Add VULKAN_HEADERS_INSTALL option
Allows add_subdirectory users to install vulkan-headers
2023-06-30 09:56:11 -06:00
Juan Ramos
65ad768d86 cmake: Minor CMake cleanup
- Fix project name to be less confusing
- Better testing
2023-03-15 13:55:17 -06:00
Juan Ramos
115820a6e5 cmake: Update min to 3.15
- Removes conditional 3.15 logic
- Guarantees usage of --install/--loglevel
2023-02-22 11:49:55 -07:00
Juan Ramos
93cb25c6a4 cmake: Trim CMakeLists.txt 2023-01-30 16:45:26 -07:00
Juan Ramos
78448eda6e cmake: Update minimum to 3.14 2023-01-19 11:45:45 -07:00
Juan Ramos
50f8b24b85 cmake: Cleanup vlk_get_header_version function 2023-01-11 14:49:54 -07:00
Juan Ramos
ab48b9b20d cmake: Removes unused CMake macros 2023-01-11 12:49:57 -07:00
Juan Ramos
bc6beaa960 cmake: Cleanup vlk_get_header_version 2023-01-10 13:44:50 -07:00
Juan Ramos
5eeb2c4c57 cmake: Remove Vulkan::Registry
Vulkan::Registry behaves differently in `add_subdirectory` vs
`find_package` builds. Which can result in build failures.

Also Vulkan::Registry never made sense as a CMake target and
was very brittle in numerous ways.

Better to provide a `VULKAN_HEADERS_REGISTRY_DIRECTORY` to users
instead and remove Vulkan::Registry completely.

closes #351
2023-01-09 17:01:08 -07:00
Juan Ramos
24115c70be docs: Update copyright 2023-01-04 10:41:02 -07:00
Juan Ramos
43946b0feb tests: Test Non-API headers
Ensures the non-API headers compile correctly
2022-12-20 15:15:25 -07:00
Juan Ramos
75a6b83f21 cmake: Preserve permissions from registry files 2022-12-14 16:45:15 -07:00
Juan Ramos
e6cc1b3582 cmake: Remove VULKAN_HEADERS_INSTALL
Not needed and adds clutter to projects that use add_subdirectory
2022-12-09 11:30:42 -07:00
Juan Ramos
d14ccf951f cmake: Cleanup CMake code
Remove version.cmake / install.cmake / cmake_uninstall.cmake

Remove as much maintenace burden / custom code as possible
2022-12-09 11:30:42 -07:00
Ryan Harrison
29c0457cc1 Fix duplicate quotes when targets are included by downstream projects
When trying to update the version of Vulkan-Headers used in Dawn/Tint,
I encountered errors like this:

 Target "Vulkan-Headers" contains relative path in its
  INTERFACE_INCLUDE_DIRECTORIES:

    ""/home/foo/workspace/dawn/third_party/vulkan-deps/vulkan-headers/src/include""

This PR removes the offending quotes
2022-11-10 11:30:47 -07:00
Juan Ramos
e55c3116c1 cmake: Add VULKAN_HEADERS_INSTALL option
This allows projects which consume this repo with add_subdirectory
to turn on/off the install logic, which can be undesirable.
2022-11-08 10:22:11 -07:00
Juan Ramos
9cc8473bb9 cmake: Export CMake Targets File
Now as part of install 2 files are created:
- VulkanHeadersConfig.cmake
- VulkanHeadersConfigVersion.cmake

This allows usage of find_package

closes #157
2022-11-08 10:22:11 -07:00
Juan Ramos
91388ba104 cmake: Get Vulkan Version
Extract the vulkan header version for CMake usage
2022-11-07 10:54:57 -07:00
Juan Ramos
52b7c620a5 build: Fix CMake warning
Currently GNUInstallDirs is complaining because no language has
been enabled. This is fixed by enabling the C language.
2022-11-04 11:02:07 -06:00
Mike Schuchardt
f5ac258209 Add vk_video headers to CMake install target 2021-04-13 16:23:52 -07:00
Mike Weiblen
62becc509a Revert "Export versioned targets for CMake"
This reverts commit 382bf3de06.

Revert PR #110
https://github.com/KhronosGroup/Vulkan-Headers/pull/110
2020-04-23 10:59:45 -06:00
Rahul Sheth
382bf3de06 Export versioned targets for CMake
Generate VulkanHeadersConfig.cmake and version file and install them.
To get the version information the header file vulkan_core.h is parsed.

In client code one can use `find_package(VulkanHeaders)` and get the
targets `Vulkan::Headers` and `Vulkan::Registry`.

The following additional files are generated and installed by CMake:
- VulkanHeadersConfig.cmake:        searched for by find_package(VulkanHeaders)
- VulkanHeadersConfigVersion.cmake: provides version numbers
- VulkanHeadersTargets.cmake:       CMake target definitions used by config file
2020-04-16 16:21:54 -06:00
Mike Weiblen
5ce5b15b54 build: Update cmake_minimum_required(VERSION 3.10.2)
Change-Id: I28c30bb941691738944b13da75bc07e6153c89ef
2019-07-16 15:10:44 -06:00
Nuno Subtil
2ed3359a52 build: Define library targets for nested builds-
Adds alias interface libraries Vulkan::Headers and Vulkan::Registry that
export include paths. These are meant to be used by dependent projects
in a nested build configuration to obtain the path to the Vulkan headers
and registry directories.

Change-Id: I0801f4a23ef654064c1b0878543cd48965954756
2019-02-28 12:11:24 -07:00
Nuno Subtil
1c8d71f98a build: Fix install target path
Use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR when defining
the path for the source files to be installed.

CMAKE_SOURCE_DIR always points at the directory containing the root
CMakeLists.txt, while CMAKE_CURRENT_SOURCE_DIR points at the directory
containing the current project's CMakeLists.txt. These are normally
identical, except when another CMake project includes this project via
add_subdirectory() --- in that case, CMAKE_CURRENT_SOURCE_DIR is the
right variable to use when composing paths to files within the current
project tree.

Change-Id: I4bdcc3bf538e96c43ae5f4ff6758cf45992442e0
2018-12-03 11:02:49 -07:00
Mike Weiblen
6b47ce4d93 build: CMakeLists.txt cleanup
A cleanup of the CMake file in this repo,
for consistency with similar effort in other Vulkan repos.

clarify setting Windows install prefix if needed

project() : NONE = this project has no language toolchain requirement.

update .cmake-format.py 0.4.1

reformat using cmake-format 0.4.1

Change-Id: Ic64b335676eb6b8bd8ffd1b0d8c5468a4239287c
2018-09-07 13:51:11 -06:00
Mike Weiblen
0642c1b859 build: Beautify cmake files
Add the formatter config file (.cmake-format.py) and run:
cmake-format -i CMakeLists.txt
2018-06-27 11:25:45 -06:00
Mike Weiblen
6cb0f5b3cc build: Insert copyright in cmake files 2018-06-27 11:25:00 -06:00
Karl Schultz
70413b6dcb cmake: Prevent redefinition of uninstall target
Allows for this repo to be included as a submodule of another
repo that defines its own uninstall target.  The uninstall target
is best defined at the top-level repo.
2018-06-12 15:06:34 -06:00
Karl Schultz
afd12b7bdc build: Add CMake files for install target 2018-05-30 17:38:30 -06:00