11diff --git a/CMakeLists.txt b/CMakeLists.txt
2- index 06f044b8f..cd14a12cc 100644
2+ index 06f044b8f..b4fb8ce52 100644
33--- a/CMakeLists.txt
44+++ b/CMakeLists.txt
55@@ -23,6 +23,8 @@ option(FILAMENT_TESTS "Build tests" ON)
@@ -69,7 +69,7 @@ index 06f044b8f..cd14a12cc 100644
6969+ endif()
7070+
7171+ list(FIND external_subdirectories "${subdirectory}" has_subdirectory)
72- + if(NOT ${${package_name}_FOUND} AND ${has_subdirectory} EQUAL -1)
72+ + if(NOT ${${package_name}_FOUND} AND ${has_subdirectory} EQUAL -1 AND EXISTS "${EXTERNAL}/${subdirectory}" )
7373+ add_subdirectory(${EXTERNAL}/${subdirectory})
7474+ list(APPEND external_subdirectories ${subdirectory})
7575+ endif()
@@ -93,7 +93,7 @@ index 06f044b8f..cd14a12cc 100644
9393+ endif()
9494+
9595+ list(FIND external_subdirectories "${subdirectory}" has_subdirectory)
96- + if(NOT ${found} AND ${has_subdirectory} EQUAL -1)
96+ + if(NOT ${found} AND ${has_subdirectory} EQUAL -1 AND EXISTS "${EXTERNAL}/${subdirectory}" )
9797+ add_subdirectory(${EXTERNAL}/${subdirectory})
9898+ list(APPEND external_subdirectories ${subdirectory})
9999+ endif()
@@ -108,7 +108,7 @@ index 06f044b8f..cd14a12cc 100644
108108 add_subdirectory(${LIBRARIES}/camutils)
109109 add_subdirectory(${LIBRARIES}/filabridge)
110110 add_subdirectory(${LIBRARIES}/filaflat)
111- @@ -751,21 +824,24 @@ add_subdirectory(${LIBRARIES}/utils)
111+ @@ -751,21 +824,25 @@ add_subdirectory(${LIBRARIES}/utils)
112112 add_subdirectory(${LIBRARIES}/viewer)
113113 add_subdirectory(${FILAMENT}/filament)
114114 add_subdirectory(${FILAMENT}/shaders)
@@ -117,6 +117,7 @@ index 06f044b8f..cd14a12cc 100644
117117- add_subdirectory(${EXTERNAL}/imgui/tnt)
118118- add_subdirectory(${EXTERNAL}/robin-map/tnt)
119119- add_subdirectory(${EXTERNAL}/smol-v/tnt)
120+ + add_external_library("zstd" "zstd/tnt" "zstd::libzstd" "zstd")
120121+ add_external_library("basisu" "basisu/tnt" "basisu::basisu;basisu::basisu_encoder;basisu::basisu_encoder" "basisu;basis_encoder;basis_transcoder")
121122+ add_external_library("civetweb" "civetweb/tnt" "civetweb::civetweb;civetweb::civetweb-cpp" "civetweb;civetweb-cpp")
122123+ if(TARGET civetweb::civetweb AND TARGET civetweb::civetweb-cpp)
@@ -146,7 +147,7 @@ index 06f044b8f..cd14a12cc 100644
146147
147148 # Note that this has to be placed after mikktspace in order for combine_static_libs to work.
148149 add_subdirectory(${LIBRARIES}/geometry)
149- @@ -773,9 +849 ,25 @@ add_subdirectory(${LIBRARIES}/geometry)
150+ @@ -773,9 +850 ,25 @@ add_subdirectory(${LIBRARIES}/geometry)
150151 if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM)
151152 # spirv-tools must come before filamat, as filamat relies on the presence of the
152153 # spirv-tools_SOURCE_DIR variable.
@@ -175,7 +176,7 @@ index 06f044b8f..cd14a12cc 100644
175176 add_subdirectory(${LIBRARIES}/filamat)
176177
177178 # the material debugger requires filamat
178- @@ -786,9 +878 ,9 @@ endif()
179+ @@ -786,9 +879 ,9 @@ endif()
179180
180181 if (FILAMENT_SUPPORTS_VULKAN)
181182 add_subdirectory(${LIBRARIES}/bluevk)
@@ -187,7 +188,7 @@ index 06f044b8f..cd14a12cc 100644
187188 endif()
188189
189190 set(FILAMENT_SAMPLES_BINARY_DIR ${PROJECT_BINARY_DIR}/samples)
190- @@ -809,11 +901 ,11 @@ if (IS_HOST_PLATFORM)
191+ @@ -809,11 +902 ,11 @@ if (IS_HOST_PLATFORM)
191192
192193 add_subdirectory(${FILAMENT}/samples)
193194
0 commit comments