Skip to content

Commit bf882ab

Browse files
committed
Revert "Restrict vcpkg dependencies to Windows platform and improve CMake module path handling"
This reverts commit 67a28b9.
1 parent 5112502 commit bf882ab

15 files changed

Lines changed: 29 additions & 108 deletions

attachments/CMake/FindKTX.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
#
1515

1616
# Try to find the package using CONFIG mode first (e.g., from vcpkg)
17-
if(COMMAND _find_package)
18-
_find_package(ktx CONFIG QUIET)
19-
else()
20-
find_package(ktx CONFIG QUIET)
21-
endif()
17+
find_package(ktx CONFIG QUIET)
2218

2319
if(ktx_FOUND)
2420
if(NOT TARGET KTX::ktx AND TARGET ktx::ktx)

attachments/CMake/Findglm.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
#
1414

1515
# Try to find the package using CONFIG mode first (e.g., from vcpkg)
16-
if(COMMAND _find_package)
17-
_find_package(glm CONFIG QUIET)
18-
else()
19-
find_package(glm CONFIG QUIET)
20-
endif()
16+
find_package(glm CONFIG QUIET)
2117

2218
if(glm_FOUND)
2319
if(NOT TARGET glm::glm AND TARGET glm)

attachments/CMake/Findnlohmann_json.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
#
1414

1515
# Try to find the package using CONFIG mode first (e.g., from vcpkg)
16-
if(COMMAND _find_package)
17-
_find_package(nlohmann_json CONFIG QUIET)
18-
else()
19-
find_package(nlohmann_json CONFIG QUIET)
20-
endif()
16+
find_package(nlohmann_json CONFIG QUIET)
2117

2218
if(nlohmann_json_FOUND)
2319
if(NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json)

attachments/CMake/Findstb.cmake

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212
# stb::stb
1313
#
1414

15-
# Try to find the package using CONFIG mode first (e.g., from vcpkg)
16-
if(COMMAND _find_package)
17-
_find_package(stb CONFIG QUIET)
18-
else()
19-
find_package(stb CONFIG QUIET)
20-
endif()
21-
22-
if(stb_FOUND)
23-
if(NOT TARGET stb::stb AND TARGET stb)
24-
add_library(stb::stb ALIAS stb)
25-
endif()
26-
return()
27-
endif()
28-
2915
# Try to find the package using pkg-config first
3016
find_package(PkgConfig QUIET)
3117
if(PKG_CONFIG_FOUND)
@@ -81,7 +67,7 @@ endif()
8167

8268
# Set the variables
8369
include(FindPackageHandleStandardArgs)
84-
find_package_handle_standard_args(stb
70+
find_package_handle_standard_args(stb
8571
REQUIRED_VARS stb_INCLUDE_DIR
8672
)
8773

@@ -97,4 +83,4 @@ if(stb_FOUND)
9783
endif()
9884
endif()
9985

100-
mark_as_advanced(stb_INCLUDE_DIR)
86+
mark_as_advanced(stb_INCLUDE_DIR)

attachments/CMake/Findtinygltf.cmake

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
#
1414

1515
# Try to find the package using CONFIG mode first (e.g., from vcpkg)
16-
if(COMMAND _find_package)
17-
_find_package(tinygltf CONFIG QUIET)
18-
else()
19-
find_package(tinygltf CONFIG QUIET)
20-
endif()
16+
find_package(tinygltf CONFIG QUIET)
2117

2218
if(tinygltf_FOUND)
2319
if(NOT TARGET tinygltf::tinygltf AND TARGET tinygltf)
@@ -27,11 +23,7 @@ if(tinygltf_FOUND)
2723
endif()
2824

2925
# First, try to find nlohmann_json
30-
if(COMMAND _find_package)
31-
_find_package(nlohmann_json QUIET)
32-
else()
33-
find_package(nlohmann_json QUIET)
34-
endif()
26+
find_package(nlohmann_json QUIET)
3527
if(NOT nlohmann_json_FOUND)
3628
include(FetchContent)
3729
message(STATUS "nlohmann_json not found, fetching v3.12.0 from GitHub...")

attachments/CMake/Findtinyobjloader.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
# tinyobjloader::tinyobjloader
1111

1212
# Try to find the package using CONFIG mode first (e.g., from vcpkg)
13-
if(COMMAND _find_package)
14-
_find_package(tinyobjloader CONFIG QUIET)
15-
else()
16-
find_package(tinyobjloader CONFIG QUIET)
17-
endif()
13+
find_package(tinyobjloader CONFIG QUIET)
1814

1915
if(tinyobjloader_FOUND)
2016
if(NOT TARGET tinyobjloader::tinyobjloader AND TARGET tinyobjloader)

attachments/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
cmake_minimum_required (VERSION 3.29)
22

3-
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
4-
53
# vcpkg integration
64
if(WIN32)
75
# By default, we disable manifest mode to ensure compatibility with all vcpkg installations,
@@ -13,6 +11,8 @@ endif()
1311

1412
project (VulkanTutorial)
1513

14+
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
15+
1616
# Add option to enable/disable C++ 20 module
1717
option(ENABLE_CPP20_MODULE "Enable C++ 20 module support for Vulkan" OFF)
1818

attachments/simple_engine/CMake/FindKTX.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
#
1515

1616
# Try to find the package using CONFIG mode first (e.g., from vcpkg)
17-
if(COMMAND _find_package)
18-
_find_package(ktx CONFIG QUIET)
19-
else()
20-
find_package(ktx CONFIG QUIET)
21-
endif()
17+
find_package(ktx CONFIG QUIET)
2218

2319
if(ktx_FOUND)
2420
if(NOT TARGET KTX::ktx AND TARGET ktx::ktx)

attachments/simple_engine/CMake/Findglm.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
#
1414

1515
# Try to find the package using CONFIG mode first (e.g., from vcpkg)
16-
if(COMMAND _find_package)
17-
_find_package(glm CONFIG QUIET)
18-
else()
19-
find_package(glm CONFIG QUIET)
20-
endif()
16+
find_package(glm CONFIG QUIET)
2117

2218
if(glm_FOUND)
2319
if(NOT TARGET glm::glm AND TARGET glm)

attachments/simple_engine/CMake/Findnlohmann_json.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
#
1414

1515
# Try to find the package using CONFIG mode first (e.g., from vcpkg)
16-
if(COMMAND _find_package)
17-
_find_package(nlohmann_json CONFIG QUIET)
18-
else()
19-
find_package(nlohmann_json CONFIG QUIET)
20-
endif()
16+
find_package(nlohmann_json CONFIG QUIET)
2117

2218
if(nlohmann_json_FOUND)
2319
if(NOT TARGET nlohmann_json::nlohmann_json AND TARGET nlohmann_json)

0 commit comments

Comments
 (0)