-
Notifications
You must be signed in to change notification settings - Fork 53
Visual Studio/Ninja Multi-Config Build workflow branch from 109a4f4 #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c59a56e
6fd7883
d8640f4
19a620b
aa83dc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| cmake_minimum_required (VERSION 3.29) | ||
|
|
||
| project (VulkanTutorialRoot) | ||
| # This is to allow the CMakeLists.txt files in attachments/ to be accessed from root level | ||
| # Use command: cmake -S . -B build to configure from root level | ||
| # Then use command: cmake --build build to build from root level | ||
| # This will generate the build files in the build/ directory | ||
| # The build files will reference the source files in the attachments/ directory | ||
| # No need to change or delete any lines in attachments/ CMakeLists.txt files | ||
| # You can still build from attachments/ directory if needed | ||
| # Just navigate to attachments/ and run cmake and build commands as usual | ||
| add_subdirectory(attachments) | ||
|
|
||
| # Any other subdirectories can be added here | ||
| # Need to be carefull using CMAKE_SOURCE_DIR is points to the root level CMakeLists.txt | ||
| # Use CMAKE_CURRENT_SOURCE_DIR to point to the current directory instead | ||
| # For Simple Vulkan Engine project please uncomment the following line | ||
| # add_subdirectory(attachments/simple_engine) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm... I didn't test having both projects setup like this. One that builds the main tutorial and the other that builds the engine. I can't think why it wouldn't work. However, the "working directory" for when you "run" the engine or the tutorial might feel a bit odd. I think for the game engine, that pattern might not be pleasant as the map and assets are quite large. We do provide a script to download the project. Maybe a pattern to enable the game engine to work with this is to include the packaging phase of CMake. Thus, this constraint would have a side benefit of demonstrating how to create an install for a non-trivial Vulkan project. That might feel a bit beyond the scope for the game engine so will ask for feedback on if that's a wise idea.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I did not test to cmake the engine from the root directory. But my setup work with main tutorial at the attachments directory smoothly. For time being I do not suggest doing cmake from root directory for engine because I do not know what is there and what it will be break. But the suggestion in comment is valid and could be implanted very easily any time if you be carefully following the suggestion I put in the comment. Meanwhile I'm trying to make live easy for tutorial part. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't you just be able to cmake -S attachments -B build from the root level and achieve the same thing?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi gpx1000
Yes, you can do that too. The idea here is to be able to cmake from root and from attachments directory or any decent directory if it is having CMakeLists.txt. But if you select to cmake from root it will be going into massive configuration stage for all projects under the root. But in cmake build stage I think I will go with selecting the target more than cmake all targets for time saving. Anyway, my recommendation will not break anything except just the notes I provided below.
Here is commands from the root directory
cmake -S attachments -B attachments/build/msvc -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
OR from attachments directory cmake -S . -B build/msvc -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="../"
Also if you want to use root CMakeLists.txt
cmake -S . -B build/msvc -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"