KhronosGroup / OpenXR-SDK-Source

Sources for OpenXR loader, basic API layers, and example code.

Home Page:https://khronos.org/openxr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMakeLists file error

qpmg opened this issue · comments

CMake Error at CMakeLists.txt:40 (set_target_properties):
set_target_properties called with incorrect number of arguments.

CMake Error at CMakeLists.txt:45 (compile_glsl):
Unknown CMake command "compile_glsl".

Is my environment configuration wrong? It uses Visual Studio 2019.

The specific command line return is as follows:
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as

project(ProjectName)

near the top of the file, but after cmake_minimum_required().

CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.

-- The C compiler identification is MSVC 19.29.30147.0
-- The CXX compiler identification is MSVC 19.29.30147.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:40 (set_target_properties):
set_target_properties called with incorrect number of arguments.

CMake Error at CMakeLists.txt:45 (compile_glsl):
Unknown CMake command "compile_glsl".

CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 3.25)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "D:/projet/DT/OpenXR-SDK-Source-main/src/tests/hello_xr/build/win64/CMakeFiles/CMakeOutput.log".

You have to build the entire source tree, you can't just point to the hello_xr subdirectory. If you want to see what a standalone project containing a version of hello_xr looks like, see: https://github.com/rpavlik/hello_xr_hpp

Thank you for your answer. The problem has been solved.

@qpmg how did you solve it?
I moved to the root directory : OpenXR-SDK-Source and ran below command :
mkdir build\win64
cd build\win64
cmake -G "Visual Studio 17 2022" -A x64 ....

it builds but then what next? Do i need to do the same step by entering inside the "\OpenXR-SDK-Source\build\win64\src\tests\hello_xr" which is formed? but it reports missing cmakelist.txt

UPDATE 1: OK i see hello_xr.exe,exp,.lib and *.pdb .
How Can i run this exe on Windows? I understadn this requries a runtime.Where to find the runtime for windows?
Also is it possible to generate the sln(solution file) for hello_xr?

Regards,
S

There is no sln just for hello_xr, it's for the entire project. This is a very standard CMake project, see https://cmake.org/cmake/help/latest/guide/user-interaction/index.html#guide:User%20Interaction%20Guide

A runtime should come with your headset: see https://www.khronos.org/conformance/adopters/conformant-products/openxr for a listing of conformant products that include a runtime. There are multiple runtimes available for Windows, the right one to use depends on your headset.

There is no sln just for hello_xr, it's for the entire project. This is a very standard CMake project, see https://cmake.org/cmake/help/latest/guide/user-interaction/index.html#guide:User%20Interaction%20Guide

A runtime should come with your headset: see https://www.khronos.org/conformance/adopters/conformant-products/openxr for a listing of conformant products that include a runtime. There are multiple runtimes available for Windows, the right one to use depends on your headset.

Sorry , this is not clear. To run it on windows why it needs to depend on headset? I want to run it on windows not headset currently.

OpenXR is an API for using immersive software, which is mainly on headsets. Windows Mixed Reality (which implements OpenXR) has a simulator mode that does not require a headset, as does Monado.

OpenXR is an API for using immersive software, which is mainly on headsets. Windows Mixed Reality (which implements OpenXR) has a simulator mode that does not require a headset, as does Monado.

ok thanks for the clarification!