From 5c3daf60f152a92590fda8263c2d89fe91d85c0a Mon Sep 17 00:00:00 2001
From: Tobias Frisch <tfrisch@uni-koblenz.de>
Date: Wed, 29 Jun 2022 01:28:16 +0200
Subject: [PATCH] Reduced CMake configuration in projects and improved build
 instructions

Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de>
---
 .../ext/{ProjectFix.cmake => Project.cmake}   |  8 ++++-
 doc/BUILD_LINUX.md                            | 31 ++++++++++++++++---
 doc/BUILD_WINDOWS.md                          |  7 +++--
 projects/CMakeLists.txt                       |  2 +-
 projects/bindless_textures/CMakeLists.txt     | 15 +--------
 projects/first_mesh/CMakeLists.txt            |  6 +---
 projects/first_scene/CMakeLists.txt           |  6 +---
 projects/first_triangle/CMakeLists.txt        |  6 +---
 projects/head_demo/CMakeLists.txt             |  6 +---
 projects/indirect_dispatch/CMakeLists.txt     |  7 +----
 projects/indirect_draw/CMakeLists.txt         | 15 +--------
 projects/mesh_shader/CMakeLists.txt           |  6 +---
 projects/particle_simulation/CMakeLists.txt   |  7 +----
 projects/path_tracer/CMakeLists.txt           | 16 +---------
 projects/rtx_ambient_occlusion/CMakeLists.txt | 17 ++--------
 projects/saf_r/CMakeLists.txt                 | 18 +----------
 projects/sph/CMakeLists.txt                   |  7 +----
 projects/voxelization/CMakeLists.txt          |  7 +----
 projects/wobble_bobble/CMakeLists.txt         |  8 +----
 19 files changed, 54 insertions(+), 141 deletions(-)
 rename config/ext/{ProjectFix.cmake => Project.cmake} (74%)

diff --git a/config/ext/ProjectFix.cmake b/config/ext/Project.cmake
similarity index 74%
rename from config/ext/ProjectFix.cmake
rename to config/ext/Project.cmake
index d3f26b4a..9ac76577 100644
--- a/config/ext/ProjectFix.cmake
+++ b/config/ext/Project.cmake
@@ -1,6 +1,12 @@
 
 # the first argument should be the project's target
-macro(fix_project)
+macro(add_project)
+    # this should fix the execution path to load local files from the project
+    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+    
+    # this will create an executable for the project
+    add_executable(${ARGN})
+    
     # this should fix the execution path to load local files from the project (for MSVC)
     if(MSVC)
         set_target_properties(${ARGV1} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
diff --git a/doc/BUILD_LINUX.md b/doc/BUILD_LINUX.md
index ac37950e..149679e2 100644
--- a/doc/BUILD_LINUX.md
+++ b/doc/BUILD_LINUX.md
@@ -1,17 +1,36 @@
 # How to build on Linux
 
-## How to build with GCC on Archlinux by the way
+## How to build on Ubuntu
+
+1. Install the required and useful packages to develop:
+```
+sudo apt install cmake make gcc g++ libvulkan-dev vulkan-validationlayers-dev vulkan-tools
+```
+2. Install the Vulkan drivers for your system:
+```
+# For most GPUs (except Nvidia):
+sudo apt install mesa-vulkan-drivers
+```
+3. Clone the repository and run the following commands:
+```
+mkdir debug
+cd debug
+cmake -DCMAKE_C_COMPILER="/usr/bin/gcc" -DCMAKE_CXX_COMPILER="/usr/bin/g++" -DCMAKE_BUILD_TYPE=Debug ..
+cmake --build .
+```
+
+## How to build on Archlinux by the way
 
 1. Install required and useful tools to develop:
 ```
-sudo pacman -S cmake gcc vulkan-icd-loader vulkan-headers vulkan-validation-layers vulkan-tools
+sudo pacman -S cmake make gcc vulkan-icd-loader vulkan-headers vulkan-validation-layers vulkan-tools
 ```
 2. Install the matching Vulkan drivers for your system:
 ```
 # For discrete Nvidia GPUs:
 sudo pacman -S nvidia
 
-# For integrated or discrete Radeon GPUs:
+# For integrated or discrete (AMD) Radeon GPUs:
 sudo pacman -S vulkan-radeon
 
 # For integrated or discrete Intel GPUs:
@@ -25,6 +44,8 @@ cmake -DCMAKE_C_COMPILER="/usr/bin/gcc" -DCMAKE_CXX_COMPILER="/usr/bin/g++" -DCM
 cmake --build .
 ```
 
-## How to build with Clang on Archlinux by the way
+## How to build with Clang on Linux
 
-Just follow the steps of "How to build with GCC on Archlinux by the way" but replace `gcc` with `clang` and `g++` with `clang++`.
+Just follow the steps of "How to build on YOUR DISTRO" but replace `gcc` with `clang` and `g++` with `clang++`.
+This should work actually but maybe the names of the packages are a little different. So look at your official 
+repository for the packages and their names if it doesn't work.
diff --git a/doc/BUILD_WINDOWS.md b/doc/BUILD_WINDOWS.md
index 215d4a62..729c202a 100644
--- a/doc/BUILD_WINDOWS.md
+++ b/doc/BUILD_WINDOWS.md
@@ -3,19 +3,20 @@
 ## How to build with MSVC on Windows
 
 1. Download and install [VulkanSDK](https://vulkan.lunarg.com/sdk/home#windows)
-2. Download and install [VisualStudio](https://visualstudio.microsoft.com/vs/features/cplusplus/) for MSVC
-3. (optional) Download and install [CLion](https://www.jetbrains.com/clion/) as IDE to develop
+2. Download and install [CMake](https://cmake.org/install/)
+3. Download and install [VisualStudio](https://visualstudio.microsoft.com/vs/features/cplusplus/) for MSVC
 4. Create and configure a project with the framework and build it
 
 ## How to build with GCC on Windows
 
 1. Install [MSYS2](https://www.msys2.org/)
 2. Run "MSYS2 MSYS" from Start menu
-3. Enter the following commands into MSYS2 console:
+3. Enter the following commands into MSYS2 console: (this will update and install required packages)
 ```
 pacman -Syu
 pacman -Su
 pacman -S --needed base-devel mingw-w64-x86_64-toolchain
+pacman -S mingw-w64-x86_64-vulkan-devel
 pacman -S cmake
 ```
 4. Add to Path:
diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt
index 997c907f..437021a6 100644
--- a/projects/CMakeLists.txt
+++ b/projects/CMakeLists.txt
@@ -1,5 +1,5 @@
 
-include(${vkcv_config_ext}/ProjectFix.cmake)
+include(${vkcv_config_ext}/Project.cmake)
 
 # Add new projects/examples here:
 add_subdirectory(first_triangle)
diff --git a/projects/bindless_textures/CMakeLists.txt b/projects/bindless_textures/CMakeLists.txt
index 4fee4464..86a93e04 100644
--- a/projects/bindless_textures/CMakeLists.txt
+++ b/projects/bindless_textures/CMakeLists.txt
@@ -5,21 +5,8 @@ project(bindless_textures)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(bindless_textures src/main.cpp)
-
-# this should fix the execution path to load local files from the project (for MSVC)
-if(MSVC)
-	set_target_properties(bindless_textures PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-	set_target_properties(bindless_textures PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-    
-    # in addition to setting the output directory, the working directory has to be set
-	# by default visual studio sets the working directory to the build directory, when using the debugger
-	set_target_properties(bindless_textures PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-endif()
+add_project(bindless_textures src/main.cpp)
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(bindless_textures SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_asset_loader_include} ${vkcv_camera_include} ${vkcv_shader_compiler_include})
diff --git a/projects/first_mesh/CMakeLists.txt b/projects/first_mesh/CMakeLists.txt
index 946031f9..03dfedd1 100644
--- a/projects/first_mesh/CMakeLists.txt
+++ b/projects/first_mesh/CMakeLists.txt
@@ -5,12 +5,8 @@ project(first_mesh)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(first_mesh src/main.cpp)
-fix_project(first_mesh)
+add_project(first_mesh src/main.cpp)
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(first_mesh SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_asset_loader_include} ${vkcv_camera_include} ${vkcv_shader_compiler_include})
diff --git a/projects/first_scene/CMakeLists.txt b/projects/first_scene/CMakeLists.txt
index 3d0a5ee7..266630fa 100644
--- a/projects/first_scene/CMakeLists.txt
+++ b/projects/first_scene/CMakeLists.txt
@@ -5,12 +5,8 @@ project(first_scene)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(first_scene src/main.cpp)
-fix_project(first_scene)
+add_project(first_scene src/main.cpp)
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(first_scene SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_asset_loader_include} ${vkcv_camera_include} ${vkcv_scene_include} ${vkcv_shader_compiler_include} ${vkcv_gui_include})
diff --git a/projects/first_triangle/CMakeLists.txt b/projects/first_triangle/CMakeLists.txt
index 793c2bc3..66097909 100644
--- a/projects/first_triangle/CMakeLists.txt
+++ b/projects/first_triangle/CMakeLists.txt
@@ -5,12 +5,8 @@ project(first_triangle)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(first_triangle src/main.cpp)
-fix_project(first_triangle)
+add_project(first_triangle src/main.cpp)
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(first_triangle SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_testing_include} ${vkcv_camera_include} ${vkcv_shader_compiler_include} ${vkcv_gui_include})
diff --git a/projects/head_demo/CMakeLists.txt b/projects/head_demo/CMakeLists.txt
index bd7e4800..82aebb08 100644
--- a/projects/head_demo/CMakeLists.txt
+++ b/projects/head_demo/CMakeLists.txt
@@ -5,12 +5,8 @@ project(head_demo)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(head_demo src/main.cpp)
-fix_project(head_demo)
+add_project(head_demo src/main.cpp)
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(head_demo SYSTEM BEFORE PRIVATE
diff --git a/projects/indirect_dispatch/CMakeLists.txt b/projects/indirect_dispatch/CMakeLists.txt
index 18a89c8e..53b0d1b1 100644
--- a/projects/indirect_dispatch/CMakeLists.txt
+++ b/projects/indirect_dispatch/CMakeLists.txt
@@ -5,11 +5,8 @@ project(indirect_dispatch)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(indirect_dispatch src/main.cpp)
+add_project(indirect_dispatch src/main.cpp)
 
 target_sources(indirect_dispatch PRIVATE
     src/App.hpp
@@ -27,8 +24,6 @@ target_sources(indirect_dispatch PRIVATE
     src/MotionBlurSetup.hpp
     src/MotionBlurSetup.cpp)
 
-fix_project(indirect_dispatch)
-
 # including headers of dependencies and the VkCV framework
 target_include_directories(indirect_dispatch SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_testing_include} ${vkcv_camera_include} ${vkcv_shader_compiler_include} ${vkcv_gui_include})
 
diff --git a/projects/indirect_draw/CMakeLists.txt b/projects/indirect_draw/CMakeLists.txt
index 83119e02..2802210d 100644
--- a/projects/indirect_draw/CMakeLists.txt
+++ b/projects/indirect_draw/CMakeLists.txt
@@ -5,21 +5,8 @@ project(indirect_draw)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(indirect_draw src/main.cpp)
-
-# this should fix the execution path to load local files from the project (for MSVC)
-if(MSVC)
-	set_target_properties(indirect_draw PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-	set_target_properties(indirect_draw PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-    
-    # in addition to setting the output directory, the working directory has to be set
-	# by default visual studio sets the working directory to the build directory, when using the debugger
-	set_target_properties(indirect_draw PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-endif()
+add_project(indirect_draw src/main.cpp)
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(indirect_draw SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_asset_loader_include} ${vkcv_camera_include} ${vkcv_shader_compiler_include} ${vkcv_gui_include})
diff --git a/projects/mesh_shader/CMakeLists.txt b/projects/mesh_shader/CMakeLists.txt
index 0eb0ca2e..04b632ef 100644
--- a/projects/mesh_shader/CMakeLists.txt
+++ b/projects/mesh_shader/CMakeLists.txt
@@ -5,12 +5,8 @@ project(mesh_shader)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(mesh_shader src/main.cpp)
-fix_project(mesh_shader)
+add_project(mesh_shader src/main.cpp)
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(mesh_shader SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_testing_include} ${vkcv_camera_include} ${vkcv_meshlet_include} ${vkcv_shader_compiler_include} ${vkcv_gui_include})
diff --git a/projects/particle_simulation/CMakeLists.txt b/projects/particle_simulation/CMakeLists.txt
index 3adede6e..860bfa15 100644
--- a/projects/particle_simulation/CMakeLists.txt
+++ b/projects/particle_simulation/CMakeLists.txt
@@ -5,19 +5,14 @@ project(particle_simulation)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(particle_simulation 
+add_project(particle_simulation
 		src/main.cpp
 		src/ParticleSystem.hpp 
 		src/ParticleSystem.cpp
 		src/Particle.hpp 
 		src/Particle.cpp)
 
-fix_project(particle_simulation)
-
 # including headers of dependencies and the VkCV framework
 target_include_directories(particle_simulation SYSTEM BEFORE PRIVATE
 		${vkcv_include}
diff --git a/projects/path_tracer/CMakeLists.txt b/projects/path_tracer/CMakeLists.txt
index b4ad74c3..56f14090 100644
--- a/projects/path_tracer/CMakeLists.txt
+++ b/projects/path_tracer/CMakeLists.txt
@@ -5,22 +5,8 @@ project(path_tracer)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(path_tracer
-		src/main.cpp)
-
-# this should fix the execution path to load local files from the project (for MSVC)
-if(MSVC)
-	set_target_properties(path_tracer PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-	set_target_properties(path_tracer PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-
-	# in addition to setting the output directory, the working directory has to be set
-	# by default visual studio sets the working directory to the build directory, when using the debugger
-	set_target_properties(path_tracer PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-endif()
+add_project(path_tracer src/main.cpp)
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(path_tracer SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_testing_include} ${vkcv_asset_loader_include} ${vkcv_camera_include} ${vkcv_shader_compiler_include} ${vkcv_gui_include})
diff --git a/projects/rtx_ambient_occlusion/CMakeLists.txt b/projects/rtx_ambient_occlusion/CMakeLists.txt
index e7d9be98..2c784a4f 100644
--- a/projects/rtx_ambient_occlusion/CMakeLists.txt
+++ b/projects/rtx_ambient_occlusion/CMakeLists.txt
@@ -5,9 +5,6 @@ project(rtx_ambient_occlusion)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 set(rtx_source ${PROJECT_SOURCE_DIR}/src/RTX)
 
 set(rtx_sources
@@ -19,20 +16,10 @@ set(rtx_sources
 
 		${rtx_source}/RTXExtensions.hpp
 		${rtx_source}/RTXExtensions.cpp
-		)
+)
 
 # adding source files to the project
-add_executable(rtx_ambient_occlusion src/main.cpp src/teapot.hpp ${rtx_sources})
-
-# this should fix the execution path to load local files from the project (for MSVC)
-if(MSVC)
-	set_target_properties(rtx_ambient_occlusion PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-	set_target_properties(rtx_ambient_occlusion PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-    
-    # in addition to setting the output directory, the working directory has to be set
-	# by default visual studio sets the working directory to the build directory, when using the debugger
-	set_target_properties(rtx_ambient_occlusion PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-endif()
+add_project(rtx_ambient_occlusion src/main.cpp src/teapot.hpp ${rtx_sources})
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(rtx_ambient_occlusion SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_asset_loader_include} ${vkcv_camera_include} ${vkcv_scene_include} ${vkcv_shader_compiler_include})
diff --git a/projects/saf_r/CMakeLists.txt b/projects/saf_r/CMakeLists.txt
index 158bf7a9..ca315a2d 100644
--- a/projects/saf_r/CMakeLists.txt
+++ b/projects/saf_r/CMakeLists.txt
@@ -5,24 +5,8 @@ project(saf_r)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(saf_r
-		src/main.cpp 
-		"src/safrScene.hpp" 
-		)
-
-# this should fix the execution path to load local files from the project (for MSVC)
-if(MSVC)
-	set_target_properties(saf_r PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-	set_target_properties(saf_r PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-
-	# in addition to setting the output directory, the working directory has to be set
-	# by default visual studio sets the working directory to the build directory, when using the debugger
-	set_target_properties(saf_r PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-endif()
+add_project(saf_r src/main.cpp "src/safrScene.hpp")
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(saf_r SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_testing_include} ${vkcv_asset_loader_include} ${vkcv_camera_include} ${vkcv_shader_compiler_include})
diff --git a/projects/sph/CMakeLists.txt b/projects/sph/CMakeLists.txt
index 985a3393..685004f7 100644
--- a/projects/sph/CMakeLists.txt
+++ b/projects/sph/CMakeLists.txt
@@ -5,19 +5,14 @@ project(sph)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(sph
+add_project(sph
 		src/main.cpp
 		src/Particle.hpp 
 		src/Particle.cpp
 		src/PipelineInit.hpp
 		src/PipelineInit.cpp)
 
-fix_project(sph)
-
 # including headers of dependencies and the VkCV framework
 target_include_directories(sph SYSTEM BEFORE PRIVATE
 		${vkcv_include}
diff --git a/projects/voxelization/CMakeLists.txt b/projects/voxelization/CMakeLists.txt
index 22a4848a..34178021 100644
--- a/projects/voxelization/CMakeLists.txt
+++ b/projects/voxelization/CMakeLists.txt
@@ -5,11 +5,8 @@ project(voxelization)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(voxelization src/main.cpp)
+add_project(voxelization src/main.cpp)
 
 target_sources(voxelization PRIVATE
     src/Voxelization.hpp
@@ -17,8 +14,6 @@ target_sources(voxelization PRIVATE
     src/ShadowMapping.hpp
     src/ShadowMapping.cpp)
 
-fix_project(voxelization)
-
 # including headers of dependencies and the VkCV framework
 target_include_directories(voxelization SYSTEM BEFORE PRIVATE
 		${vkcv_include}
diff --git a/projects/wobble_bobble/CMakeLists.txt b/projects/wobble_bobble/CMakeLists.txt
index 9842b13b..6c90d522 100644
--- a/projects/wobble_bobble/CMakeLists.txt
+++ b/projects/wobble_bobble/CMakeLists.txt
@@ -5,14 +5,8 @@ project(wobble_bobble)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# this should fix the execution path to load local files from the project
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
 # adding source files to the project
-add_executable(wobble_bobble
-		src/main.cpp)
-
-fix_project(wobble_bobble)
+add_project(wobble_bobble src/main.cpp)
 
 # including headers of dependencies and the VkCV framework
 target_include_directories(wobble_bobble SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_camera_include} ${vkcv_gui_include} ${vkcv_shader_compiler_include})
-- 
GitLab