hh79 / gzdoomvr

Classic Doom/Heretic/Hexen games in stereo 3D and VR; modified version of gzdoom.
GNU General Public License v3.0
125 stars 10 forks source link

cmake command fails on Linux build. #31

Closed Orangestar12 closed 3 years ago

Orangestar12 commented 3 years ago

Attempting to perform cmake .. -DCMAKE_BUILD_TYPE=Release as listed in Compile GZDoom on Linux fails with this output.

Attempting to run make anyway results in this error:

/home/orangestar/Programs/gzdoomvr/src/g_statusbar/sbar_mugshot.cpp:42:10: fatal error: hwrenderer\data\hw_vrmodes.h: No such file or directory
   42 | #include "hwrenderer\data\hw_vrmodes.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/zdoom.dir/build.make:2392: src/CMakeFiles/zdoom.dir/g_statusbar/sbar_mugshot.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/orangestar/Programs/gzdoomvr/src/rendering/2d/f_wipe.cpp: In member function ‘virtual bool Wiper_Melt::Run(int)’:
/home/orangestar/Programs/gzdoomvr/src/rendering/2d/f_wipe.cpp:326:9: warning: ‘done’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  326 |  return done;
      |         ^~~~
make[1]: *** [CMakeFiles/Makefile2:930: src/CMakeFiles/zdoom.dir/all] Error 2
make: *** [Makefile:172: all] Error 2

Full stdout here.

Is there anything I'm missing here? Or does the application not compile on Linux yet?

Orangestar12 commented 3 years ago

Solved it - Arch doesn't include the full OpenVR SDK in the AUR package, so I just had to download the OpenVR SDK here and replace the following in src/CMakeLists.txt to force cmake to use my OVR directory:

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1efc1cf4d..473516589 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -448,20 +448,8 @@ endif()
 option( ENABLE_OPENVR "Enable OpenVR virtual reality mode" ON )
 if (ENABLE_OPENVR)
        add_definitions("-DUSE_OPENVR")
-       find_path(OPENVR_SDK_PATH
-               NAMES
-                       headers/openvr.h
-               HINTS
-                       ENV OPENVR_DIR ENV PROGRAMFILES ENV HOME ENV USERPROFILE
-               PATH_SUFFIXES
-                       openvr git/openvr
-       )
-       find_path(OPENVR_INCLUDE_DIRECTORY
-               NAMES
-                       openvr.h
-               HINTS
-                       ${OPENVR_SDK_PATH}/headers
-       )
+       set( OPENVR_SDK_PATH "/home/orangestar/Documents/openvr/")
+       set (OPENVR_INCLUDE_DIRECTORY "/home/orangestar/openvr/headers")
        include_directories("${OPENVR_INCLUDE_DIRECTORY}")
        option( DYN_OPENVR "Dynamically load OpenVR" ON )
        if (DYN_OPENVR)

Obviously, if you're doing this yourself, replace the folders with ones applicable to your system.