Fix issue with finding assimp on consecutive cmake runs
This commit is contained in:
7
3rdParty/assimp/CMakeLists.txt
vendored
7
3rdParty/assimp/CMakeLists.txt
vendored
@@ -1,5 +1,6 @@
|
|||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
|
unset(assimp_FOUND)
|
||||||
find_package(assimp QUIET)
|
find_package(assimp QUIET)
|
||||||
if (assimp_FOUND)
|
if (assimp_FOUND)
|
||||||
message("Using system assimp")
|
message("Using system assimp")
|
||||||
@@ -25,15 +26,15 @@ elseif (USE_ASSIMP)
|
|||||||
|
|
||||||
FetchContent_MakeAvailable(assimp)
|
FetchContent_MakeAvailable(assimp)
|
||||||
|
|
||||||
set(assimp_FOUND "fetched assimp found" CACHE INTERNAL ON)
|
set(assimp_BUILT "fetched assimp found" CACHE INTERNAL ON)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
function(LinkAssimp TARGET)
|
function(LinkAssimp TARGET)
|
||||||
if (NOT assimp_FOUND)
|
if (NOT assimp_BUILT)
|
||||||
find_package(assimp QUIET)
|
find_package(assimp QUIET)
|
||||||
endif ()
|
endif ()
|
||||||
if (assimp_FOUND)
|
if (assimp_FOUND OR assimp_BUILT)
|
||||||
target_link_libraries(${TARGET} PUBLIC assimp)
|
target_link_libraries(${TARGET} PUBLIC assimp)
|
||||||
endif ()
|
endif ()
|
||||||
endfunction()
|
endfunction()
|
||||||
Reference in New Issue
Block a user