From 22be3d288a16e2237bcbe7e9441383f31d81eb7a Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Tue, 28 May 2024 00:15:36 +0200 Subject: [PATCH] Fix issue with finding assimp on consecutive cmake runs --- 3rdParty/assimp/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/3rdParty/assimp/CMakeLists.txt b/3rdParty/assimp/CMakeLists.txt index 4524135..a7179c4 100644 --- a/3rdParty/assimp/CMakeLists.txt +++ b/3rdParty/assimp/CMakeLists.txt @@ -1,5 +1,6 @@ include(FetchContent) +unset(assimp_FOUND) find_package(assimp QUIET) if (assimp_FOUND) message("Using system assimp") @@ -25,15 +26,15 @@ elseif (USE_ASSIMP) FetchContent_MakeAvailable(assimp) - set(assimp_FOUND "fetched assimp found" CACHE INTERNAL ON) + set(assimp_BUILT "fetched assimp found" CACHE INTERNAL ON) endif () function(LinkAssimp TARGET) - if (NOT assimp_FOUND) + if (NOT assimp_BUILT) find_package(assimp QUIET) endif () - if (assimp_FOUND) + if (assimp_FOUND OR assimp_BUILT) target_link_libraries(${TARGET} PUBLIC assimp) endif () endfunction() \ No newline at end of file