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 d3f26b4a5323f473868d87cc94d39b52eafd4313..9ac765779fb241cc190a0a9b2e934d90ad50b2a5 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 ac37950ebe951f5c2ea40e4354d1f45a351b6e27..149679e24a05fbeb8ce65346b7df9de0392c41c2 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 215d4a625ea549635aa7d06a03469486890eb6c0..729c202abac9273a821c7d21ac2ad1536a887045 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 997c907fb26db2344f028ff5eaec8de3f69038b7..437021a6b2ea52ae4a3fccff625f0c7e2ef8ddd0 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 4fee446461da3de2d3d951c63e44425a7150a722..86a93e04427d7ff103bda1dbd5a4602ff337d639 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 946031f922d7f6b4e2fc5db43c2ef92d48de2691..03dfedd13fc2fd51a920dbe01d06d91ca5ada8b0 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 3d0a5ee7e32ea1ad4cfdd0744e00ad15d69a7541..266630fae0de1d4d9696d454c101bf00085b7599 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 793c2bc37db08c9fe744a56c97f474e1e2d17c4f..660979099b0fe0096478443a86ddf48c14bd61b0 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 bd7e48000320d4c1304a3b9f3b26fe54421f818c..82aebb083054b80f3cf9cbb1bddb94f447e81903 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 18a89c8e1966b1e0ee509afd716c1410d9d671d8..53b0d1b15dc2eeb32308e16ad81d476ed502d370 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 83119e02b2d5419f7fdf5c04363218b57fc4217a..2802210db6111d833172933452bb25abb90a5c5b 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 0eb0ca2e45daa7486a80ea897a2397c1d3ac1ba3..04b632effa28101a105100c768da712676378c99 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 3adede6e25f88208824144b63a866ccabdfc5be9..860bfa15a4b77b71ac79e3433326feb6aa3d7123 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 b4ad74c3e31d17861644b6255fda718b783c28c9..56f14090ce68b91d0d7163360faaf413fb9e3de9 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 e7d9be987b6352eda6dc70051051b74063eac8a0..2c784a4f173ea5d6e0de1df1a2cfe514a5787153 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 158bf7a984ada2711bd3e9655e25f3f3cbce16d3..ca315a2d294c792615ad7bc18ec55f132103c270 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 985a33938b02202d05ac84a03dd505a35dd6b8a6..685004f7be9d8f4ef3e0409543dbb0f964d55e9c 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 22a4848aa5f5d0b4cdaf61cb48a6dafde4bb66d9..34178021a517485e54ef8dcafe0f170a834e5186 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 9842b13b1038d61414de5c2cf2a9107604b6fe16..6c90d5222859ccd829cbb5a63ea367cc47214fb3 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})