From df8f35e171f7ba64bfacbd2b8ad4a67257ce292a Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 10:31:44 -0800 Subject: [PATCH 01/15] Switch from vcpkg manifest mode to classic mode and disable manifest mode by default on Windows Remove vcpkg.json manifest file and update installation scripts to use classic mode with explicit package list. Add CMake configuration to disable manifest mode by default on Windows to ensure compatibility with all vcpkg installations, including standalone packages and Visual Studio which may not have git or baseline support. --- attachments/CMakeLists.txt | 9 +++++++++ attachments/simple_engine/CMakeLists.txt | 9 +++++++++ .../simple_engine/install_dependencies_windows.bat | 4 ++-- scripts/install_dependencies_windows.bat | 6 +++--- scripts/vcpkg.json | 13 ------------- 5 files changed, 23 insertions(+), 18 deletions(-) delete mode 100644 scripts/vcpkg.json diff --git a/attachments/CMakeLists.txt b/attachments/CMakeLists.txt index 5d2cb6cf..dbc80be2 100644 --- a/attachments/CMakeLists.txt +++ b/attachments/CMakeLists.txt @@ -1,5 +1,14 @@ cmake_minimum_required (VERSION 3.29) +# vcpkg integration +if(WIN32) + # By default, we disable manifest mode to ensure compatibility with all vcpkg installations, + # including those from standalone packages and Visual Studio which may not have git or a baseline. + if(NOT DEFINED VCPKG_MANIFEST_MODE) + set(VCPKG_MANIFEST_MODE OFF CACHE BOOL "Use vcpkg manifest mode") + endif() +endif() + project (VulkanTutorial) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") diff --git a/attachments/simple_engine/CMakeLists.txt b/attachments/simple_engine/CMakeLists.txt index fd57faf7..5550638d 100644 --- a/attachments/simple_engine/CMakeLists.txt +++ b/attachments/simple_engine/CMakeLists.txt @@ -1,5 +1,14 @@ cmake_minimum_required(VERSION 3.29) +# vcpkg integration +if(WIN32) + # By default, we disable manifest mode to ensure compatibility with all vcpkg installations, + # including those from standalone packages and Visual Studio which may not have git or a baseline. + if(NOT DEFINED VCPKG_MANIFEST_MODE) + set(VCPKG_MANIFEST_MODE OFF CACHE BOOL "Use vcpkg manifest mode") + endif() +endif() + project(SimpleEngine VERSION 1.0.0 LANGUAGES CXX C) # Option to enable/disable Vulkan C++20 module support for this standalone project diff --git a/attachments/simple_engine/install_dependencies_windows.bat b/attachments/simple_engine/install_dependencies_windows.bat index 0fe383f4..590fd419 100644 --- a/attachments/simple_engine/install_dependencies_windows.bat +++ b/attachments/simple_engine/install_dependencies_windows.bat @@ -24,9 +24,9 @@ set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite :: Create cache directory if it doesn't exist if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache -:: Install all dependencies at once using vcpkg with parallel installation +:: Install all dependencies at once using vcpkg in classic mode echo Installing all dependencies... -vcpkg install --triplet=x64-windows --x-manifest-root=%~dp0 --feature-flags=binarycaching,manifests --x-install-root=%VCPKG_INSTALLATION_ROOT%/installed +vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows :: Remind about Vulkan SDK echo. diff --git a/scripts/install_dependencies_windows.bat b/scripts/install_dependencies_windows.bat index bd8ff37c..986b0cf1 100644 --- a/scripts/install_dependencies_windows.bat +++ b/scripts/install_dependencies_windows.bat @@ -21,9 +21,9 @@ set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite :: Create cache directory if it doesn't exist if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache -:: Install all dependencies at once using vcpkg with parallel installation +:: Install all dependencies at once using vcpkg in classic mode echo Installing all dependencies... -vcpkg install --triplet=x64-windows --x-manifest-root=%~dp0\.. --feature-flags=binarycaching,manifests --x-install-root=%VCPKG_INSTALLATION_ROOT%/installed +vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows :: Remind about Vulkan SDK echo. @@ -34,7 +34,7 @@ echo All dependencies have been installed successfully! echo You can now use CMake to build your Vulkan project. echo. echo Example CMake command: -echo cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=[path\to\vcpkg]\scripts\buildsystems\vcpkg.cmake +echo cmake -B build -S attachments -DCMAKE_TOOLCHAIN_FILE=[path\to\vcpkg]\scripts\buildsystems\vcpkg.cmake echo cmake --build build exit /b 0 diff --git a/scripts/vcpkg.json b/scripts/vcpkg.json deleted file mode 100644 index 0a90e24d..00000000 --- a/scripts/vcpkg.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "vulkan-tutorial", - "version": "1.0.0", - "dependencies": [ - "glfw3", - "glm", - "tinyobjloader", - "stb", - "tinygltf", - "nlohmann-json", - "ktx" - ] -} From be6848ee96e9380d588403f79b2d13c26d9429ab Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 10:53:43 -0800 Subject: [PATCH 02/15] Refactor FindKTX.cmake to fix FetchContent fallback and improve cross-platform compatibility Move FindPackageHandleStandardArgs call after FetchContent fallback to ensure KTX_FOUND is properly set when fetching from GitHub. Remove premature error messages and debug output, and restructure target creation to work correctly with both system-installed and fetched KTX libraries. --- attachments/CMake/FindKTX.cmake | 54 ++++++++++--------- attachments/simple_engine/CMake/FindKTX.cmake | 54 ++++++++++--------- 2 files changed, 58 insertions(+), 50 deletions(-) diff --git a/attachments/CMake/FindKTX.cmake b/attachments/CMake/FindKTX.cmake index ac6971a2..2d466762 100644 --- a/attachments/CMake/FindKTX.cmake +++ b/attachments/CMake/FindKTX.cmake @@ -24,7 +24,7 @@ else() pkg_check_modules(PC_KTX QUIET ktx libktx ktx2 libktx2) endif() - # Try to find KTX using standard find_package + # Try to find KTX using standard find_path/find_library find_path(KTX_INCLUDE_DIR NAMES ktx.h PATH_SUFFIXES include ktx KTX ktx2 KTX2 @@ -51,35 +51,18 @@ else() ${CMAKE_SOURCE_DIR}/external/ktx/lib ) - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(KTX - REQUIRED_VARS KTX_INCLUDE_DIR KTX_LIBRARY - FAIL_MESSAGE "" # Suppress the error message to allow our fallback - ) - - # Debug output if KTX is not found (only on non-Linux platforms) - if(NOT KTX_FOUND) - message(STATUS "KTX include directory search paths: ${PC_KTX_INCLUDEDIR}, /usr/include, /usr/local/include, $ENV{KTX_DIR}/include, $ENV{VULKAN_SDK}/include, ${CMAKE_SOURCE_DIR}/external/ktx/include") - message(STATUS "KTX library search paths: ${PC_KTX_LIBDIR}, /usr/lib, /usr/lib64, /usr/local/lib, /usr/local/lib64, $ENV{KTX_DIR}/lib, $ENV{VULKAN_SDK}/lib, ${CMAKE_SOURCE_DIR}/external/ktx/lib") + if(KTX_INCLUDE_DIR AND KTX_LIBRARY) + set(KTX_FOUND TRUE) + else() + set(KTX_FOUND FALSE) endif() endif() -if(KTX_FOUND) - set(KTX_INCLUDE_DIRS ${KTX_INCLUDE_DIR}) - set(KTX_LIBRARIES ${KTX_LIBRARY}) - - if(NOT TARGET KTX::ktx) - add_library(KTX::ktx UNKNOWN IMPORTED) - set_target_properties(KTX::ktx PROPERTIES - IMPORTED_LOCATION "${KTX_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${KTX_INCLUDE_DIRS}" - ) - endif() -else() - # If not found, use FetchContent to download and build +# If not found, use FetchContent to download and build +if(NOT KTX_FOUND) include(FetchContent) - # Only show the message on non-Linux platforms + # Only show the message on non-Linux platforms (on Linux we expect to fetch) if(NOT (UNIX AND NOT APPLE)) message(STATUS "KTX not found, fetching from GitHub...") endif() @@ -104,3 +87,24 @@ else() set(KTX_FOUND TRUE) endif() + +# Finalize the variables and targets +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(KTX + REQUIRED_VARS KTX_FOUND +) + +if(KTX_FOUND) + if(KTX_INCLUDE_DIR AND KTX_LIBRARY) + set(KTX_INCLUDE_DIRS ${KTX_INCLUDE_DIR}) + set(KTX_LIBRARIES ${KTX_LIBRARY}) + + if(NOT TARGET KTX::ktx) + add_library(KTX::ktx UNKNOWN IMPORTED) + set_target_properties(KTX::ktx PROPERTIES + IMPORTED_LOCATION "${KTX_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${KTX_INCLUDE_DIRS}" + ) + endif() + endif() +endif() diff --git a/attachments/simple_engine/CMake/FindKTX.cmake b/attachments/simple_engine/CMake/FindKTX.cmake index c8c1c22c..c3166302 100644 --- a/attachments/simple_engine/CMake/FindKTX.cmake +++ b/attachments/simple_engine/CMake/FindKTX.cmake @@ -24,7 +24,7 @@ else() pkg_check_modules(PC_KTX QUIET ktx libktx ktx2 libktx2) endif() - # Try to find KTX using standard find_package + # Try to find KTX using standard find_path/find_library find_path(KTX_INCLUDE_DIR NAMES ktx.h PATH_SUFFIXES include ktx KTX ktx2 KTX2 @@ -51,35 +51,18 @@ else() ${CMAKE_SOURCE_DIR}/external/ktx/lib ) - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(KTX - REQUIRED_VARS KTX_INCLUDE_DIR KTX_LIBRARY - FAIL_MESSAGE "" # Suppress the error message to allow our fallback - ) - - # Debug output if KTX is not found (only on non-Linux platforms) - if(NOT KTX_FOUND) - message(STATUS "KTX include directory search paths: ${PC_KTX_INCLUDEDIR}, /usr/include, /usr/local/include, $ENV{KTX_DIR}/include, $ENV{VULKAN_SDK}/include, ${CMAKE_SOURCE_DIR}/external/ktx/include") - message(STATUS "KTX library search paths: ${PC_KTX_LIBDIR}, /usr/lib, /usr/lib64, /usr/local/lib, /usr/local/lib64, $ENV{KTX_DIR}/lib, $ENV{VULKAN_SDK}/lib, ${CMAKE_SOURCE_DIR}/external/ktx/lib") + if(KTX_INCLUDE_DIR AND KTX_LIBRARY) + set(KTX_FOUND TRUE) + else() + set(KTX_FOUND FALSE) endif() endif() -if(KTX_FOUND) - set(KTX_INCLUDE_DIRS ${KTX_INCLUDE_DIR}) - set(KTX_LIBRARIES ${KTX_LIBRARY}) - - if(NOT TARGET KTX::ktx) - add_library(KTX::ktx UNKNOWN IMPORTED) - set_target_properties(KTX::ktx PROPERTIES - IMPORTED_LOCATION "${KTX_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${KTX_INCLUDE_DIRS}" - ) - endif() -else() - # If not found, use FetchContent to download and build +# If not found, use FetchContent to download and build +if(NOT KTX_FOUND) include(FetchContent) - # Only show the message on non-Linux platforms + # Only show the message on non-Linux platforms (on Linux we expect to fetch) if(NOT (UNIX AND NOT APPLE)) message(STATUS "KTX not found, fetching from GitHub...") endif() @@ -104,3 +87,24 @@ else() set(KTX_FOUND TRUE) endif() + +# Finalize the variables and targets +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(KTX + REQUIRED_VARS KTX_FOUND +) + +if(KTX_FOUND) + if(KTX_INCLUDE_DIR AND KTX_LIBRARY) + set(KTX_INCLUDE_DIRS ${KTX_INCLUDE_DIR}) + set(KTX_LIBRARIES ${KTX_LIBRARY}) + + if(NOT TARGET KTX::ktx) + add_library(KTX::ktx UNKNOWN IMPORTED) + set_target_properties(KTX::ktx PROPERTIES + IMPORTED_LOCATION "${KTX_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${KTX_INCLUDE_DIRS}" + ) + endif() + endif() +endif() From 46cc6828f0465544b41c7fe7bef137bbbfa0d3df Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 11:01:08 -0800 Subject: [PATCH 03/15] Update vcpkg.json to restrict dependencies to Windows platform and fix classic mode installation Change package name to "simple-engine" and add platform specifiers to all dependencies. Update install script to use temporary manifest root directory for proper vcpkg classic mode operation, preventing manifest mode conflicts. --- .../install_dependencies_windows.bat | 6 ++++-- attachments/simple_engine/vcpkg.json | 18 ++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/attachments/simple_engine/install_dependencies_windows.bat b/attachments/simple_engine/install_dependencies_windows.bat index 590fd419..f807c5f9 100644 --- a/attachments/simple_engine/install_dependencies_windows.bat +++ b/attachments/simple_engine/install_dependencies_windows.bat @@ -24,9 +24,11 @@ set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite :: Create cache directory if it doesn't exist if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache -:: Install all dependencies at once using vcpkg in classic mode +:: Install all dependencies at once using vcpkg in classic mode by pointing to an empty manifest root echo Installing all dependencies... -vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows +if not exist %TEMP%\vcpkg-classic-mode mkdir %TEMP%\vcpkg-classic-mode +vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows --x-manifest-root=%TEMP%\vcpkg-classic-mode +rmdir %TEMP%\vcpkg-classic-mode :: Remind about Vulkan SDK echo. diff --git a/attachments/simple_engine/vcpkg.json b/attachments/simple_engine/vcpkg.json index 0ec18a26..f4dc3e27 100644 --- a/attachments/simple_engine/vcpkg.json +++ b/attachments/simple_engine/vcpkg.json @@ -1,18 +1,16 @@ { - "name": "vulkan-game-engine-tutorial", + "name": "simple-engine", "version": "1.0.0", "dependencies": [ - { - "name": "glfw3", - "platform": "!android" - }, - "glm", - "openal-soft", + { "name": "glfw3", "platform": "windows" }, + { "name": "glm", "platform": "windows" }, + { "name": "openal-soft", "platform": "windows" }, + { "name": "tinygltf", "platform": "windows" }, + { "name": "nlohmann-json", "platform": "windows" }, { "name": "ktx", + "platform": "windows", "features": [ "vulkan" ] - }, - "tinygltf", - "nlohmann-json" + } ] } From b4074b05668aec174943a15692f6746fd56f7276 Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 11:01:32 -0800 Subject: [PATCH 04/15] Add openal-soft dependency and fix vcpkg classic mode installation Add openal-soft to vcpkg.json dependencies. Update Windows install script to use temporary manifest root directory to prevent manifest mode conflicts when running vcpkg in classic mode. --- scripts/install_dependencies_windows.bat | 6 ++++-- vcpkg.json | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/install_dependencies_windows.bat b/scripts/install_dependencies_windows.bat index 986b0cf1..c46a2ed6 100644 --- a/scripts/install_dependencies_windows.bat +++ b/scripts/install_dependencies_windows.bat @@ -21,9 +21,11 @@ set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite :: Create cache directory if it doesn't exist if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache -:: Install all dependencies at once using vcpkg in classic mode +:: Install all dependencies at once using vcpkg in classic mode by pointing to an empty manifest root echo Installing all dependencies... -vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows +if not exist %TEMP%\vcpkg-classic-mode mkdir %TEMP%\vcpkg-classic-mode +vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows --x-manifest-root=%TEMP%\vcpkg-classic-mode +rmdir %TEMP%\vcpkg-classic-mode :: Remind about Vulkan SDK echo. diff --git a/vcpkg.json b/vcpkg.json index 0a90e24d..50d26741 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,6 +8,7 @@ "stb", "tinygltf", "nlohmann-json", + "openal-soft", "ktx" ] } From de6f1ad60999e961cbf63d6418211bb0397da878 Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 11:09:55 -0800 Subject: [PATCH 05/15] Add vcpkg CONFIG mode support to Find modules and prioritize custom CMake module path Try to find packages using CONFIG mode first (e.g., from vcpkg) before falling back to pkg-config or manual search. Create alias targets when needed to ensure compatibility. Change CMAKE_MODULE_PATH from APPEND to PREPEND to prioritize custom find modules. Downgrade KTX version to v4.3.1 for stability. Remove trailing whitespace. --- attachments/CMake/FindKTX.cmake | 11 +++++++++++ attachments/CMake/Findglm.cmake | 12 +++++++++++- attachments/CMake/Findnlohmann_json.cmake | 10 ++++++++++ attachments/CMake/Findtinygltf.cmake | 10 ++++++++++ attachments/CMake/Findtinyobjloader.cmake | 12 +++++++++++- attachments/CMakeLists.txt | 2 +- attachments/simple_engine/CMake/FindKTX.cmake | 13 ++++++++++++- attachments/simple_engine/CMake/Findglm.cmake | 12 +++++++++++- .../simple_engine/CMake/Findnlohmann_json.cmake | 10 ++++++++++ attachments/simple_engine/CMake/Findtinygltf.cmake | 10 ++++++++++ .../simple_engine/CMake/Findtinyobjloader.cmake | 12 +++++++++++- attachments/simple_engine/CMakeLists.txt | 2 +- 12 files changed, 109 insertions(+), 7 deletions(-) diff --git a/attachments/CMake/FindKTX.cmake b/attachments/CMake/FindKTX.cmake index 2d466762..d054af10 100644 --- a/attachments/CMake/FindKTX.cmake +++ b/attachments/CMake/FindKTX.cmake @@ -13,6 +13,17 @@ # KTX::ktx # +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +find_package(ktx CONFIG QUIET) + +if(ktx_FOUND) + if(NOT TARGET KTX::ktx AND TARGET ktx::ktx) + add_library(KTX::ktx ALIAS ktx::ktx) + endif() + set(KTX_FOUND TRUE) + return() +endif() + # Check if we're on Linux - if so, we'll skip the search and directly use FetchContent if(UNIX AND NOT APPLE) # On Linux, we assume KTX is not installed and proceed directly to fetching it diff --git a/attachments/CMake/Findglm.cmake b/attachments/CMake/Findglm.cmake index fdf113cf..65d13f70 100644 --- a/attachments/CMake/Findglm.cmake +++ b/attachments/CMake/Findglm.cmake @@ -12,6 +12,16 @@ # glm::glm # +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +find_package(glm CONFIG QUIET) + +if(glm_FOUND) + if(NOT TARGET glm::glm AND TARGET glm) + add_library(glm::glm ALIAS glm) + endif() + return() +endif() + # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -94,7 +104,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(glm +find_package_handle_standard_args(glm REQUIRED_VARS glm_INCLUDE_DIR ) diff --git a/attachments/CMake/Findnlohmann_json.cmake b/attachments/CMake/Findnlohmann_json.cmake index 61dc66a6..bbc583a7 100644 --- a/attachments/CMake/Findnlohmann_json.cmake +++ b/attachments/CMake/Findnlohmann_json.cmake @@ -12,6 +12,16 @@ # nlohmann_json::nlohmann_json # +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +find_package(nlohmann_json CONFIG QUIET) + +if(nlohmann_json_FOUND) + if(NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json) + add_library(nlohmann_json::nlohmann_json ALIAS nlohmann_json) + endif() + return() +endif() + # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) diff --git a/attachments/CMake/Findtinygltf.cmake b/attachments/CMake/Findtinygltf.cmake index b2412350..1228e3c0 100644 --- a/attachments/CMake/Findtinygltf.cmake +++ b/attachments/CMake/Findtinygltf.cmake @@ -12,6 +12,16 @@ # tinygltf::tinygltf # +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +find_package(tinygltf CONFIG QUIET) + +if(tinygltf_FOUND) + if(NOT TARGET tinygltf::tinygltf AND TARGET tinygltf) + add_library(tinygltf::tinygltf ALIAS tinygltf) + endif() + return() +endif() + # First, try to find nlohmann_json find_package(nlohmann_json QUIET) if(NOT nlohmann_json_FOUND) diff --git a/attachments/CMake/Findtinyobjloader.cmake b/attachments/CMake/Findtinyobjloader.cmake index 4b1fb44c..4fff4a4a 100644 --- a/attachments/CMake/Findtinyobjloader.cmake +++ b/attachments/CMake/Findtinyobjloader.cmake @@ -9,6 +9,16 @@ # It also defines the following targets: # tinyobjloader::tinyobjloader +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +find_package(tinyobjloader CONFIG QUIET) + +if(tinyobjloader_FOUND) + if(NOT TARGET tinyobjloader::tinyobjloader AND TARGET tinyobjloader) + add_library(tinyobjloader::tinyobjloader ALIAS tinyobjloader) + endif() + return() +endif() + # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -109,7 +119,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(tinyobjloader +find_package_handle_standard_args(tinyobjloader REQUIRED_VARS tinyobjloader_INCLUDE_DIR ) diff --git a/attachments/CMakeLists.txt b/attachments/CMakeLists.txt index dbc80be2..bc048f45 100644 --- a/attachments/CMakeLists.txt +++ b/attachments/CMakeLists.txt @@ -11,7 +11,7 @@ endif() project (VulkanTutorial) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") +list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") # Add option to enable/disable C++ 20 module option(ENABLE_CPP20_MODULE "Enable C++ 20 module support for Vulkan" OFF) diff --git a/attachments/simple_engine/CMake/FindKTX.cmake b/attachments/simple_engine/CMake/FindKTX.cmake index c3166302..d054af10 100644 --- a/attachments/simple_engine/CMake/FindKTX.cmake +++ b/attachments/simple_engine/CMake/FindKTX.cmake @@ -13,6 +13,17 @@ # KTX::ktx # +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +find_package(ktx CONFIG QUIET) + +if(ktx_FOUND) + if(NOT TARGET KTX::ktx AND TARGET ktx::ktx) + add_library(KTX::ktx ALIAS ktx::ktx) + endif() + set(KTX_FOUND TRUE) + return() +endif() + # Check if we're on Linux - if so, we'll skip the search and directly use FetchContent if(UNIX AND NOT APPLE) # On Linux, we assume KTX is not installed and proceed directly to fetching it @@ -70,7 +81,7 @@ if(NOT KTX_FOUND) FetchContent_Declare( ktx GIT_REPOSITORY https://github.com/KhronosGroup/KTX-Software.git - GIT_TAG v4.4.2 # Use a specific tag for stability + GIT_TAG v4.3.1 # Use a specific tag for stability ) # Set options to minimize build time and dependencies diff --git a/attachments/simple_engine/CMake/Findglm.cmake b/attachments/simple_engine/CMake/Findglm.cmake index fdf113cf..65d13f70 100644 --- a/attachments/simple_engine/CMake/Findglm.cmake +++ b/attachments/simple_engine/CMake/Findglm.cmake @@ -12,6 +12,16 @@ # glm::glm # +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +find_package(glm CONFIG QUIET) + +if(glm_FOUND) + if(NOT TARGET glm::glm AND TARGET glm) + add_library(glm::glm ALIAS glm) + endif() + return() +endif() + # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -94,7 +104,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(glm +find_package_handle_standard_args(glm REQUIRED_VARS glm_INCLUDE_DIR ) diff --git a/attachments/simple_engine/CMake/Findnlohmann_json.cmake b/attachments/simple_engine/CMake/Findnlohmann_json.cmake index 61dc66a6..bbc583a7 100644 --- a/attachments/simple_engine/CMake/Findnlohmann_json.cmake +++ b/attachments/simple_engine/CMake/Findnlohmann_json.cmake @@ -12,6 +12,16 @@ # nlohmann_json::nlohmann_json # +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +find_package(nlohmann_json CONFIG QUIET) + +if(nlohmann_json_FOUND) + if(NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json) + add_library(nlohmann_json::nlohmann_json ALIAS nlohmann_json) + endif() + return() +endif() + # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) diff --git a/attachments/simple_engine/CMake/Findtinygltf.cmake b/attachments/simple_engine/CMake/Findtinygltf.cmake index b2412350..1228e3c0 100644 --- a/attachments/simple_engine/CMake/Findtinygltf.cmake +++ b/attachments/simple_engine/CMake/Findtinygltf.cmake @@ -12,6 +12,16 @@ # tinygltf::tinygltf # +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +find_package(tinygltf CONFIG QUIET) + +if(tinygltf_FOUND) + if(NOT TARGET tinygltf::tinygltf AND TARGET tinygltf) + add_library(tinygltf::tinygltf ALIAS tinygltf) + endif() + return() +endif() + # First, try to find nlohmann_json find_package(nlohmann_json QUIET) if(NOT nlohmann_json_FOUND) diff --git a/attachments/simple_engine/CMake/Findtinyobjloader.cmake b/attachments/simple_engine/CMake/Findtinyobjloader.cmake index 4b1fb44c..4fff4a4a 100644 --- a/attachments/simple_engine/CMake/Findtinyobjloader.cmake +++ b/attachments/simple_engine/CMake/Findtinyobjloader.cmake @@ -9,6 +9,16 @@ # It also defines the following targets: # tinyobjloader::tinyobjloader +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +find_package(tinyobjloader CONFIG QUIET) + +if(tinyobjloader_FOUND) + if(NOT TARGET tinyobjloader::tinyobjloader AND TARGET tinyobjloader) + add_library(tinyobjloader::tinyobjloader ALIAS tinyobjloader) + endif() + return() +endif() + # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -109,7 +119,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(tinyobjloader +find_package_handle_standard_args(tinyobjloader REQUIRED_VARS tinyobjloader_INCLUDE_DIR ) diff --git a/attachments/simple_engine/CMakeLists.txt b/attachments/simple_engine/CMakeLists.txt index 5550638d..9d6e11bd 100644 --- a/attachments/simple_engine/CMakeLists.txt +++ b/attachments/simple_engine/CMakeLists.txt @@ -20,7 +20,7 @@ if(ENABLE_CPP20_MODULE) endif() # Add CMake module path for custom find modules -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") +list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") # Find required packages find_package (glm REQUIRED) From 67a28b91a90f8c110596399f4eedf9405508cfe7 Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 14:13:51 -0800 Subject: [PATCH 06/15] Restrict vcpkg dependencies to Windows platform and improve CMake module path handling Add platform specifiers to all vcpkg dependencies and enable vulkan feature for ktx. Move CMAKE_MODULE_PATH configuration before project() call to ensure custom find modules are prioritized. Update all Find modules to use _find_package when available for better vcpkg integration. Add vcpkg CONFIG mode support to Findstb.cmake. Remove trailing whitespace. --- attachments/CMake/FindKTX.cmake | 6 +++++- attachments/CMake/Findglm.cmake | 6 +++++- attachments/CMake/Findnlohmann_json.cmake | 6 +++++- attachments/CMake/Findstb.cmake | 18 +++++++++++++++-- attachments/CMake/Findtinygltf.cmake | 12 +++++++++-- attachments/CMake/Findtinyobjloader.cmake | 6 +++++- attachments/CMakeLists.txt | 4 ++-- attachments/simple_engine/CMake/FindKTX.cmake | 6 +++++- attachments/simple_engine/CMake/Findglm.cmake | 6 +++++- .../CMake/Findnlohmann_json.cmake | 6 +++++- attachments/simple_engine/CMake/Findstb.cmake | 18 +++++++++++++++-- .../simple_engine/CMake/Findtinygltf.cmake | 12 +++++++++-- .../CMake/Findtinyobjloader.cmake | 6 +++++- attachments/simple_engine/CMakeLists.txt | 5 ++--- vcpkg.json | 20 +++++++++++-------- 15 files changed, 108 insertions(+), 29 deletions(-) diff --git a/attachments/CMake/FindKTX.cmake b/attachments/CMake/FindKTX.cmake index d054af10..92f1c6b6 100644 --- a/attachments/CMake/FindKTX.cmake +++ b/attachments/CMake/FindKTX.cmake @@ -14,7 +14,11 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(ktx CONFIG QUIET) +if(COMMAND _find_package) + _find_package(ktx CONFIG QUIET) +else() + find_package(ktx CONFIG QUIET) +endif() if(ktx_FOUND) if(NOT TARGET KTX::ktx AND TARGET ktx::ktx) diff --git a/attachments/CMake/Findglm.cmake b/attachments/CMake/Findglm.cmake index 65d13f70..d2021336 100644 --- a/attachments/CMake/Findglm.cmake +++ b/attachments/CMake/Findglm.cmake @@ -13,7 +13,11 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(glm CONFIG QUIET) +if(COMMAND _find_package) + _find_package(glm CONFIG QUIET) +else() + find_package(glm CONFIG QUIET) +endif() if(glm_FOUND) if(NOT TARGET glm::glm AND TARGET glm) diff --git a/attachments/CMake/Findnlohmann_json.cmake b/attachments/CMake/Findnlohmann_json.cmake index bbc583a7..670c8706 100644 --- a/attachments/CMake/Findnlohmann_json.cmake +++ b/attachments/CMake/Findnlohmann_json.cmake @@ -13,7 +13,11 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(nlohmann_json CONFIG QUIET) +if(COMMAND _find_package) + _find_package(nlohmann_json CONFIG QUIET) +else() + find_package(nlohmann_json CONFIG QUIET) +endif() if(nlohmann_json_FOUND) if(NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json) diff --git a/attachments/CMake/Findstb.cmake b/attachments/CMake/Findstb.cmake index 6ccf72f5..766985d6 100644 --- a/attachments/CMake/Findstb.cmake +++ b/attachments/CMake/Findstb.cmake @@ -12,6 +12,20 @@ # stb::stb # +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +if(COMMAND _find_package) + _find_package(stb CONFIG QUIET) +else() + find_package(stb CONFIG QUIET) +endif() + +if(stb_FOUND) + if(NOT TARGET stb::stb AND TARGET stb) + add_library(stb::stb ALIAS stb) + endif() + return() +endif() + # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -67,7 +81,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(stb +find_package_handle_standard_args(stb REQUIRED_VARS stb_INCLUDE_DIR ) @@ -83,4 +97,4 @@ if(stb_FOUND) endif() endif() -mark_as_advanced(stb_INCLUDE_DIR) \ No newline at end of file +mark_as_advanced(stb_INCLUDE_DIR) diff --git a/attachments/CMake/Findtinygltf.cmake b/attachments/CMake/Findtinygltf.cmake index 1228e3c0..7f650631 100644 --- a/attachments/CMake/Findtinygltf.cmake +++ b/attachments/CMake/Findtinygltf.cmake @@ -13,7 +13,11 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(tinygltf CONFIG QUIET) +if(COMMAND _find_package) + _find_package(tinygltf CONFIG QUIET) +else() + find_package(tinygltf CONFIG QUIET) +endif() if(tinygltf_FOUND) if(NOT TARGET tinygltf::tinygltf AND TARGET tinygltf) @@ -23,7 +27,11 @@ if(tinygltf_FOUND) endif() # First, try to find nlohmann_json -find_package(nlohmann_json QUIET) +if(COMMAND _find_package) + _find_package(nlohmann_json QUIET) +else() + find_package(nlohmann_json QUIET) +endif() if(NOT nlohmann_json_FOUND) include(FetchContent) message(STATUS "nlohmann_json not found, fetching v3.12.0 from GitHub...") diff --git a/attachments/CMake/Findtinyobjloader.cmake b/attachments/CMake/Findtinyobjloader.cmake index 4fff4a4a..08fca70b 100644 --- a/attachments/CMake/Findtinyobjloader.cmake +++ b/attachments/CMake/Findtinyobjloader.cmake @@ -10,7 +10,11 @@ # tinyobjloader::tinyobjloader # Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(tinyobjloader CONFIG QUIET) +if(COMMAND _find_package) + _find_package(tinyobjloader CONFIG QUIET) +else() + find_package(tinyobjloader CONFIG QUIET) +endif() if(tinyobjloader_FOUND) if(NOT TARGET tinyobjloader::tinyobjloader AND TARGET tinyobjloader) diff --git a/attachments/CMakeLists.txt b/attachments/CMakeLists.txt index bc048f45..7099f877 100644 --- a/attachments/CMakeLists.txt +++ b/attachments/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required (VERSION 3.29) +list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake") + # vcpkg integration if(WIN32) # By default, we disable manifest mode to ensure compatibility with all vcpkg installations, @@ -11,8 +13,6 @@ endif() project (VulkanTutorial) -list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") - # Add option to enable/disable C++ 20 module option(ENABLE_CPP20_MODULE "Enable C++ 20 module support for Vulkan" OFF) diff --git a/attachments/simple_engine/CMake/FindKTX.cmake b/attachments/simple_engine/CMake/FindKTX.cmake index d054af10..92f1c6b6 100644 --- a/attachments/simple_engine/CMake/FindKTX.cmake +++ b/attachments/simple_engine/CMake/FindKTX.cmake @@ -14,7 +14,11 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(ktx CONFIG QUIET) +if(COMMAND _find_package) + _find_package(ktx CONFIG QUIET) +else() + find_package(ktx CONFIG QUIET) +endif() if(ktx_FOUND) if(NOT TARGET KTX::ktx AND TARGET ktx::ktx) diff --git a/attachments/simple_engine/CMake/Findglm.cmake b/attachments/simple_engine/CMake/Findglm.cmake index 65d13f70..d2021336 100644 --- a/attachments/simple_engine/CMake/Findglm.cmake +++ b/attachments/simple_engine/CMake/Findglm.cmake @@ -13,7 +13,11 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(glm CONFIG QUIET) +if(COMMAND _find_package) + _find_package(glm CONFIG QUIET) +else() + find_package(glm CONFIG QUIET) +endif() if(glm_FOUND) if(NOT TARGET glm::glm AND TARGET glm) diff --git a/attachments/simple_engine/CMake/Findnlohmann_json.cmake b/attachments/simple_engine/CMake/Findnlohmann_json.cmake index bbc583a7..670c8706 100644 --- a/attachments/simple_engine/CMake/Findnlohmann_json.cmake +++ b/attachments/simple_engine/CMake/Findnlohmann_json.cmake @@ -13,7 +13,11 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(nlohmann_json CONFIG QUIET) +if(COMMAND _find_package) + _find_package(nlohmann_json CONFIG QUIET) +else() + find_package(nlohmann_json CONFIG QUIET) +endif() if(nlohmann_json_FOUND) if(NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json) diff --git a/attachments/simple_engine/CMake/Findstb.cmake b/attachments/simple_engine/CMake/Findstb.cmake index 6ccf72f5..766985d6 100644 --- a/attachments/simple_engine/CMake/Findstb.cmake +++ b/attachments/simple_engine/CMake/Findstb.cmake @@ -12,6 +12,20 @@ # stb::stb # +# Try to find the package using CONFIG mode first (e.g., from vcpkg) +if(COMMAND _find_package) + _find_package(stb CONFIG QUIET) +else() + find_package(stb CONFIG QUIET) +endif() + +if(stb_FOUND) + if(NOT TARGET stb::stb AND TARGET stb) + add_library(stb::stb ALIAS stb) + endif() + return() +endif() + # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -67,7 +81,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(stb +find_package_handle_standard_args(stb REQUIRED_VARS stb_INCLUDE_DIR ) @@ -83,4 +97,4 @@ if(stb_FOUND) endif() endif() -mark_as_advanced(stb_INCLUDE_DIR) \ No newline at end of file +mark_as_advanced(stb_INCLUDE_DIR) diff --git a/attachments/simple_engine/CMake/Findtinygltf.cmake b/attachments/simple_engine/CMake/Findtinygltf.cmake index 1228e3c0..7f650631 100644 --- a/attachments/simple_engine/CMake/Findtinygltf.cmake +++ b/attachments/simple_engine/CMake/Findtinygltf.cmake @@ -13,7 +13,11 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(tinygltf CONFIG QUIET) +if(COMMAND _find_package) + _find_package(tinygltf CONFIG QUIET) +else() + find_package(tinygltf CONFIG QUIET) +endif() if(tinygltf_FOUND) if(NOT TARGET tinygltf::tinygltf AND TARGET tinygltf) @@ -23,7 +27,11 @@ if(tinygltf_FOUND) endif() # First, try to find nlohmann_json -find_package(nlohmann_json QUIET) +if(COMMAND _find_package) + _find_package(nlohmann_json QUIET) +else() + find_package(nlohmann_json QUIET) +endif() if(NOT nlohmann_json_FOUND) include(FetchContent) message(STATUS "nlohmann_json not found, fetching v3.12.0 from GitHub...") diff --git a/attachments/simple_engine/CMake/Findtinyobjloader.cmake b/attachments/simple_engine/CMake/Findtinyobjloader.cmake index 4fff4a4a..08fca70b 100644 --- a/attachments/simple_engine/CMake/Findtinyobjloader.cmake +++ b/attachments/simple_engine/CMake/Findtinyobjloader.cmake @@ -10,7 +10,11 @@ # tinyobjloader::tinyobjloader # Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(tinyobjloader CONFIG QUIET) +if(COMMAND _find_package) + _find_package(tinyobjloader CONFIG QUIET) +else() + find_package(tinyobjloader CONFIG QUIET) +endif() if(tinyobjloader_FOUND) if(NOT TARGET tinyobjloader::tinyobjloader AND TARGET tinyobjloader) diff --git a/attachments/simple_engine/CMakeLists.txt b/attachments/simple_engine/CMakeLists.txt index 9d6e11bd..e46d8067 100644 --- a/attachments/simple_engine/CMakeLists.txt +++ b/attachments/simple_engine/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.29) +list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake") + # vcpkg integration if(WIN32) # By default, we disable manifest mode to ensure compatibility with all vcpkg installations, @@ -19,9 +21,6 @@ if(ENABLE_CPP20_MODULE) set(CMAKE_CXX_SCAN_FOR_MODULES ON) endif() -# Add CMake module path for custom find modules -list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") - # Find required packages find_package (glm REQUIRED) find_package (Vulkan REQUIRED) diff --git a/vcpkg.json b/vcpkg.json index 50d26741..8a97d7b5 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,13 +2,17 @@ "name": "vulkan-tutorial", "version": "1.0.0", "dependencies": [ - "glfw3", - "glm", - "tinyobjloader", - "stb", - "tinygltf", - "nlohmann-json", - "openal-soft", - "ktx" + { "name": "glfw3", "platform": "windows" }, + { "name": "glm", "platform": "windows" }, + { "name": "tinyobjloader", "platform": "windows" }, + { "name": "stb", "platform": "windows" }, + { "name": "tinygltf", "platform": "windows" }, + { "name": "nlohmann-json", "platform": "windows" }, + { "name": "openal-soft", "platform": "windows" }, + { + "name": "ktx", + "platform": "windows", + "features": [ "vulkan" ] + } ] } From b5ce380a5654a41309ccaf6d2591ef87386f54f3 Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 16:33:46 -0800 Subject: [PATCH 07/15] Explicitly specify MODULE mode for all find_package calls to prioritize custom Find modules Add MODULE keyword to all find_package calls in CMakeLists.txt files to ensure custom Find modules are used instead of relying on default search order. This complements the CMAKE_MODULE_PATH PREPEND change and ensures consistent package discovery across different CMake versions. --- attachments/CMakeLists.txt | 14 +++++++------- attachments/simple_engine/CMakeLists.txt | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/attachments/CMakeLists.txt b/attachments/CMakeLists.txt index 7099f877..2defda01 100644 --- a/attachments/CMakeLists.txt +++ b/attachments/CMakeLists.txt @@ -21,12 +21,12 @@ if(ENABLE_CPP20_MODULE) set(CMAKE_CXX_SCAN_FOR_MODULES ON) endif() -find_package (glfw3 REQUIRED) -find_package (glm REQUIRED) -find_package (Vulkan 1.4.335 REQUIRED) # Require Vulkan SDK version 1.4.335 or higher -find_package (tinyobjloader REQUIRED) -find_package (tinygltf REQUIRED) -find_package (KTX REQUIRED) +find_package (glfw3 REQUIRED MODULE) +find_package (glm REQUIRED MODULE) +find_package (Vulkan 1.4.335 REQUIRED MODULE) # Require Vulkan SDK version 1.4.335 or higher +find_package (tinyobjloader REQUIRED MODULE) +find_package (tinygltf REQUIRED MODULE) +find_package (KTX REQUIRED MODULE) # set up Vulkan C++ module only if enabled if(ENABLE_CPP20_MODULE) @@ -84,7 +84,7 @@ else() ) endif() -find_package(stb REQUIRED) +find_package(stb REQUIRED MODULE) set(STB_INCLUDEDIR ${stb_INCLUDE_DIRS}) add_executable (glslang::validator IMPORTED) diff --git a/attachments/simple_engine/CMakeLists.txt b/attachments/simple_engine/CMakeLists.txt index e46d8067..592982c6 100644 --- a/attachments/simple_engine/CMakeLists.txt +++ b/attachments/simple_engine/CMakeLists.txt @@ -22,13 +22,13 @@ if(ENABLE_CPP20_MODULE) endif() # Find required packages -find_package (glm REQUIRED) -find_package (Vulkan REQUIRED) -find_package (tinygltf REQUIRED) -find_package (KTX REQUIRED) +find_package (glm REQUIRED MODULE) +find_package (Vulkan REQUIRED MODULE) +find_package (tinygltf REQUIRED MODULE) +find_package (KTX REQUIRED MODULE) # Find or download Vulkan-Hpp headers matching the Vulkan SDK/NDK version -find_package(VulkanHpp REQUIRED) +find_package(VulkanHpp REQUIRED MODULE) if(ENABLE_CPP20_MODULE) # Set up Vulkan C++ module for this standalone project @@ -89,8 +89,8 @@ if(ANDROID) else() # Desktop-specific settings add_definitions(-DPLATFORM_DESKTOP) - find_package(glfw3 REQUIRED) - find_package(OpenAL REQUIRED) + find_package(glfw3 REQUIRED MODULE) + find_package(OpenAL REQUIRED MODULE) endif() # Shader compilation From 5112502b64a237632263ff9b72efb6b9e27f4e79 Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 16:55:56 -0800 Subject: [PATCH 08/15] Revert "Explicitly specify MODULE mode for all find_package calls to prioritize custom Find modules" This reverts commit b5ce380a5654a41309ccaf6d2591ef87386f54f3. --- attachments/CMakeLists.txt | 14 +++++++------- attachments/simple_engine/CMakeLists.txt | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/attachments/CMakeLists.txt b/attachments/CMakeLists.txt index 2defda01..7099f877 100644 --- a/attachments/CMakeLists.txt +++ b/attachments/CMakeLists.txt @@ -21,12 +21,12 @@ if(ENABLE_CPP20_MODULE) set(CMAKE_CXX_SCAN_FOR_MODULES ON) endif() -find_package (glfw3 REQUIRED MODULE) -find_package (glm REQUIRED MODULE) -find_package (Vulkan 1.4.335 REQUIRED MODULE) # Require Vulkan SDK version 1.4.335 or higher -find_package (tinyobjloader REQUIRED MODULE) -find_package (tinygltf REQUIRED MODULE) -find_package (KTX REQUIRED MODULE) +find_package (glfw3 REQUIRED) +find_package (glm REQUIRED) +find_package (Vulkan 1.4.335 REQUIRED) # Require Vulkan SDK version 1.4.335 or higher +find_package (tinyobjloader REQUIRED) +find_package (tinygltf REQUIRED) +find_package (KTX REQUIRED) # set up Vulkan C++ module only if enabled if(ENABLE_CPP20_MODULE) @@ -84,7 +84,7 @@ else() ) endif() -find_package(stb REQUIRED MODULE) +find_package(stb REQUIRED) set(STB_INCLUDEDIR ${stb_INCLUDE_DIRS}) add_executable (glslang::validator IMPORTED) diff --git a/attachments/simple_engine/CMakeLists.txt b/attachments/simple_engine/CMakeLists.txt index 592982c6..e46d8067 100644 --- a/attachments/simple_engine/CMakeLists.txt +++ b/attachments/simple_engine/CMakeLists.txt @@ -22,13 +22,13 @@ if(ENABLE_CPP20_MODULE) endif() # Find required packages -find_package (glm REQUIRED MODULE) -find_package (Vulkan REQUIRED MODULE) -find_package (tinygltf REQUIRED MODULE) -find_package (KTX REQUIRED MODULE) +find_package (glm REQUIRED) +find_package (Vulkan REQUIRED) +find_package (tinygltf REQUIRED) +find_package (KTX REQUIRED) # Find or download Vulkan-Hpp headers matching the Vulkan SDK/NDK version -find_package(VulkanHpp REQUIRED MODULE) +find_package(VulkanHpp REQUIRED) if(ENABLE_CPP20_MODULE) # Set up Vulkan C++ module for this standalone project @@ -89,8 +89,8 @@ if(ANDROID) else() # Desktop-specific settings add_definitions(-DPLATFORM_DESKTOP) - find_package(glfw3 REQUIRED MODULE) - find_package(OpenAL REQUIRED MODULE) + find_package(glfw3 REQUIRED) + find_package(OpenAL REQUIRED) endif() # Shader compilation From bf882ab9450aa2726ce20a99101a66a92683133e Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 16:55:56 -0800 Subject: [PATCH 09/15] Revert "Restrict vcpkg dependencies to Windows platform and improve CMake module path handling" This reverts commit 67a28b91a90f8c110596399f4eedf9405508cfe7. --- attachments/CMake/FindKTX.cmake | 6 +----- attachments/CMake/Findglm.cmake | 6 +----- attachments/CMake/Findnlohmann_json.cmake | 6 +----- attachments/CMake/Findstb.cmake | 18 ++--------------- attachments/CMake/Findtinygltf.cmake | 12 ++--------- attachments/CMake/Findtinyobjloader.cmake | 6 +----- attachments/CMakeLists.txt | 4 ++-- attachments/simple_engine/CMake/FindKTX.cmake | 6 +----- attachments/simple_engine/CMake/Findglm.cmake | 6 +----- .../CMake/Findnlohmann_json.cmake | 6 +----- attachments/simple_engine/CMake/Findstb.cmake | 18 ++--------------- .../simple_engine/CMake/Findtinygltf.cmake | 12 ++--------- .../CMake/Findtinyobjloader.cmake | 6 +----- attachments/simple_engine/CMakeLists.txt | 5 +++-- vcpkg.json | 20 ++++++++----------- 15 files changed, 29 insertions(+), 108 deletions(-) diff --git a/attachments/CMake/FindKTX.cmake b/attachments/CMake/FindKTX.cmake index 92f1c6b6..d054af10 100644 --- a/attachments/CMake/FindKTX.cmake +++ b/attachments/CMake/FindKTX.cmake @@ -14,11 +14,7 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(ktx CONFIG QUIET) -else() - find_package(ktx CONFIG QUIET) -endif() +find_package(ktx CONFIG QUIET) if(ktx_FOUND) if(NOT TARGET KTX::ktx AND TARGET ktx::ktx) diff --git a/attachments/CMake/Findglm.cmake b/attachments/CMake/Findglm.cmake index d2021336..65d13f70 100644 --- a/attachments/CMake/Findglm.cmake +++ b/attachments/CMake/Findglm.cmake @@ -13,11 +13,7 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(glm CONFIG QUIET) -else() - find_package(glm CONFIG QUIET) -endif() +find_package(glm CONFIG QUIET) if(glm_FOUND) if(NOT TARGET glm::glm AND TARGET glm) diff --git a/attachments/CMake/Findnlohmann_json.cmake b/attachments/CMake/Findnlohmann_json.cmake index 670c8706..bbc583a7 100644 --- a/attachments/CMake/Findnlohmann_json.cmake +++ b/attachments/CMake/Findnlohmann_json.cmake @@ -13,11 +13,7 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(nlohmann_json CONFIG QUIET) -else() - find_package(nlohmann_json CONFIG QUIET) -endif() +find_package(nlohmann_json CONFIG QUIET) if(nlohmann_json_FOUND) if(NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json) diff --git a/attachments/CMake/Findstb.cmake b/attachments/CMake/Findstb.cmake index 766985d6..6ccf72f5 100644 --- a/attachments/CMake/Findstb.cmake +++ b/attachments/CMake/Findstb.cmake @@ -12,20 +12,6 @@ # stb::stb # -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(stb CONFIG QUIET) -else() - find_package(stb CONFIG QUIET) -endif() - -if(stb_FOUND) - if(NOT TARGET stb::stb AND TARGET stb) - add_library(stb::stb ALIAS stb) - endif() - return() -endif() - # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -81,7 +67,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(stb +find_package_handle_standard_args(stb REQUIRED_VARS stb_INCLUDE_DIR ) @@ -97,4 +83,4 @@ if(stb_FOUND) endif() endif() -mark_as_advanced(stb_INCLUDE_DIR) +mark_as_advanced(stb_INCLUDE_DIR) \ No newline at end of file diff --git a/attachments/CMake/Findtinygltf.cmake b/attachments/CMake/Findtinygltf.cmake index 7f650631..1228e3c0 100644 --- a/attachments/CMake/Findtinygltf.cmake +++ b/attachments/CMake/Findtinygltf.cmake @@ -13,11 +13,7 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(tinygltf CONFIG QUIET) -else() - find_package(tinygltf CONFIG QUIET) -endif() +find_package(tinygltf CONFIG QUIET) if(tinygltf_FOUND) if(NOT TARGET tinygltf::tinygltf AND TARGET tinygltf) @@ -27,11 +23,7 @@ if(tinygltf_FOUND) endif() # First, try to find nlohmann_json -if(COMMAND _find_package) - _find_package(nlohmann_json QUIET) -else() - find_package(nlohmann_json QUIET) -endif() +find_package(nlohmann_json QUIET) if(NOT nlohmann_json_FOUND) include(FetchContent) message(STATUS "nlohmann_json not found, fetching v3.12.0 from GitHub...") diff --git a/attachments/CMake/Findtinyobjloader.cmake b/attachments/CMake/Findtinyobjloader.cmake index 08fca70b..4fff4a4a 100644 --- a/attachments/CMake/Findtinyobjloader.cmake +++ b/attachments/CMake/Findtinyobjloader.cmake @@ -10,11 +10,7 @@ # tinyobjloader::tinyobjloader # Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(tinyobjloader CONFIG QUIET) -else() - find_package(tinyobjloader CONFIG QUIET) -endif() +find_package(tinyobjloader CONFIG QUIET) if(tinyobjloader_FOUND) if(NOT TARGET tinyobjloader::tinyobjloader AND TARGET tinyobjloader) diff --git a/attachments/CMakeLists.txt b/attachments/CMakeLists.txt index 7099f877..bc048f45 100644 --- a/attachments/CMakeLists.txt +++ b/attachments/CMakeLists.txt @@ -1,7 +1,5 @@ cmake_minimum_required (VERSION 3.29) -list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake") - # vcpkg integration if(WIN32) # By default, we disable manifest mode to ensure compatibility with all vcpkg installations, @@ -13,6 +11,8 @@ endif() project (VulkanTutorial) +list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") + # Add option to enable/disable C++ 20 module option(ENABLE_CPP20_MODULE "Enable C++ 20 module support for Vulkan" OFF) diff --git a/attachments/simple_engine/CMake/FindKTX.cmake b/attachments/simple_engine/CMake/FindKTX.cmake index 92f1c6b6..d054af10 100644 --- a/attachments/simple_engine/CMake/FindKTX.cmake +++ b/attachments/simple_engine/CMake/FindKTX.cmake @@ -14,11 +14,7 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(ktx CONFIG QUIET) -else() - find_package(ktx CONFIG QUIET) -endif() +find_package(ktx CONFIG QUIET) if(ktx_FOUND) if(NOT TARGET KTX::ktx AND TARGET ktx::ktx) diff --git a/attachments/simple_engine/CMake/Findglm.cmake b/attachments/simple_engine/CMake/Findglm.cmake index d2021336..65d13f70 100644 --- a/attachments/simple_engine/CMake/Findglm.cmake +++ b/attachments/simple_engine/CMake/Findglm.cmake @@ -13,11 +13,7 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(glm CONFIG QUIET) -else() - find_package(glm CONFIG QUIET) -endif() +find_package(glm CONFIG QUIET) if(glm_FOUND) if(NOT TARGET glm::glm AND TARGET glm) diff --git a/attachments/simple_engine/CMake/Findnlohmann_json.cmake b/attachments/simple_engine/CMake/Findnlohmann_json.cmake index 670c8706..bbc583a7 100644 --- a/attachments/simple_engine/CMake/Findnlohmann_json.cmake +++ b/attachments/simple_engine/CMake/Findnlohmann_json.cmake @@ -13,11 +13,7 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(nlohmann_json CONFIG QUIET) -else() - find_package(nlohmann_json CONFIG QUIET) -endif() +find_package(nlohmann_json CONFIG QUIET) if(nlohmann_json_FOUND) if(NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json) diff --git a/attachments/simple_engine/CMake/Findstb.cmake b/attachments/simple_engine/CMake/Findstb.cmake index 766985d6..6ccf72f5 100644 --- a/attachments/simple_engine/CMake/Findstb.cmake +++ b/attachments/simple_engine/CMake/Findstb.cmake @@ -12,20 +12,6 @@ # stb::stb # -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(stb CONFIG QUIET) -else() - find_package(stb CONFIG QUIET) -endif() - -if(stb_FOUND) - if(NOT TARGET stb::stb AND TARGET stb) - add_library(stb::stb ALIAS stb) - endif() - return() -endif() - # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -81,7 +67,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(stb +find_package_handle_standard_args(stb REQUIRED_VARS stb_INCLUDE_DIR ) @@ -97,4 +83,4 @@ if(stb_FOUND) endif() endif() -mark_as_advanced(stb_INCLUDE_DIR) +mark_as_advanced(stb_INCLUDE_DIR) \ No newline at end of file diff --git a/attachments/simple_engine/CMake/Findtinygltf.cmake b/attachments/simple_engine/CMake/Findtinygltf.cmake index 7f650631..1228e3c0 100644 --- a/attachments/simple_engine/CMake/Findtinygltf.cmake +++ b/attachments/simple_engine/CMake/Findtinygltf.cmake @@ -13,11 +13,7 @@ # # Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(tinygltf CONFIG QUIET) -else() - find_package(tinygltf CONFIG QUIET) -endif() +find_package(tinygltf CONFIG QUIET) if(tinygltf_FOUND) if(NOT TARGET tinygltf::tinygltf AND TARGET tinygltf) @@ -27,11 +23,7 @@ if(tinygltf_FOUND) endif() # First, try to find nlohmann_json -if(COMMAND _find_package) - _find_package(nlohmann_json QUIET) -else() - find_package(nlohmann_json QUIET) -endif() +find_package(nlohmann_json QUIET) if(NOT nlohmann_json_FOUND) include(FetchContent) message(STATUS "nlohmann_json not found, fetching v3.12.0 from GitHub...") diff --git a/attachments/simple_engine/CMake/Findtinyobjloader.cmake b/attachments/simple_engine/CMake/Findtinyobjloader.cmake index 08fca70b..4fff4a4a 100644 --- a/attachments/simple_engine/CMake/Findtinyobjloader.cmake +++ b/attachments/simple_engine/CMake/Findtinyobjloader.cmake @@ -10,11 +10,7 @@ # tinyobjloader::tinyobjloader # Try to find the package using CONFIG mode first (e.g., from vcpkg) -if(COMMAND _find_package) - _find_package(tinyobjloader CONFIG QUIET) -else() - find_package(tinyobjloader CONFIG QUIET) -endif() +find_package(tinyobjloader CONFIG QUIET) if(tinyobjloader_FOUND) if(NOT TARGET tinyobjloader::tinyobjloader AND TARGET tinyobjloader) diff --git a/attachments/simple_engine/CMakeLists.txt b/attachments/simple_engine/CMakeLists.txt index e46d8067..9d6e11bd 100644 --- a/attachments/simple_engine/CMakeLists.txt +++ b/attachments/simple_engine/CMakeLists.txt @@ -1,7 +1,5 @@ cmake_minimum_required(VERSION 3.29) -list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake") - # vcpkg integration if(WIN32) # By default, we disable manifest mode to ensure compatibility with all vcpkg installations, @@ -21,6 +19,9 @@ if(ENABLE_CPP20_MODULE) set(CMAKE_CXX_SCAN_FOR_MODULES ON) endif() +# Add CMake module path for custom find modules +list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") + # Find required packages find_package (glm REQUIRED) find_package (Vulkan REQUIRED) diff --git a/vcpkg.json b/vcpkg.json index 8a97d7b5..50d26741 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,17 +2,13 @@ "name": "vulkan-tutorial", "version": "1.0.0", "dependencies": [ - { "name": "glfw3", "platform": "windows" }, - { "name": "glm", "platform": "windows" }, - { "name": "tinyobjloader", "platform": "windows" }, - { "name": "stb", "platform": "windows" }, - { "name": "tinygltf", "platform": "windows" }, - { "name": "nlohmann-json", "platform": "windows" }, - { "name": "openal-soft", "platform": "windows" }, - { - "name": "ktx", - "platform": "windows", - "features": [ "vulkan" ] - } + "glfw3", + "glm", + "tinyobjloader", + "stb", + "tinygltf", + "nlohmann-json", + "openal-soft", + "ktx" ] } From 06757f3ff5c3292674e15fc927b5ef957904bc9a Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 16:55:56 -0800 Subject: [PATCH 10/15] Revert "Add vcpkg CONFIG mode support to Find modules and prioritize custom CMake module path" This reverts commit de6f1ad60999e961cbf63d6418211bb0397da878. --- attachments/CMake/FindKTX.cmake | 11 ----------- attachments/CMake/Findglm.cmake | 12 +----------- attachments/CMake/Findnlohmann_json.cmake | 10 ---------- attachments/CMake/Findtinygltf.cmake | 10 ---------- attachments/CMake/Findtinyobjloader.cmake | 12 +----------- attachments/CMakeLists.txt | 2 +- attachments/simple_engine/CMake/FindKTX.cmake | 13 +------------ attachments/simple_engine/CMake/Findglm.cmake | 12 +----------- .../simple_engine/CMake/Findnlohmann_json.cmake | 10 ---------- attachments/simple_engine/CMake/Findtinygltf.cmake | 10 ---------- .../simple_engine/CMake/Findtinyobjloader.cmake | 12 +----------- attachments/simple_engine/CMakeLists.txt | 2 +- 12 files changed, 7 insertions(+), 109 deletions(-) diff --git a/attachments/CMake/FindKTX.cmake b/attachments/CMake/FindKTX.cmake index d054af10..2d466762 100644 --- a/attachments/CMake/FindKTX.cmake +++ b/attachments/CMake/FindKTX.cmake @@ -13,17 +13,6 @@ # KTX::ktx # -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(ktx CONFIG QUIET) - -if(ktx_FOUND) - if(NOT TARGET KTX::ktx AND TARGET ktx::ktx) - add_library(KTX::ktx ALIAS ktx::ktx) - endif() - set(KTX_FOUND TRUE) - return() -endif() - # Check if we're on Linux - if so, we'll skip the search and directly use FetchContent if(UNIX AND NOT APPLE) # On Linux, we assume KTX is not installed and proceed directly to fetching it diff --git a/attachments/CMake/Findglm.cmake b/attachments/CMake/Findglm.cmake index 65d13f70..fdf113cf 100644 --- a/attachments/CMake/Findglm.cmake +++ b/attachments/CMake/Findglm.cmake @@ -12,16 +12,6 @@ # glm::glm # -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(glm CONFIG QUIET) - -if(glm_FOUND) - if(NOT TARGET glm::glm AND TARGET glm) - add_library(glm::glm ALIAS glm) - endif() - return() -endif() - # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -104,7 +94,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(glm +find_package_handle_standard_args(glm REQUIRED_VARS glm_INCLUDE_DIR ) diff --git a/attachments/CMake/Findnlohmann_json.cmake b/attachments/CMake/Findnlohmann_json.cmake index bbc583a7..61dc66a6 100644 --- a/attachments/CMake/Findnlohmann_json.cmake +++ b/attachments/CMake/Findnlohmann_json.cmake @@ -12,16 +12,6 @@ # nlohmann_json::nlohmann_json # -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(nlohmann_json CONFIG QUIET) - -if(nlohmann_json_FOUND) - if(NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json) - add_library(nlohmann_json::nlohmann_json ALIAS nlohmann_json) - endif() - return() -endif() - # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) diff --git a/attachments/CMake/Findtinygltf.cmake b/attachments/CMake/Findtinygltf.cmake index 1228e3c0..b2412350 100644 --- a/attachments/CMake/Findtinygltf.cmake +++ b/attachments/CMake/Findtinygltf.cmake @@ -12,16 +12,6 @@ # tinygltf::tinygltf # -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(tinygltf CONFIG QUIET) - -if(tinygltf_FOUND) - if(NOT TARGET tinygltf::tinygltf AND TARGET tinygltf) - add_library(tinygltf::tinygltf ALIAS tinygltf) - endif() - return() -endif() - # First, try to find nlohmann_json find_package(nlohmann_json QUIET) if(NOT nlohmann_json_FOUND) diff --git a/attachments/CMake/Findtinyobjloader.cmake b/attachments/CMake/Findtinyobjloader.cmake index 4fff4a4a..4b1fb44c 100644 --- a/attachments/CMake/Findtinyobjloader.cmake +++ b/attachments/CMake/Findtinyobjloader.cmake @@ -9,16 +9,6 @@ # It also defines the following targets: # tinyobjloader::tinyobjloader -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(tinyobjloader CONFIG QUIET) - -if(tinyobjloader_FOUND) - if(NOT TARGET tinyobjloader::tinyobjloader AND TARGET tinyobjloader) - add_library(tinyobjloader::tinyobjloader ALIAS tinyobjloader) - endif() - return() -endif() - # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -119,7 +109,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(tinyobjloader +find_package_handle_standard_args(tinyobjloader REQUIRED_VARS tinyobjloader_INCLUDE_DIR ) diff --git a/attachments/CMakeLists.txt b/attachments/CMakeLists.txt index bc048f45..dbc80be2 100644 --- a/attachments/CMakeLists.txt +++ b/attachments/CMakeLists.txt @@ -11,7 +11,7 @@ endif() project (VulkanTutorial) -list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") # Add option to enable/disable C++ 20 module option(ENABLE_CPP20_MODULE "Enable C++ 20 module support for Vulkan" OFF) diff --git a/attachments/simple_engine/CMake/FindKTX.cmake b/attachments/simple_engine/CMake/FindKTX.cmake index d054af10..c3166302 100644 --- a/attachments/simple_engine/CMake/FindKTX.cmake +++ b/attachments/simple_engine/CMake/FindKTX.cmake @@ -13,17 +13,6 @@ # KTX::ktx # -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(ktx CONFIG QUIET) - -if(ktx_FOUND) - if(NOT TARGET KTX::ktx AND TARGET ktx::ktx) - add_library(KTX::ktx ALIAS ktx::ktx) - endif() - set(KTX_FOUND TRUE) - return() -endif() - # Check if we're on Linux - if so, we'll skip the search and directly use FetchContent if(UNIX AND NOT APPLE) # On Linux, we assume KTX is not installed and proceed directly to fetching it @@ -81,7 +70,7 @@ if(NOT KTX_FOUND) FetchContent_Declare( ktx GIT_REPOSITORY https://github.com/KhronosGroup/KTX-Software.git - GIT_TAG v4.3.1 # Use a specific tag for stability + GIT_TAG v4.4.2 # Use a specific tag for stability ) # Set options to minimize build time and dependencies diff --git a/attachments/simple_engine/CMake/Findglm.cmake b/attachments/simple_engine/CMake/Findglm.cmake index 65d13f70..fdf113cf 100644 --- a/attachments/simple_engine/CMake/Findglm.cmake +++ b/attachments/simple_engine/CMake/Findglm.cmake @@ -12,16 +12,6 @@ # glm::glm # -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(glm CONFIG QUIET) - -if(glm_FOUND) - if(NOT TARGET glm::glm AND TARGET glm) - add_library(glm::glm ALIAS glm) - endif() - return() -endif() - # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -104,7 +94,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(glm +find_package_handle_standard_args(glm REQUIRED_VARS glm_INCLUDE_DIR ) diff --git a/attachments/simple_engine/CMake/Findnlohmann_json.cmake b/attachments/simple_engine/CMake/Findnlohmann_json.cmake index bbc583a7..61dc66a6 100644 --- a/attachments/simple_engine/CMake/Findnlohmann_json.cmake +++ b/attachments/simple_engine/CMake/Findnlohmann_json.cmake @@ -12,16 +12,6 @@ # nlohmann_json::nlohmann_json # -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(nlohmann_json CONFIG QUIET) - -if(nlohmann_json_FOUND) - if(NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json) - add_library(nlohmann_json::nlohmann_json ALIAS nlohmann_json) - endif() - return() -endif() - # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) diff --git a/attachments/simple_engine/CMake/Findtinygltf.cmake b/attachments/simple_engine/CMake/Findtinygltf.cmake index 1228e3c0..b2412350 100644 --- a/attachments/simple_engine/CMake/Findtinygltf.cmake +++ b/attachments/simple_engine/CMake/Findtinygltf.cmake @@ -12,16 +12,6 @@ # tinygltf::tinygltf # -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(tinygltf CONFIG QUIET) - -if(tinygltf_FOUND) - if(NOT TARGET tinygltf::tinygltf AND TARGET tinygltf) - add_library(tinygltf::tinygltf ALIAS tinygltf) - endif() - return() -endif() - # First, try to find nlohmann_json find_package(nlohmann_json QUIET) if(NOT nlohmann_json_FOUND) diff --git a/attachments/simple_engine/CMake/Findtinyobjloader.cmake b/attachments/simple_engine/CMake/Findtinyobjloader.cmake index 4fff4a4a..4b1fb44c 100644 --- a/attachments/simple_engine/CMake/Findtinyobjloader.cmake +++ b/attachments/simple_engine/CMake/Findtinyobjloader.cmake @@ -9,16 +9,6 @@ # It also defines the following targets: # tinyobjloader::tinyobjloader -# Try to find the package using CONFIG mode first (e.g., from vcpkg) -find_package(tinyobjloader CONFIG QUIET) - -if(tinyobjloader_FOUND) - if(NOT TARGET tinyobjloader::tinyobjloader AND TARGET tinyobjloader) - add_library(tinyobjloader::tinyobjloader ALIAS tinyobjloader) - endif() - return() -endif() - # Try to find the package using pkg-config first find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) @@ -119,7 +109,7 @@ endif() # Set the variables include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(tinyobjloader +find_package_handle_standard_args(tinyobjloader REQUIRED_VARS tinyobjloader_INCLUDE_DIR ) diff --git a/attachments/simple_engine/CMakeLists.txt b/attachments/simple_engine/CMakeLists.txt index 9d6e11bd..5550638d 100644 --- a/attachments/simple_engine/CMakeLists.txt +++ b/attachments/simple_engine/CMakeLists.txt @@ -20,7 +20,7 @@ if(ENABLE_CPP20_MODULE) endif() # Add CMake module path for custom find modules -list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") # Find required packages find_package (glm REQUIRED) From 701121fcd11206fa374e42f5b1d3818842bd91d5 Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 16:55:56 -0800 Subject: [PATCH 11/15] Revert "Add openal-soft dependency and fix vcpkg classic mode installation" This reverts commit b4074b05668aec174943a15692f6746fd56f7276. --- scripts/install_dependencies_windows.bat | 6 ++---- vcpkg.json | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/install_dependencies_windows.bat b/scripts/install_dependencies_windows.bat index c46a2ed6..986b0cf1 100644 --- a/scripts/install_dependencies_windows.bat +++ b/scripts/install_dependencies_windows.bat @@ -21,11 +21,9 @@ set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite :: Create cache directory if it doesn't exist if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache -:: Install all dependencies at once using vcpkg in classic mode by pointing to an empty manifest root +:: Install all dependencies at once using vcpkg in classic mode echo Installing all dependencies... -if not exist %TEMP%\vcpkg-classic-mode mkdir %TEMP%\vcpkg-classic-mode -vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows --x-manifest-root=%TEMP%\vcpkg-classic-mode -rmdir %TEMP%\vcpkg-classic-mode +vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows :: Remind about Vulkan SDK echo. diff --git a/vcpkg.json b/vcpkg.json index 50d26741..0a90e24d 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,7 +8,6 @@ "stb", "tinygltf", "nlohmann-json", - "openal-soft", "ktx" ] } From ca5c1c3784a5bd33bdb766478e211db9854e42f7 Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 16:55:56 -0800 Subject: [PATCH 12/15] Revert "Update vcpkg.json to restrict dependencies to Windows platform and fix classic mode installation" This reverts commit 46cc6828f0465544b41c7fe7bef137bbbfa0d3df. --- .../install_dependencies_windows.bat | 6 ++---- attachments/simple_engine/vcpkg.json | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/attachments/simple_engine/install_dependencies_windows.bat b/attachments/simple_engine/install_dependencies_windows.bat index f807c5f9..590fd419 100644 --- a/attachments/simple_engine/install_dependencies_windows.bat +++ b/attachments/simple_engine/install_dependencies_windows.bat @@ -24,11 +24,9 @@ set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite :: Create cache directory if it doesn't exist if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache -:: Install all dependencies at once using vcpkg in classic mode by pointing to an empty manifest root +:: Install all dependencies at once using vcpkg in classic mode echo Installing all dependencies... -if not exist %TEMP%\vcpkg-classic-mode mkdir %TEMP%\vcpkg-classic-mode -vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows --x-manifest-root=%TEMP%\vcpkg-classic-mode -rmdir %TEMP%\vcpkg-classic-mode +vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows :: Remind about Vulkan SDK echo. diff --git a/attachments/simple_engine/vcpkg.json b/attachments/simple_engine/vcpkg.json index f4dc3e27..0ec18a26 100644 --- a/attachments/simple_engine/vcpkg.json +++ b/attachments/simple_engine/vcpkg.json @@ -1,16 +1,18 @@ { - "name": "simple-engine", + "name": "vulkan-game-engine-tutorial", "version": "1.0.0", "dependencies": [ - { "name": "glfw3", "platform": "windows" }, - { "name": "glm", "platform": "windows" }, - { "name": "openal-soft", "platform": "windows" }, - { "name": "tinygltf", "platform": "windows" }, - { "name": "nlohmann-json", "platform": "windows" }, + { + "name": "glfw3", + "platform": "!android" + }, + "glm", + "openal-soft", { "name": "ktx", - "platform": "windows", "features": [ "vulkan" ] - } + }, + "tinygltf", + "nlohmann-json" ] } From 6e9f0f084fd7403be04ba2b3ec6867be7fac24de Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 16:55:56 -0800 Subject: [PATCH 13/15] Revert "Refactor FindKTX.cmake to fix FetchContent fallback and improve cross-platform compatibility" This reverts commit be6848ee96e9380d588403f79b2d13c26d9429ab. --- attachments/CMake/FindKTX.cmake | 54 +++++++++---------- attachments/simple_engine/CMake/FindKTX.cmake | 54 +++++++++---------- 2 files changed, 50 insertions(+), 58 deletions(-) diff --git a/attachments/CMake/FindKTX.cmake b/attachments/CMake/FindKTX.cmake index 2d466762..ac6971a2 100644 --- a/attachments/CMake/FindKTX.cmake +++ b/attachments/CMake/FindKTX.cmake @@ -24,7 +24,7 @@ else() pkg_check_modules(PC_KTX QUIET ktx libktx ktx2 libktx2) endif() - # Try to find KTX using standard find_path/find_library + # Try to find KTX using standard find_package find_path(KTX_INCLUDE_DIR NAMES ktx.h PATH_SUFFIXES include ktx KTX ktx2 KTX2 @@ -51,18 +51,35 @@ else() ${CMAKE_SOURCE_DIR}/external/ktx/lib ) - if(KTX_INCLUDE_DIR AND KTX_LIBRARY) - set(KTX_FOUND TRUE) - else() - set(KTX_FOUND FALSE) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(KTX + REQUIRED_VARS KTX_INCLUDE_DIR KTX_LIBRARY + FAIL_MESSAGE "" # Suppress the error message to allow our fallback + ) + + # Debug output if KTX is not found (only on non-Linux platforms) + if(NOT KTX_FOUND) + message(STATUS "KTX include directory search paths: ${PC_KTX_INCLUDEDIR}, /usr/include, /usr/local/include, $ENV{KTX_DIR}/include, $ENV{VULKAN_SDK}/include, ${CMAKE_SOURCE_DIR}/external/ktx/include") + message(STATUS "KTX library search paths: ${PC_KTX_LIBDIR}, /usr/lib, /usr/lib64, /usr/local/lib, /usr/local/lib64, $ENV{KTX_DIR}/lib, $ENV{VULKAN_SDK}/lib, ${CMAKE_SOURCE_DIR}/external/ktx/lib") endif() endif() -# If not found, use FetchContent to download and build -if(NOT KTX_FOUND) +if(KTX_FOUND) + set(KTX_INCLUDE_DIRS ${KTX_INCLUDE_DIR}) + set(KTX_LIBRARIES ${KTX_LIBRARY}) + + if(NOT TARGET KTX::ktx) + add_library(KTX::ktx UNKNOWN IMPORTED) + set_target_properties(KTX::ktx PROPERTIES + IMPORTED_LOCATION "${KTX_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${KTX_INCLUDE_DIRS}" + ) + endif() +else() + # If not found, use FetchContent to download and build include(FetchContent) - # Only show the message on non-Linux platforms (on Linux we expect to fetch) + # Only show the message on non-Linux platforms if(NOT (UNIX AND NOT APPLE)) message(STATUS "KTX not found, fetching from GitHub...") endif() @@ -87,24 +104,3 @@ if(NOT KTX_FOUND) set(KTX_FOUND TRUE) endif() - -# Finalize the variables and targets -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(KTX - REQUIRED_VARS KTX_FOUND -) - -if(KTX_FOUND) - if(KTX_INCLUDE_DIR AND KTX_LIBRARY) - set(KTX_INCLUDE_DIRS ${KTX_INCLUDE_DIR}) - set(KTX_LIBRARIES ${KTX_LIBRARY}) - - if(NOT TARGET KTX::ktx) - add_library(KTX::ktx UNKNOWN IMPORTED) - set_target_properties(KTX::ktx PROPERTIES - IMPORTED_LOCATION "${KTX_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${KTX_INCLUDE_DIRS}" - ) - endif() - endif() -endif() diff --git a/attachments/simple_engine/CMake/FindKTX.cmake b/attachments/simple_engine/CMake/FindKTX.cmake index c3166302..c8c1c22c 100644 --- a/attachments/simple_engine/CMake/FindKTX.cmake +++ b/attachments/simple_engine/CMake/FindKTX.cmake @@ -24,7 +24,7 @@ else() pkg_check_modules(PC_KTX QUIET ktx libktx ktx2 libktx2) endif() - # Try to find KTX using standard find_path/find_library + # Try to find KTX using standard find_package find_path(KTX_INCLUDE_DIR NAMES ktx.h PATH_SUFFIXES include ktx KTX ktx2 KTX2 @@ -51,18 +51,35 @@ else() ${CMAKE_SOURCE_DIR}/external/ktx/lib ) - if(KTX_INCLUDE_DIR AND KTX_LIBRARY) - set(KTX_FOUND TRUE) - else() - set(KTX_FOUND FALSE) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(KTX + REQUIRED_VARS KTX_INCLUDE_DIR KTX_LIBRARY + FAIL_MESSAGE "" # Suppress the error message to allow our fallback + ) + + # Debug output if KTX is not found (only on non-Linux platforms) + if(NOT KTX_FOUND) + message(STATUS "KTX include directory search paths: ${PC_KTX_INCLUDEDIR}, /usr/include, /usr/local/include, $ENV{KTX_DIR}/include, $ENV{VULKAN_SDK}/include, ${CMAKE_SOURCE_DIR}/external/ktx/include") + message(STATUS "KTX library search paths: ${PC_KTX_LIBDIR}, /usr/lib, /usr/lib64, /usr/local/lib, /usr/local/lib64, $ENV{KTX_DIR}/lib, $ENV{VULKAN_SDK}/lib, ${CMAKE_SOURCE_DIR}/external/ktx/lib") endif() endif() -# If not found, use FetchContent to download and build -if(NOT KTX_FOUND) +if(KTX_FOUND) + set(KTX_INCLUDE_DIRS ${KTX_INCLUDE_DIR}) + set(KTX_LIBRARIES ${KTX_LIBRARY}) + + if(NOT TARGET KTX::ktx) + add_library(KTX::ktx UNKNOWN IMPORTED) + set_target_properties(KTX::ktx PROPERTIES + IMPORTED_LOCATION "${KTX_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${KTX_INCLUDE_DIRS}" + ) + endif() +else() + # If not found, use FetchContent to download and build include(FetchContent) - # Only show the message on non-Linux platforms (on Linux we expect to fetch) + # Only show the message on non-Linux platforms if(NOT (UNIX AND NOT APPLE)) message(STATUS "KTX not found, fetching from GitHub...") endif() @@ -87,24 +104,3 @@ if(NOT KTX_FOUND) set(KTX_FOUND TRUE) endif() - -# Finalize the variables and targets -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(KTX - REQUIRED_VARS KTX_FOUND -) - -if(KTX_FOUND) - if(KTX_INCLUDE_DIR AND KTX_LIBRARY) - set(KTX_INCLUDE_DIRS ${KTX_INCLUDE_DIR}) - set(KTX_LIBRARIES ${KTX_LIBRARY}) - - if(NOT TARGET KTX::ktx) - add_library(KTX::ktx UNKNOWN IMPORTED) - set_target_properties(KTX::ktx PROPERTIES - IMPORTED_LOCATION "${KTX_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${KTX_INCLUDE_DIRS}" - ) - endif() - endif() -endif() From 4b91358523ebf5023257686541c5adf5e65d732c Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 16:55:56 -0800 Subject: [PATCH 14/15] Revert "Switch from vcpkg manifest mode to classic mode and disable manifest mode by default on Windows" This reverts commit df8f35e171f7ba64bfacbd2b8ad4a67257ce292a. --- attachments/CMakeLists.txt | 9 --------- attachments/simple_engine/CMakeLists.txt | 9 --------- .../simple_engine/install_dependencies_windows.bat | 4 ++-- scripts/install_dependencies_windows.bat | 6 +++--- scripts/vcpkg.json | 13 +++++++++++++ 5 files changed, 18 insertions(+), 23 deletions(-) create mode 100644 scripts/vcpkg.json diff --git a/attachments/CMakeLists.txt b/attachments/CMakeLists.txt index dbc80be2..5d2cb6cf 100644 --- a/attachments/CMakeLists.txt +++ b/attachments/CMakeLists.txt @@ -1,14 +1,5 @@ cmake_minimum_required (VERSION 3.29) -# vcpkg integration -if(WIN32) - # By default, we disable manifest mode to ensure compatibility with all vcpkg installations, - # including those from standalone packages and Visual Studio which may not have git or a baseline. - if(NOT DEFINED VCPKG_MANIFEST_MODE) - set(VCPKG_MANIFEST_MODE OFF CACHE BOOL "Use vcpkg manifest mode") - endif() -endif() - project (VulkanTutorial) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") diff --git a/attachments/simple_engine/CMakeLists.txt b/attachments/simple_engine/CMakeLists.txt index 5550638d..fd57faf7 100644 --- a/attachments/simple_engine/CMakeLists.txt +++ b/attachments/simple_engine/CMakeLists.txt @@ -1,14 +1,5 @@ cmake_minimum_required(VERSION 3.29) -# vcpkg integration -if(WIN32) - # By default, we disable manifest mode to ensure compatibility with all vcpkg installations, - # including those from standalone packages and Visual Studio which may not have git or a baseline. - if(NOT DEFINED VCPKG_MANIFEST_MODE) - set(VCPKG_MANIFEST_MODE OFF CACHE BOOL "Use vcpkg manifest mode") - endif() -endif() - project(SimpleEngine VERSION 1.0.0 LANGUAGES CXX C) # Option to enable/disable Vulkan C++20 module support for this standalone project diff --git a/attachments/simple_engine/install_dependencies_windows.bat b/attachments/simple_engine/install_dependencies_windows.bat index 590fd419..0fe383f4 100644 --- a/attachments/simple_engine/install_dependencies_windows.bat +++ b/attachments/simple_engine/install_dependencies_windows.bat @@ -24,9 +24,9 @@ set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite :: Create cache directory if it doesn't exist if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache -:: Install all dependencies at once using vcpkg in classic mode +:: Install all dependencies at once using vcpkg with parallel installation echo Installing all dependencies... -vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows +vcpkg install --triplet=x64-windows --x-manifest-root=%~dp0 --feature-flags=binarycaching,manifests --x-install-root=%VCPKG_INSTALLATION_ROOT%/installed :: Remind about Vulkan SDK echo. diff --git a/scripts/install_dependencies_windows.bat b/scripts/install_dependencies_windows.bat index 986b0cf1..bd8ff37c 100644 --- a/scripts/install_dependencies_windows.bat +++ b/scripts/install_dependencies_windows.bat @@ -21,9 +21,9 @@ set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite :: Create cache directory if it doesn't exist if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache -:: Install all dependencies at once using vcpkg in classic mode +:: Install all dependencies at once using vcpkg with parallel installation echo Installing all dependencies... -vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows +vcpkg install --triplet=x64-windows --x-manifest-root=%~dp0\.. --feature-flags=binarycaching,manifests --x-install-root=%VCPKG_INSTALLATION_ROOT%/installed :: Remind about Vulkan SDK echo. @@ -34,7 +34,7 @@ echo All dependencies have been installed successfully! echo You can now use CMake to build your Vulkan project. echo. echo Example CMake command: -echo cmake -B build -S attachments -DCMAKE_TOOLCHAIN_FILE=[path\to\vcpkg]\scripts\buildsystems\vcpkg.cmake +echo cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=[path\to\vcpkg]\scripts\buildsystems\vcpkg.cmake echo cmake --build build exit /b 0 diff --git a/scripts/vcpkg.json b/scripts/vcpkg.json new file mode 100644 index 00000000..0a90e24d --- /dev/null +++ b/scripts/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "vulkan-tutorial", + "version": "1.0.0", + "dependencies": [ + "glfw3", + "glm", + "tinyobjloader", + "stb", + "tinygltf", + "nlohmann-json", + "ktx" + ] +} From 904487a651bcaf861adfdb87f86982ac0e2cc44d Mon Sep 17 00:00:00 2001 From: swinston Date: Mon, 2 Mar 2026 17:13:54 -0800 Subject: [PATCH 15/15] Remove vcpkg.json files and revert to classic mode installation Delete vcpkg.json manifest files from root, scripts, and attachments directories. Update Windows installation scripts to use classic mode with explicit package list instead of manifest mode. This reverts dependency management to vcpkg classic mode across the project. --- .../install_dependencies_windows.bat | 4 ++-- attachments/simple_engine/vcpkg.json | 18 ------------------ scripts/install_dependencies_windows.bat | 4 ++-- scripts/vcpkg.json | 13 ------------- vcpkg.json | 13 ------------- 5 files changed, 4 insertions(+), 48 deletions(-) delete mode 100644 attachments/simple_engine/vcpkg.json delete mode 100644 scripts/vcpkg.json delete mode 100644 vcpkg.json diff --git a/attachments/simple_engine/install_dependencies_windows.bat b/attachments/simple_engine/install_dependencies_windows.bat index 0fe383f4..590fd419 100644 --- a/attachments/simple_engine/install_dependencies_windows.bat +++ b/attachments/simple_engine/install_dependencies_windows.bat @@ -24,9 +24,9 @@ set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite :: Create cache directory if it doesn't exist if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache -:: Install all dependencies at once using vcpkg with parallel installation +:: Install all dependencies at once using vcpkg in classic mode echo Installing all dependencies... -vcpkg install --triplet=x64-windows --x-manifest-root=%~dp0 --feature-flags=binarycaching,manifests --x-install-root=%VCPKG_INSTALLATION_ROOT%/installed +vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows :: Remind about Vulkan SDK echo. diff --git a/attachments/simple_engine/vcpkg.json b/attachments/simple_engine/vcpkg.json deleted file mode 100644 index 0ec18a26..00000000 --- a/attachments/simple_engine/vcpkg.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "vulkan-game-engine-tutorial", - "version": "1.0.0", - "dependencies": [ - { - "name": "glfw3", - "platform": "!android" - }, - "glm", - "openal-soft", - { - "name": "ktx", - "features": [ "vulkan" ] - }, - "tinygltf", - "nlohmann-json" - ] -} diff --git a/scripts/install_dependencies_windows.bat b/scripts/install_dependencies_windows.bat index bd8ff37c..1f354d8e 100644 --- a/scripts/install_dependencies_windows.bat +++ b/scripts/install_dependencies_windows.bat @@ -21,9 +21,9 @@ set VCPKG_BINARY_SOURCES=clear;files,%TEMP%\vcpkg-cache,readwrite :: Create cache directory if it doesn't exist if not exist %TEMP%\vcpkg-cache mkdir %TEMP%\vcpkg-cache -:: Install all dependencies at once using vcpkg with parallel installation +:: Install all dependencies at once using vcpkg in classic mode echo Installing all dependencies... -vcpkg install --triplet=x64-windows --x-manifest-root=%~dp0\.. --feature-flags=binarycaching,manifests --x-install-root=%VCPKG_INSTALLATION_ROOT%/installed +vcpkg install glfw3 glm tinyobjloader stb tinygltf nlohmann-json ktx[vulkan] openal-soft --triplet=x64-windows :: Remind about Vulkan SDK echo. diff --git a/scripts/vcpkg.json b/scripts/vcpkg.json deleted file mode 100644 index 0a90e24d..00000000 --- a/scripts/vcpkg.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "vulkan-tutorial", - "version": "1.0.0", - "dependencies": [ - "glfw3", - "glm", - "tinyobjloader", - "stb", - "tinygltf", - "nlohmann-json", - "ktx" - ] -} diff --git a/vcpkg.json b/vcpkg.json deleted file mode 100644 index 0a90e24d..00000000 --- a/vcpkg.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "vulkan-tutorial", - "version": "1.0.0", - "dependencies": [ - "glfw3", - "glm", - "tinyobjloader", - "stb", - "tinygltf", - "nlohmann-json", - "ktx" - ] -}