Building OpenXR-SDK with Visual Studio 2022 Community Edition

I have cloned the SDK : GitHub - KhronosGroup/OpenXR-SDK: Generated headers and sources for OpenXR loader. on windows and tried building it using cmake .

mkdir build\win64
cd build\win64
cmake -G "Visual Studio [Version Number] Win64" ..\..

I am using Visual Studio 2022 community edition ( on trial for 30 days)

info :

  • Microsoft Visual Studio Community 2022 964-bit) version 17.16

what should be the cmake(last line) command for this version ,

I tried with cmake -G "Visual Studio 17 2022 Win64" ( retuned error )

cmake -G "Visual Studio 17 2022 Win64" ..\..
CMake Error: Could not create named generator Visual Studio 17 2022 Win64


That’s really a cmake question and should probably be taken to their forums.

See the output of cmake --help:

The following generators are available on this platform (* marks default):
  Visual Studio 17 2022        = Generates Visual Studio 2022 project files.
                                 Use -A option to specify architecture.
* Visual Studio 16 2019        = Generates Visual Studio 2019 project files.
                                 Use -A option to specify architecture.
  Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
                                 Optional [arch] can be "Win64" or "ARM".

For VS 2019,2022 you no longer specify the architecture as part of the generator name, but with the -A command line argument:

cmake -G "Visual Studio 17 2022" -A x64 ..\.. 

Thanks @carsten_neumann , it helped and I generated and then built the SDK . But I still doubt i am getting the final output.
Below are the log for generating the Solution file(.sln) and below that is the log os the built solution in the VS 2022

Generated files logs :

- Could NOT find Vulkan (missing: Vulkan_LIBRARY Vulkan_INCLUDE_DIR) (found version “”)
– Looking for pthread.h
– Looking for pthread.h - not found
– Found Threads: TRUE
– Could NOT find JsonCpp (missing: JsonCpp_INCLUDE_DIR JsonCpp_LIBRARY)
– Could NOT find glslc, using precompiled .spv files
– Looking for secure_getenv
– Looking for secure_getenv - not found
– Looking for __secure_getenv
– Looking for __secure_getenv - not found
– Looking for timespec_get
– Looking for timespec_get - found
– Found and will use pre-generated xr_generated_dispatch_table.h in source tree
– Found and will use pre-generated xr_generated_dispatch_table.c in source tree
– Found and will use pre-generated xr_generated_loader.hpp in source tree
– Found and will use pre-generated xr_generated_loader.cpp in source tree
– Configuring done
– Generating done
– Build files have been written to:

Built using Visual Studio 2022 :

6>Building Custom Rule - STMicroelectronics/2022/AR-VR/Open-XR/OpenXR-SDK/OpenXR-SDK/CMakeLists.txt
7>------ Skipped Rebuild All: Project: INSTALL, Configuration: MinSizeRel x64 ------
7>Project not selected to build for this solution configuration
========== Rebuild All: 5 succeeded, 0 failed, 2 skipped ==========


that build looks fine to me. There are optional deps and optional projects, no problem there.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.