File tree Expand file tree Collapse file tree 12 files changed +109
-7
lines changed
Expand file tree Collapse file tree 12 files changed +109
-7
lines changed Original file line number Diff line number Diff line change 1313# KTX::ktx
1414#
1515
16+ # Try to find the package using CONFIG mode first (e.g., from vcpkg)
17+ find_package (ktx CONFIG QUIET )
18+
19+ if (ktx_FOUND)
20+ if (NOT TARGET KTX::ktx AND TARGET ktx::ktx)
21+ add_library (KTX::ktx ALIAS ktx::ktx )
22+ endif ()
23+ set (KTX_FOUND TRUE )
24+ return ()
25+ endif ()
26+
1627# Check if we're on Linux - if so, we'll skip the search and directly use FetchContent
1728if (UNIX AND NOT APPLE )
1829 # On Linux, we assume KTX is not installed and proceed directly to fetching it
Original file line number Diff line number Diff line change 1212# glm::glm
1313#
1414
15+ # Try to find the package using CONFIG mode first (e.g., from vcpkg)
16+ find_package (glm CONFIG QUIET )
17+
18+ if (glm_FOUND)
19+ if (NOT TARGET glm::glm AND TARGET glm)
20+ add_library (glm::glm ALIAS glm )
21+ endif ()
22+ return ()
23+ endif ()
24+
1525# Try to find the package using pkg-config first
1626find_package (PkgConfig QUIET )
1727if (PKG_CONFIG_FOUND)
@@ -94,7 +104,7 @@ endif()
94104
95105# Set the variables
96106include (FindPackageHandleStandardArgs )
97- find_package_handle_standard_args (glm
107+ find_package_handle_standard_args (glm
98108 REQUIRED_VARS glm_INCLUDE_DIR
99109)
100110
Original file line number Diff line number Diff line change 1212# nlohmann_json::nlohmann_json
1313#
1414
15+ # Try to find the package using CONFIG mode first (e.g., from vcpkg)
16+ find_package (nlohmann_json CONFIG QUIET )
17+
18+ if (nlohmann_json_FOUND)
19+ if (NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json)
20+ add_library (nlohmann_json::nlohmann_json ALIAS nlohmann_json )
21+ endif ()
22+ return ()
23+ endif ()
24+
1525# Try to find the package using pkg-config first
1626find_package (PkgConfig QUIET )
1727if (PKG_CONFIG_FOUND)
Original file line number Diff line number Diff line change 1212# tinygltf::tinygltf
1313#
1414
15+ # Try to find the package using CONFIG mode first (e.g., from vcpkg)
16+ find_package (tinygltf CONFIG QUIET )
17+
18+ if (tinygltf_FOUND)
19+ if (NOT TARGET tinygltf::tinygltf AND TARGET tinygltf)
20+ add_library (tinygltf::tinygltf ALIAS tinygltf )
21+ endif ()
22+ return ()
23+ endif ()
24+
1525# First, try to find nlohmann_json
1626find_package (nlohmann_json QUIET )
1727if (NOT nlohmann_json_FOUND)
Original file line number Diff line number Diff line change 99# It also defines the following targets:
1010# tinyobjloader::tinyobjloader
1111
12+ # Try to find the package using CONFIG mode first (e.g., from vcpkg)
13+ find_package (tinyobjloader CONFIG QUIET )
14+
15+ if (tinyobjloader_FOUND)
16+ if (NOT TARGET tinyobjloader::tinyobjloader AND TARGET tinyobjloader)
17+ add_library (tinyobjloader::tinyobjloader ALIAS tinyobjloader )
18+ endif ()
19+ return ()
20+ endif ()
21+
1222# Try to find the package using pkg-config first
1323find_package (PkgConfig QUIET )
1424if (PKG_CONFIG_FOUND)
@@ -109,7 +119,7 @@ endif()
109119
110120# Set the variables
111121include (FindPackageHandleStandardArgs )
112- find_package_handle_standard_args (tinyobjloader
122+ find_package_handle_standard_args (tinyobjloader
113123 REQUIRED_VARS tinyobjloader_INCLUDE_DIR
114124)
115125
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ endif()
1111
1212project (VulkanTutorial)
1313
14- list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR} /CMake" )
14+ list (PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR} /CMake" )
1515
1616# Add option to enable/disable C++ 20 module
1717option (ENABLE_CPP20_MODULE "Enable C++ 20 module support for Vulkan" OFF )
Original file line number Diff line number Diff line change 1313# KTX::ktx
1414#
1515
16+ # Try to find the package using CONFIG mode first (e.g., from vcpkg)
17+ find_package (ktx CONFIG QUIET )
18+
19+ if (ktx_FOUND)
20+ if (NOT TARGET KTX::ktx AND TARGET ktx::ktx)
21+ add_library (KTX::ktx ALIAS ktx::ktx )
22+ endif ()
23+ set (KTX_FOUND TRUE )
24+ return ()
25+ endif ()
26+
1627# Check if we're on Linux - if so, we'll skip the search and directly use FetchContent
1728if (UNIX AND NOT APPLE )
1829 # On Linux, we assume KTX is not installed and proceed directly to fetching it
@@ -70,7 +81,7 @@ if(NOT KTX_FOUND)
7081 FetchContent_Declare (
7182 ktx
7283 GIT_REPOSITORY https://github.com/KhronosGroup/KTX-Software.git
73- GIT_TAG v4.4.2 # Use a specific tag for stability
84+ GIT_TAG v4.3.1 # Use a specific tag for stability
7485 )
7586
7687 # Set options to minimize build time and dependencies
Original file line number Diff line number Diff line change 1212# glm::glm
1313#
1414
15+ # Try to find the package using CONFIG mode first (e.g., from vcpkg)
16+ find_package (glm CONFIG QUIET )
17+
18+ if (glm_FOUND)
19+ if (NOT TARGET glm::glm AND TARGET glm)
20+ add_library (glm::glm ALIAS glm )
21+ endif ()
22+ return ()
23+ endif ()
24+
1525# Try to find the package using pkg-config first
1626find_package (PkgConfig QUIET )
1727if (PKG_CONFIG_FOUND)
@@ -94,7 +104,7 @@ endif()
94104
95105# Set the variables
96106include (FindPackageHandleStandardArgs )
97- find_package_handle_standard_args (glm
107+ find_package_handle_standard_args (glm
98108 REQUIRED_VARS glm_INCLUDE_DIR
99109)
100110
Original file line number Diff line number Diff line change 1212# nlohmann_json::nlohmann_json
1313#
1414
15+ # Try to find the package using CONFIG mode first (e.g., from vcpkg)
16+ find_package (nlohmann_json CONFIG QUIET )
17+
18+ if (nlohmann_json_FOUND)
19+ if (NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json)
20+ add_library (nlohmann_json::nlohmann_json ALIAS nlohmann_json )
21+ endif ()
22+ return ()
23+ endif ()
24+
1525# Try to find the package using pkg-config first
1626find_package (PkgConfig QUIET )
1727if (PKG_CONFIG_FOUND)
Original file line number Diff line number Diff line change 1212# tinygltf::tinygltf
1313#
1414
15+ # Try to find the package using CONFIG mode first (e.g., from vcpkg)
16+ find_package (tinygltf CONFIG QUIET )
17+
18+ if (tinygltf_FOUND)
19+ if (NOT TARGET tinygltf::tinygltf AND TARGET tinygltf)
20+ add_library (tinygltf::tinygltf ALIAS tinygltf )
21+ endif ()
22+ return ()
23+ endif ()
24+
1525# First, try to find nlohmann_json
1626find_package (nlohmann_json QUIET )
1727if (NOT nlohmann_json_FOUND)
You can’t perform that action at this time.
0 commit comments