blob: 3c3feda187b8d0453cdf035cc0e36cde03461605 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
diff --git a/src/ext/CMakeLists.txt b/src/ext/CMakeLists.txt
index ba422f8e..dfe210c6 100644
--- a/src/ext/CMakeLists.txt
+++ b/src/ext/CMakeLists.txt
@@ -11,46 +11,7 @@ target_link_libraries(luisa-render-ext INTERFACE fast_float)
find_package(ZLIB)
# Assimp
-if (ZLIB_FOUND)
- # work around assimp's broken install when using system zlib
- if (NOT TARGET zlib)
- add_library(zlib INTERFACE)
- endif ()
- if (NOT TARGET zlibstatic)
- add_library(zlibstatic INTERFACE)
- endif ()
- set(ASSIMP_BUILD_ZLIB OFF CACHE BOOL "" FORCE)
-else ()
- set(ASSIMP_BUILD_ZLIB ON CACHE BOOL "" FORCE)
-endif ()
-set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE BOOL "" FORCE)
-set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "" FORCE)
-set(ASSIMP_INSTALL ON CACHE BOOL "" FORCE)
-set(ASSIMP_INJECT_DEBUG_POSTFIX OFF CACHE BOOL "" FORCE)
-set(ASSIMP_NO_EXPORT ON CACHE BOOL "" FORCE)
-set(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT ON CACHE BOOL "" FORCE)
-set(ASSIMP_WARNINGS_AS_ERRORS OFF CACHE BOOL "" FORCE)
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND
- CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0)
- add_compile_options(-Wno-deprecated-non-prototype)
-endif ()
-add_subdirectory(assimp)
-set_target_properties(assimp PROPERTIES
- UNITY_BUILD OFF
- OUTPUT_NAME "luisa-render-ext-assimp")
-if (UNIX AND NOT APPLE) # TODO: fix this
- target_compile_definitions(assimp PRIVATE USE_FILE32API=1)
-endif ()
-if (ASSIMP_BUILD_ZLIB)
- if (TARGET zlib)
- set_target_properties(zlib PROPERTIES
- WINDOWS_EXPORT_ALL_SYMBOLS ON
- OUTPUT_NAME "luisa-render-ext-zlib")
- install(TARGETS zlib
- LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- endif ()
-endif ()
+find_package(assimp CONFIG)
target_link_libraries(luisa-render-ext INTERFACE assimp::assimp)
# tinyexr
|