RobertBeckebans / RBDOOM-3-BFG

Doom 3 BFG Edition source port with updated DX12 / Vulkan renderer and modern game engine features
https://www.moddb.com/mods/rbdoom-3-bfg
GNU General Public License v3.0
1.38k stars 247 forks source link

Missing nvrhi CMakeLists.txt files compiling on Linux #802

Closed hemebond closed 7 months ago

hemebond commented 8 months ago

Compiling on Debian Linux, got several errors when trying to compile the latest commit.

But still getting these errors and unsure how to resolve them:

CMake Error at extern/nvrhi/CMakeLists.txt:62 (add_subdirectory):
  The source directory

    /home/james/Workspace/rbdoom3bfg/neo/extern/nvrhi/thirdparty/Vulkan-Headers

  does not contain a CMakeLists.txt file.

CMake Error at extern/nvrhi/CMakeLists.txt:80 (add_subdirectory):
  The source directory

    /home/james/Workspace/rbdoom3bfg/neo/extern/nvrhi/thirdparty/cxxopts

  does not contain a CMakeLists.txt file.

Changes to get this far

Downloaded dxc and put it onto the PATH.

Got the warning:

CMake Warning (dev) at extern/nvrhi/CMakeLists.txt:33 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'NVRHI_INSTALL'.
This warning is for project developers.  Use -Wno-dev to suppress it.

so I added this to neo/extern/nvrhi/CMakeLists.txt:

if (POLICY CMP0077)
    cmake_policy(SET CMP0077 NEW)
endif()

and made these changes too:

diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt
index a99f27d2..00900fb6 100644
--- a/neo/CMakeLists.txt
+++ b/neo/CMakeLists.txt
@@ -1706,7 +1706,7 @@ else()
                                )
        endif()

-       GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
+       GET_DIRECTORY_PROPERTY(_directory_flags COMPILE_DEFINITIONS)
        LIST(APPEND _compiler_FLAGS ${_directory_flags})
        SEPARATE_ARGUMENTS(_compiler_FLAGS)

diff --git a/neo/extern/nvrhi b/neo/extern/nvrhi
--- a/neo/extern/nvrhi
+++ b/neo/extern/nvrhi
@@ -1 +1 @@
-Subproject commit 1cbc9e9d16f997948c429739b1a1886fb4d0c796
+Subproject commit 1cbc9e9d16f997948c429739b1a1886fb4d0c796-dirty
diff --git a/neo/idlib/CMakeLists.txt b/neo/idlib/CMakeLists.txt
index dc3cfcd4..e496d90f 100644
--- a/neo/idlib/CMakeLists.txt
+++ b/neo/idlib/CMakeLists.txt
@@ -124,7 +124,7 @@ else()
        ENDFOREACH(item)
        endif()

-       GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
+       GET_DIRECTORY_PROPERTY(_directory_flags COMPILE_DEFINITIONS)
        LIST(APPEND _compiler_FLAGS ${_directory_flags})

        SEPARATE_ARGUMENTS(_compiler_FLAGS)
RobertBeckebans commented 7 months ago

This happens only if not checked out with git clone --recursive.

Usually you can fix this with in the root of the repo with

git submodule init git submodule update --recursive

hemebond commented 7 months ago

I followed those commands from the readme.

Full activity log ``` $  git pull remote: Enumerating objects: 65, done. remote: Counting objects: 100% (65/65), done. remote: Compressing objects: 100% (33/33), done. remote: Total 65 (delta 42), reused 55 (delta 32), pack-reused 0 Unpacking objects: 100% (65/65), 292.54 KiB | 3.15 MiB/s, done. From https://github.com/RobertBeckebans/RBDOOM-3-BFG * [new branch] 671-imgui-docking -> origin/671-imgui-docking Already up to date. 18:12:37  ~/Workspace/rbdoom3bfg   master  ✚ 1  $  git submodule init 18:12:46  ~/Workspace/rbdoom3bfg   master  ✚ 1  $  git submodule update --recursive 18:12:57  ~/Workspace/rbdoom3bfg   master  ✚ 1  $  ls base docs LICENSE_EXCEPTIONS.md neo RELEASE-NOTES.md zip-RBDOOM-3-BFG-full-release.bat build doomclassic LICENSE.md README.md tools zip-RBDOOM-3-BFG-lite-snapshot.bat 18:13:01  ~/Workspace/rbdoom3bfg   master  ✚ 1  $  cd build/ 18:13:23  ~/Workspace/rbdoom3bfg/build   master  ✚ 1  $  cd ../neo/ 18:13:34  ~/Workspace/rbdoom3bfg/neo   master  ✚ 1  $  ./cmake-linux-release.sh CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions. -- The C compiler identification is GNU 13.2.0 -- The CXX compiler identification is GNU 13.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - 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: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- CMAKE_BUILD_TYPE:Release -- Performing Test COMPILER_SUPPORTS_CXX17 -- Performing Test COMPILER_SUPPORTS_CXX17 - Success -- Using module to find Vulkan and components -- Found Vulkan: /usr/lib/x86_64-linux-gnu/libvulkan.so (found version "1.3.250") found components: glslangValidator missing components: dxc glslc -- Using Vulkan: /usr/lib/x86_64-linux-gnu/libvulkan.so CMake Error at extern/nvrhi/CMakeLists.txt:62 (add_subdirectory): The source directory /home/james/Workspace/rbdoom3bfg/neo/extern/nvrhi/thirdparty/Vulkan-Headers does not contain a CMakeLists.txt file. CMake Error at extern/nvrhi/CMakeLists.txt:80 (add_subdirectory): The source directory /home/james/Workspace/rbdoom3bfg/neo/extern/nvrhi/thirdparty/cxxopts does not contain a CMakeLists.txt file. -- Found DXCspirv: /home/james/.local/bin/dxc CMake Warning (dev) at idlib/CMakeLists.txt:127 (GET_DIRECTORY_PROPERTY): Policy CMP0059 is not set: Do not treat DEFINITIONS as a built-in directory property. Run "cmake --help-policy CMP0059" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. -- Found OpenAL: /usr/lib/x86_64-linux-gnu/libopenal.so CMake Warning (dev) at CMakeLists.txt:1709 (GET_DIRECTORY_PROPERTY): Policy CMP0059 is not set: Do not treat DEFINITIONS as a built-in directory property. Run "cmake --help-policy CMP0059" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. -- Shader include path /home/james/Workspace/rbdoom3bfg/neo/shaders -- Configuring incomplete, errors occurred! ```
hemebond commented 7 months ago

I completely deleted and re-cloned and the cmake configuration worked, and it almost compiled.