CMakeLists.txt 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958
  1. # Open Asset Import Library (assimp)
  2. # ----------------------------------------------------------------------
  3. #
  4. # Copyright (c) 2006-2017, assimp team
  5. # All rights reserved.
  6. #
  7. # Redistribution and use of this software in source and binary forms,
  8. # with or without modification, are permitted provided that the
  9. # following conditions are met:
  10. #
  11. # * Redistributions of source code must retain the above
  12. # copyright notice, this list of conditions and the
  13. # following disclaimer.
  14. #
  15. # * Redistributions in binary form must reproduce the above
  16. # copyright notice, this list of conditions and the
  17. # following disclaimer in the documentation and/or other
  18. # materials provided with the distribution.
  19. #
  20. # * Neither the name of the assimp team, nor the names of its
  21. # contributors may be used to endorse or promote products
  22. # derived from this software without specific prior
  23. # written permission of the assimp team.
  24. #
  25. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  26. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  27. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  28. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  29. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  30. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  31. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  32. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  33. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  34. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  35. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  36. #
  37. #----------------------------------------------------------------------
  38. # Listing and grouping of all the source files.
  39. # 1) Set the file lists for each component
  40. # 2) Create a Source Group for each component, for IDE project orginization
  41. # 3) Add libassimp using the file lists (eliminates duplication of file names between
  42. # source groups and library command)
  43. #
  44. # Modified by Lasse Oorni and Yao Wei Tjong for Urho3D
  45. SET( HEADER_PATH ../include/assimp )
  46. SET( COMPILER_HEADERS
  47. ${HEADER_PATH}/Compiler/pushpack1.h
  48. ${HEADER_PATH}/Compiler/poppack1.h
  49. ${HEADER_PATH}/Compiler/pstdint.h
  50. )
  51. SOURCE_GROUP( Compiler FILES ${COMPILER_HEADERS})
  52. SET( PUBLIC_HEADERS
  53. ${HEADER_PATH}/anim.h
  54. ${HEADER_PATH}/ai_assert.h
  55. ${HEADER_PATH}/camera.h
  56. ${HEADER_PATH}/color4.h
  57. ${HEADER_PATH}/color4.inl
  58. ${CMAKE_CURRENT_BINARY_DIR}/../include/assimp/config.h
  59. ${HEADER_PATH}/defs.h
  60. ${HEADER_PATH}/Defines.h
  61. ${HEADER_PATH}/cfileio.h
  62. ${HEADER_PATH}/light.h
  63. ${HEADER_PATH}/material.h
  64. ${HEADER_PATH}/material.inl
  65. ${HEADER_PATH}/matrix3x3.h
  66. ${HEADER_PATH}/matrix3x3.inl
  67. ${HEADER_PATH}/matrix4x4.h
  68. ${HEADER_PATH}/matrix4x4.inl
  69. ${HEADER_PATH}/mesh.h
  70. ${HEADER_PATH}/postprocess.h
  71. ${HEADER_PATH}/quaternion.h
  72. ${HEADER_PATH}/quaternion.inl
  73. ${HEADER_PATH}/scene.h
  74. ${HEADER_PATH}/metadata.h
  75. ${HEADER_PATH}/texture.h
  76. ${HEADER_PATH}/types.h
  77. ${HEADER_PATH}/vector2.h
  78. ${HEADER_PATH}/vector2.inl
  79. ${HEADER_PATH}/vector3.h
  80. ${HEADER_PATH}/vector3.inl
  81. ${HEADER_PATH}/version.h
  82. ${HEADER_PATH}/cimport.h
  83. ${HEADER_PATH}/importerdesc.h
  84. ${HEADER_PATH}/Importer.hpp
  85. ${HEADER_PATH}/DefaultLogger.hpp
  86. ${HEADER_PATH}/ProgressHandler.hpp
  87. ${HEADER_PATH}/IOStream.hpp
  88. ${HEADER_PATH}/IOSystem.hpp
  89. ${HEADER_PATH}/Logger.hpp
  90. ${HEADER_PATH}/LogStream.hpp
  91. ${HEADER_PATH}/NullLogger.hpp
  92. ${HEADER_PATH}/cexport.h
  93. ${HEADER_PATH}/Exporter.hpp
  94. ${HEADER_PATH}/DefaultIOStream.h
  95. ${HEADER_PATH}/DefaultIOSystem.h
  96. ${HEADER_PATH}/SceneCombiner.h
  97. )
  98. SET( Core_SRCS
  99. Assimp.cpp
  100. )
  101. SET( Logging_SRCS
  102. ${HEADER_PATH}/DefaultLogger.hpp
  103. ${HEADER_PATH}/LogStream.hpp
  104. ${HEADER_PATH}/Logger.hpp
  105. ${HEADER_PATH}/NullLogger.hpp
  106. Win32DebugLogStream.h
  107. DefaultLogger.cpp
  108. FileLogStream.h
  109. StdOStreamLogStream.h
  110. )
  111. SOURCE_GROUP(Logging FILES ${Logging_SRCS})
  112. SET( Common_SRCS
  113. fast_atof.h
  114. qnan.h
  115. BaseImporter.cpp
  116. BaseImporter.h
  117. BaseProcess.cpp
  118. BaseProcess.h
  119. Importer.h
  120. ScenePrivate.h
  121. PostStepRegistry.cpp
  122. ImporterRegistry.cpp
  123. ByteSwapper.h
  124. DefaultProgressHandler.h
  125. DefaultIOStream.cpp
  126. DefaultIOSystem.cpp
  127. CInterfaceIOWrapper.cpp
  128. CInterfaceIOWrapper.h
  129. Hash.h
  130. Importer.cpp
  131. IFF.h
  132. MemoryIOWrapper.h
  133. ParsingUtils.h
  134. StreamReader.h
  135. StreamWriter.h
  136. StringComparison.h
  137. StringUtils.h
  138. SGSpatialSort.cpp
  139. SGSpatialSort.h
  140. VertexTriangleAdjacency.cpp
  141. VertexTriangleAdjacency.h
  142. GenericProperty.h
  143. SpatialSort.cpp
  144. SpatialSort.h
  145. SceneCombiner.cpp
  146. ScenePreprocessor.cpp
  147. ScenePreprocessor.h
  148. SkeletonMeshBuilder.cpp
  149. SkeletonMeshBuilder.h
  150. SplitByBoneCountProcess.cpp
  151. SplitByBoneCountProcess.h
  152. ScaleProcess.cpp
  153. ScaleProcess.h
  154. SmoothingGroups.h
  155. StandardShapes.cpp
  156. StandardShapes.h
  157. TargetAnimation.cpp
  158. TargetAnimation.h
  159. RemoveComments.cpp
  160. RemoveComments.h
  161. Subdivision.cpp
  162. Subdivision.h
  163. scene.cpp
  164. Vertex.h
  165. LineSplitter.h
  166. TinyFormatter.h
  167. Profiler.h
  168. LogAux.h
  169. Bitmap.cpp
  170. Bitmap.h
  171. XMLTools.h
  172. Version.cpp
  173. IOStreamBuffer.h
  174. CreateAnimMesh.h
  175. CreateAnimMesh.cpp
  176. )
  177. SOURCE_GROUP(Common FILES ${Common_SRCS})
  178. IF ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER )
  179. SET( C4D_SRCS
  180. C4DImporter.cpp
  181. C4DImporter.h
  182. )
  183. SOURCE_GROUP( C4D FILES ${C4D_SRCS})
  184. ENDIF ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER )
  185. # if this variable is set to TRUE, the user can manually disable importers by setting
  186. # ASSIMP_BUILD_XXX_IMPORTER to FALSE for each importer
  187. # if this variable is set to FALSE, the user can manually enable importers by setting
  188. # ASSIMP_BUILD_XXX_IMPORTER to TRUE for each importer
  189. OPTION(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT "default value of all ASSIMP_BUILD_XXX_IMPORTER value" TRUE)
  190. # macro to add the CMake Option ADD_ASSIMP_IMPORTER_<name> which enables compile of loader
  191. # this way selective loaders can be compiled (reduces filesize + compile time)
  192. MACRO(ADD_ASSIMP_IMPORTER name)
  193. OPTION(ASSIMP_BUILD_${name}_IMPORTER "build the ${name} importer" ${ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT})
  194. IF(ASSIMP_BUILD_${name}_IMPORTER)
  195. LIST(APPEND ASSIMP_LOADER_SRCS ${ARGN})
  196. SET(ASSIMP_IMPORTERS_ENABLED "${ASSIMP_IMPORTERS_ENABLED} ${name}")
  197. SET(${name}_SRCS ${ARGN})
  198. SOURCE_GROUP(${name} FILES ${ARGN})
  199. ELSE()
  200. SET(${name}_SRC "")
  201. SET(ASSIMP_IMPORTERS_DISABLED "${ASSIMP_IMPORTERS_DISABLED} ${name}")
  202. add_definitions(-DASSIMP_BUILD_NO_${name}_IMPORTER)
  203. add_definitions(-DASSIMP_BUILD_NO_${name}_EXPORTER)
  204. ENDIF()
  205. ENDMACRO()
  206. SET(ASSIMP_LOADER_SRCS "")
  207. SET(ASSIMP_IMPORTERS_ENABLED "") # list of enabled importers
  208. SET(ASSIMP_IMPORTERS_DISABLED "") # disabled list (used to print)
  209. ADD_ASSIMP_IMPORTER( AMF
  210. AMFImporter.hpp
  211. AMFImporter_Macro.hpp
  212. AMFImporter_Node.hpp
  213. AMFImporter.cpp
  214. AMFImporter_Geometry.cpp
  215. AMFImporter_Material.cpp
  216. AMFImporter_Postprocess.cpp
  217. )
  218. ADD_ASSIMP_IMPORTER( 3DS
  219. 3DSConverter.cpp
  220. 3DSHelper.h
  221. 3DSLoader.cpp
  222. 3DSLoader.h
  223. 3DSExporter.h
  224. 3DSExporter.cpp
  225. )
  226. ADD_ASSIMP_IMPORTER( AC
  227. ACLoader.cpp
  228. ACLoader.h
  229. )
  230. ADD_ASSIMP_IMPORTER( ASE
  231. ASELoader.cpp
  232. ASELoader.h
  233. ASEParser.cpp
  234. ASEParser.h
  235. )
  236. ADD_ASSIMP_IMPORTER( ASSBIN
  237. AssbinExporter.h
  238. AssbinExporter.cpp
  239. AssbinLoader.h
  240. AssbinLoader.cpp
  241. )
  242. ADD_ASSIMP_IMPORTER( ASSXML
  243. AssxmlExporter.h
  244. AssxmlExporter.cpp
  245. )
  246. ADD_ASSIMP_IMPORTER( B3D
  247. B3DImporter.cpp
  248. B3DImporter.h
  249. )
  250. ADD_ASSIMP_IMPORTER( BVH
  251. BVHLoader.cpp
  252. BVHLoader.h
  253. )
  254. ADD_ASSIMP_IMPORTER( COLLADA
  255. ColladaHelper.h
  256. ColladaLoader.cpp
  257. ColladaLoader.h
  258. ColladaParser.cpp
  259. ColladaParser.h
  260. ColladaExporter.h
  261. ColladaExporter.cpp
  262. )
  263. ADD_ASSIMP_IMPORTER( DXF
  264. DXFLoader.cpp
  265. DXFLoader.h
  266. DXFHelper.h
  267. )
  268. ADD_ASSIMP_IMPORTER( CSM
  269. CSMLoader.cpp
  270. CSMLoader.h
  271. )
  272. ADD_ASSIMP_IMPORTER( HMP
  273. HMPFileData.h
  274. HMPLoader.cpp
  275. HMPLoader.h
  276. HalfLifeFileData.h
  277. )
  278. ADD_ASSIMP_IMPORTER( IRRMESH
  279. IRRMeshLoader.cpp
  280. IRRMeshLoader.h
  281. IRRShared.cpp
  282. IRRShared.h
  283. )
  284. ADD_ASSIMP_IMPORTER( IRR
  285. IRRLoader.cpp
  286. IRRLoader.h
  287. IRRShared.cpp
  288. IRRShared.h
  289. )
  290. ADD_ASSIMP_IMPORTER( LWO
  291. LWOAnimation.cpp
  292. LWOAnimation.h
  293. LWOBLoader.cpp
  294. LWOFileData.h
  295. LWOLoader.cpp
  296. LWOLoader.h
  297. LWOMaterial.cpp
  298. )
  299. ADD_ASSIMP_IMPORTER( LWS
  300. LWSLoader.cpp
  301. LWSLoader.h
  302. )
  303. ADD_ASSIMP_IMPORTER( MD2
  304. MD2FileData.h
  305. MD2Loader.cpp
  306. MD2Loader.h
  307. MD2NormalTable.h
  308. )
  309. ADD_ASSIMP_IMPORTER( MD3
  310. MD3FileData.h
  311. MD3Loader.cpp
  312. MD3Loader.h
  313. )
  314. ADD_ASSIMP_IMPORTER( MD5
  315. MD5Loader.cpp
  316. MD5Loader.h
  317. MD5Parser.cpp
  318. MD5Parser.h
  319. )
  320. ADD_ASSIMP_IMPORTER( MDC
  321. MDCFileData.h
  322. MDCLoader.cpp
  323. MDCLoader.h
  324. MDCNormalTable.h
  325. )
  326. ADD_ASSIMP_IMPORTER( MDL
  327. MDLDefaultColorMap.h
  328. MDLFileData.h
  329. MDLLoader.cpp
  330. MDLLoader.h
  331. MDLMaterialLoader.cpp
  332. )
  333. SET( MaterialSystem_SRCS
  334. MaterialSystem.cpp
  335. MaterialSystem.h
  336. )
  337. SOURCE_GROUP( MaterialSystem FILES ${MaterialSystem_SRCS})
  338. ADD_ASSIMP_IMPORTER( NFF
  339. NFFLoader.cpp
  340. NFFLoader.h
  341. )
  342. ADD_ASSIMP_IMPORTER( NDO
  343. NDOLoader.cpp
  344. NDOLoader.h
  345. )
  346. ADD_ASSIMP_IMPORTER( OFF
  347. OFFLoader.cpp
  348. OFFLoader.h
  349. )
  350. ADD_ASSIMP_IMPORTER( OBJ
  351. ObjFileData.h
  352. ObjFileImporter.cpp
  353. ObjFileImporter.h
  354. ObjFileMtlImporter.cpp
  355. ObjFileMtlImporter.h
  356. ObjFileParser.cpp
  357. ObjFileParser.h
  358. ObjTools.h
  359. ObjExporter.h
  360. ObjExporter.cpp
  361. )
  362. ADD_ASSIMP_IMPORTER( OGRE
  363. OgreImporter.h
  364. OgreStructs.h
  365. OgreParsingUtils.h
  366. OgreBinarySerializer.h
  367. OgreXmlSerializer.h
  368. OgreImporter.cpp
  369. OgreStructs.cpp
  370. OgreBinarySerializer.cpp
  371. OgreXmlSerializer.cpp
  372. OgreMaterial.cpp
  373. )
  374. ADD_ASSIMP_IMPORTER( OPENGEX
  375. OpenGEXExporter.cpp
  376. OpenGEXExporter.h
  377. OpenGEXImporter.cpp
  378. OpenGEXImporter.h
  379. OpenGEXStructs.h
  380. )
  381. ADD_ASSIMP_IMPORTER( PLY
  382. PlyLoader.cpp
  383. PlyLoader.h
  384. PlyParser.cpp
  385. PlyParser.h
  386. PlyExporter.cpp
  387. PlyExporter.h
  388. )
  389. ADD_ASSIMP_IMPORTER( MS3D
  390. MS3DLoader.cpp
  391. MS3DLoader.h
  392. )
  393. ADD_ASSIMP_IMPORTER( COB
  394. COBLoader.cpp
  395. COBLoader.h
  396. COBScene.h
  397. )
  398. ADD_ASSIMP_IMPORTER( BLEND
  399. BlenderLoader.cpp
  400. BlenderLoader.h
  401. BlenderDNA.cpp
  402. BlenderDNA.h
  403. BlenderDNA.inl
  404. BlenderScene.cpp
  405. BlenderScene.h
  406. BlenderSceneGen.h
  407. BlenderIntermediate.h
  408. BlenderModifier.h
  409. BlenderModifier.cpp
  410. BlenderBMesh.h
  411. BlenderBMesh.cpp
  412. BlenderTessellator.h
  413. BlenderTessellator.cpp
  414. )
  415. ADD_ASSIMP_IMPORTER( IFC
  416. IFCLoader.cpp
  417. IFCLoader.h
  418. IFCReaderGen1.cpp
  419. IFCReaderGen2.cpp
  420. IFCReaderGen.h
  421. IFCUtil.h
  422. IFCUtil.cpp
  423. IFCGeometry.cpp
  424. IFCMaterial.cpp
  425. IFCProfile.cpp
  426. IFCCurve.cpp
  427. IFCBoolean.cpp
  428. IFCOpenings.cpp
  429. STEPFile.h
  430. STEPFileReader.h
  431. STEPFileReader.cpp
  432. STEPFileEncoding.cpp
  433. STEPFileEncoding.h
  434. )
  435. if (ASSIMP_BUILD_IFC_IMPORTER)
  436. if (MSVC)
  437. set_source_files_properties(IFCReaderGen1.cpp IFCReaderGen2.cpp PROPERTIES COMPILE_FLAGS "/bigobj")
  438. elseif(CMAKE_COMPILER_IS_MINGW)
  439. set_source_files_properties(IFCReaderGen1.cpp IFCReaderGen2.cpp PROPERTIES COMPILE_FLAGS "-O2") # Urho3D: Remove -Wa,-mbig-obj flag as some older MinGW version may not support it yet
  440. endif()
  441. endif (ASSIMP_BUILD_IFC_IMPORTER)
  442. ADD_ASSIMP_IMPORTER( XGL
  443. XGLLoader.cpp
  444. XGLLoader.h
  445. )
  446. ADD_ASSIMP_IMPORTER( FBX
  447. FBXImporter.cpp
  448. FBXCompileConfig.h
  449. FBXImporter.h
  450. FBXParser.cpp
  451. FBXParser.h
  452. FBXTokenizer.cpp
  453. FBXTokenizer.h
  454. FBXImportSettings.h
  455. FBXConverter.h
  456. FBXConverter.cpp
  457. FBXUtil.h
  458. FBXUtil.cpp
  459. FBXDocument.h
  460. FBXDocument.cpp
  461. FBXProperties.h
  462. FBXProperties.cpp
  463. FBXMeshGeometry.h
  464. FBXMeshGeometry.cpp
  465. FBXMaterial.cpp
  466. FBXModel.cpp
  467. FBXAnimation.cpp
  468. FBXNodeAttribute.cpp
  469. FBXDeformer.cpp
  470. FBXBinaryTokenizer.cpp
  471. FBXDocumentUtil.cpp
  472. )
  473. SET( PostProcessing_SRCS
  474. CalcTangentsProcess.cpp
  475. CalcTangentsProcess.h
  476. ComputeUVMappingProcess.cpp
  477. ComputeUVMappingProcess.h
  478. ConvertToLHProcess.cpp
  479. ConvertToLHProcess.h
  480. FindDegenerates.cpp
  481. FindDegenerates.h
  482. FindInstancesProcess.cpp
  483. FindInstancesProcess.h
  484. FindInvalidDataProcess.cpp
  485. FindInvalidDataProcess.h
  486. FixNormalsStep.cpp
  487. FixNormalsStep.h
  488. GenFaceNormalsProcess.cpp
  489. GenFaceNormalsProcess.h
  490. GenVertexNormalsProcess.cpp
  491. GenVertexNormalsProcess.h
  492. PretransformVertices.cpp
  493. PretransformVertices.h
  494. ImproveCacheLocality.cpp
  495. ImproveCacheLocality.h
  496. JoinVerticesProcess.cpp
  497. JoinVerticesProcess.h
  498. LimitBoneWeightsProcess.cpp
  499. LimitBoneWeightsProcess.h
  500. RemoveRedundantMaterials.cpp
  501. RemoveRedundantMaterials.h
  502. RemoveVCProcess.cpp
  503. RemoveVCProcess.h
  504. SortByPTypeProcess.cpp
  505. SortByPTypeProcess.h
  506. SplitLargeMeshes.cpp
  507. SplitLargeMeshes.h
  508. TextureTransform.cpp
  509. TextureTransform.h
  510. TriangulateProcess.cpp
  511. TriangulateProcess.h
  512. ValidateDataStructure.cpp
  513. ValidateDataStructure.h
  514. OptimizeGraph.cpp
  515. OptimizeGraph.h
  516. OptimizeMeshes.cpp
  517. OptimizeMeshes.h
  518. DeboneProcess.cpp
  519. DeboneProcess.h
  520. ProcessHelper.h
  521. ProcessHelper.cpp
  522. PolyTools.h
  523. MakeVerboseFormat.cpp
  524. MakeVerboseFormat.h
  525. )
  526. SOURCE_GROUP( PostProcessing FILES ${PostProcessing_SRCS})
  527. SET( IrrXML_SRCS irrXMLWrapper.h )
  528. SOURCE_GROUP( IrrXML FILES ${IrrXML_SRCS})
  529. ADD_ASSIMP_IMPORTER( Q3D
  530. Q3DLoader.cpp
  531. Q3DLoader.h
  532. )
  533. ADD_ASSIMP_IMPORTER( Q3BSP
  534. Q3BSPFileData.h
  535. Q3BSPFileParser.h
  536. Q3BSPFileParser.cpp
  537. Q3BSPFileImporter.h
  538. Q3BSPFileImporter.cpp
  539. Q3BSPZipArchive.h
  540. Q3BSPZipArchive.cpp
  541. )
  542. ADD_ASSIMP_IMPORTER( RAW
  543. RawLoader.cpp
  544. RawLoader.h
  545. )
  546. ADD_ASSIMP_IMPORTER( SIB
  547. SIBImporter.cpp
  548. SIBImporter.h
  549. )
  550. ADD_ASSIMP_IMPORTER( SMD
  551. SMDLoader.cpp
  552. SMDLoader.h
  553. )
  554. ADD_ASSIMP_IMPORTER( STL
  555. STLLoader.cpp
  556. STLLoader.h
  557. STLExporter.h
  558. STLExporter.cpp
  559. )
  560. ADD_ASSIMP_IMPORTER( TERRAGEN
  561. TerragenLoader.cpp
  562. TerragenLoader.h
  563. )
  564. ADD_ASSIMP_IMPORTER( 3D
  565. UnrealLoader.cpp
  566. UnrealLoader.h
  567. )
  568. ADD_ASSIMP_IMPORTER( X
  569. XFileHelper.h
  570. XFileImporter.cpp
  571. XFileImporter.h
  572. XFileParser.cpp
  573. XFileParser.h
  574. XFileExporter.h
  575. XFileExporter.cpp
  576. )
  577. ADD_ASSIMP_IMPORTER(X3D
  578. X3DExporter.cpp
  579. X3DExporter.hpp
  580. X3DImporter.cpp
  581. X3DImporter.hpp
  582. X3DImporter_Geometry2D.cpp
  583. X3DImporter_Geometry3D.cpp
  584. X3DImporter_Group.cpp
  585. X3DImporter_Light.cpp
  586. X3DImporter_Macro.hpp
  587. X3DImporter_Metadata.cpp
  588. X3DImporter_Networking.cpp
  589. X3DImporter_Node.hpp
  590. X3DImporter_Postprocess.cpp
  591. X3DImporter_Rendering.cpp
  592. X3DImporter_Shape.cpp
  593. X3DImporter_Texturing.cpp
  594. FIReader.hpp
  595. FIReader.cpp
  596. X3DVocabulary.cpp
  597. )
  598. ADD_ASSIMP_IMPORTER( GLTF
  599. glTFAsset.h
  600. glTFAsset.inl
  601. glTFAssetWriter.h
  602. glTFAssetWriter.inl
  603. glTFImporter.cpp
  604. glTFImporter.h
  605. glTFExporter.h
  606. glTFExporter.cpp
  607. glTF2Asset.h
  608. glTF2Asset.inl
  609. glTF2AssetWriter.h
  610. glTF2AssetWriter.inl
  611. glTF2Importer.cpp
  612. glTF2Importer.h
  613. glTF2Exporter.h
  614. glTF2Exporter.cpp
  615. )
  616. ADD_ASSIMP_IMPORTER( 3MF
  617. D3MFImporter.h
  618. D3MFImporter.cpp
  619. D3MFExporter.h
  620. D3MFExporter.cpp
  621. D3MFOpcPackage.h
  622. D3MFOpcPackage.cpp
  623. 3MFXmlTags.h
  624. )
  625. ADD_ASSIMP_IMPORTER( MMD
  626. MMDCpp14.h
  627. MMDImporter.cpp
  628. MMDImporter.h
  629. MMDPmdParser.h
  630. MMDPmxParser.h
  631. MMDPmxParser.cpp
  632. MMDVmdParser.h
  633. )
  634. SET( Step_SRCS
  635. StepExporter.h
  636. StepExporter.cpp
  637. )
  638. SOURCE_GROUP( Step FILES ${Step_SRCS})
  639. SET( Exporter_SRCS
  640. Exporter.cpp
  641. AssimpCExport.cpp
  642. BlobIOSystem.h
  643. )
  644. SOURCE_GROUP( Exporter FILES ${Exporter_SRCS})
  645. SET( Extra_SRCS
  646. MD4FileData.h
  647. )
  648. SOURCE_GROUP( Extra FILES ${Extra_SRCS})
  649. # Urho3D: Always build irrXML in-house
  650. SET( IrrXML_SRCS
  651. irrXMLWrapper.h
  652. ../contrib/irrXML/CXMLReaderImpl.h
  653. ../contrib/irrXML/heapsort.h
  654. ../contrib/irrXML/irrArray.h
  655. ../contrib/irrXML/irrString.h
  656. ../contrib/irrXML/irrTypes.h
  657. ../contrib/irrXML/irrXML.cpp
  658. ../contrib/irrXML/irrXML.h
  659. )
  660. SOURCE_GROUP( IrrXML FILES ${IrrXML_SRCS})
  661. SET( Clipper_SRCS
  662. ../contrib/clipper/clipper.hpp
  663. ../contrib/clipper/clipper.cpp
  664. )
  665. SOURCE_GROUP( Clipper FILES ${Clipper_SRCS})
  666. SET( Poly2Tri_SRCS
  667. ../contrib/poly2tri/poly2tri/common/shapes.cc
  668. ../contrib/poly2tri/poly2tri/common/shapes.h
  669. ../contrib/poly2tri/poly2tri/common/utils.h
  670. ../contrib/poly2tri/poly2tri/sweep/advancing_front.h
  671. ../contrib/poly2tri/poly2tri/sweep/advancing_front.cc
  672. ../contrib/poly2tri/poly2tri/sweep/cdt.cc
  673. ../contrib/poly2tri/poly2tri/sweep/cdt.h
  674. ../contrib/poly2tri/poly2tri/sweep/sweep.cc
  675. ../contrib/poly2tri/poly2tri/sweep/sweep.h
  676. ../contrib/poly2tri/poly2tri/sweep/sweep_context.cc
  677. ../contrib/poly2tri/poly2tri/sweep/sweep_context.h
  678. )
  679. SOURCE_GROUP( Poly2Tri FILES ${Poly2Tri_SRCS})
  680. SET( unzip_SRCS
  681. ../contrib/unzip/crypt.h
  682. ../contrib/unzip/ioapi.c
  683. ../contrib/unzip/ioapi.h
  684. ../contrib/unzip/unzip.c
  685. ../contrib/unzip/unzip.h
  686. )
  687. SOURCE_GROUP( unzip FILES ${unzip_SRCS})
  688. SET( ziplib_SRCS
  689. ../contrib/zip/src/miniz.h
  690. ../contrib/zip/src/zip.c
  691. ../contrib/zip/src/zip.h
  692. )
  693. SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} )
  694. # Urho3D: Always build zlib in-house
  695. SET( zlib_SRCS
  696. ../contrib/zlib/adler32.c
  697. ../contrib/zlib/compress.c
  698. ../contrib/zlib/crc32.c
  699. ../contrib/zlib/crc32.h
  700. ../contrib/zlib/deflate.c
  701. ../contrib/zlib/deflate.h
  702. ../contrib/zlib/gzclose.c
  703. ../contrib/zlib/gzguts.h
  704. ../contrib/zlib/gzlib.c
  705. ../contrib/zlib/gzread.c
  706. ../contrib/zlib/gzwrite.c
  707. ../contrib/zlib/infback.c
  708. ../contrib/zlib/inffast.c
  709. ../contrib/zlib/inffast.h
  710. ../contrib/zlib/inffixed.h
  711. ../contrib/zlib/inflate.c
  712. ../contrib/zlib/inflate.h
  713. ../contrib/zlib/inftrees.c
  714. ../contrib/zlib/inftrees.h
  715. ../contrib/zlib/trees.c
  716. ../contrib/zlib/trees.h
  717. ../contrib/zlib/uncompr.c
  718. ${CMAKE_CURRENT_BINARY_DIR}/../contrib/zlib/zconf.h
  719. ../contrib/zlib/zlib.h
  720. ../contrib/zlib/zutil.c
  721. ../contrib/zlib/zutil.h
  722. )
  723. SOURCE_GROUP( zlib FILES ${zlib_SRCS})
  724. INCLUDE_DIRECTORIES( ../contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/../contrib/zlib )
  725. SET ( openddl_parser_SRCS
  726. ../contrib/openddlparser/code/OpenDDLParser.cpp
  727. ../contrib/openddlparser/code/DDLNode.cpp
  728. ../contrib/openddlparser/code/OpenDDLCommon.cpp
  729. ../contrib/openddlparser/code/OpenDDLExport.cpp
  730. ../contrib/openddlparser/code/Value.cpp
  731. ../contrib/openddlparser/code/OpenDDLStream.cpp
  732. ../contrib/openddlparser/include/openddlparser/OpenDDLParser.h
  733. ../contrib/openddlparser/include/openddlparser/OpenDDLParserUtils.h
  734. ../contrib/openddlparser/include/openddlparser/OpenDDLCommon.h
  735. ../contrib/openddlparser/include/openddlparser/OpenDDLExport.h
  736. ../contrib/openddlparser/include/openddlparser/OpenDDLStream.h
  737. ../contrib/openddlparser/include/openddlparser/DDLNode.h
  738. ../contrib/openddlparser/include/openddlparser/Value.h
  739. )
  740. SOURCE_GROUP( openddl_parser FILES ${openddl_parser_SRCS})
  741. SET ( open3dgc_SRCS
  742. ../contrib/Open3DGC/o3dgcAdjacencyInfo.h
  743. ../contrib/Open3DGC/o3dgcArithmeticCodec.cpp
  744. ../contrib/Open3DGC/o3dgcArithmeticCodec.h
  745. ../contrib/Open3DGC/o3dgcBinaryStream.h
  746. ../contrib/Open3DGC/o3dgcCommon.h
  747. ../contrib/Open3DGC/o3dgcDVEncodeParams.h
  748. ../contrib/Open3DGC/o3dgcDynamicVectorDecoder.cpp
  749. ../contrib/Open3DGC/o3dgcDynamicVectorDecoder.h
  750. ../contrib/Open3DGC/o3dgcDynamicVectorEncoder.cpp
  751. ../contrib/Open3DGC/o3dgcDynamicVectorEncoder.h
  752. ../contrib/Open3DGC/o3dgcDynamicVector.h
  753. ../contrib/Open3DGC/o3dgcFIFO.h
  754. ../contrib/Open3DGC/o3dgcIndexedFaceSet.h
  755. ../contrib/Open3DGC/o3dgcIndexedFaceSet.inl
  756. ../contrib/Open3DGC/o3dgcSC3DMCDecoder.h
  757. ../contrib/Open3DGC/o3dgcSC3DMCDecoder.inl
  758. ../contrib/Open3DGC/o3dgcSC3DMCEncodeParams.h
  759. ../contrib/Open3DGC/o3dgcSC3DMCEncoder.h
  760. ../contrib/Open3DGC/o3dgcSC3DMCEncoder.inl
  761. ../contrib/Open3DGC/o3dgcTimer.h
  762. ../contrib/Open3DGC/o3dgcTools.cpp
  763. ../contrib/Open3DGC/o3dgcTriangleFans.cpp
  764. ../contrib/Open3DGC/o3dgcTriangleFans.h
  765. ../contrib/Open3DGC/o3dgcTriangleListDecoder.h
  766. ../contrib/Open3DGC/o3dgcTriangleListDecoder.inl
  767. ../contrib/Open3DGC/o3dgcTriangleListEncoder.h
  768. ../contrib/Open3DGC/o3dgcTriangleListEncoder.inl
  769. ../contrib/Open3DGC/o3dgcVector.h
  770. ../contrib/Open3DGC/o3dgcVector.inl
  771. )
  772. SOURCE_GROUP( open3dgc FILES ${open3dgc_SRCS})
  773. # Check dependencies for glTF importer with Open3DGC-compression.
  774. # RT-extensions is used in "contrib/Open3DGC/o3dgcTimer.h" for collecting statistics. Pointed file
  775. # has implementation for different platforms: WIN32, __MACH__ and other ("else" block).
  776. # Urho3D: Only perform the dependency search on non-MSVC build
  777. IF (NOT MSVC)
  778. FIND_PACKAGE(rt QUIET)
  779. ENDIF ()
  780. IF (RT_FOUND OR MSVC)
  781. SET( ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC 1 )
  782. ADD_DEFINITIONS( -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 )
  783. ELSE ()
  784. SET (open3dgc_SRCS "")
  785. MESSAGE (STATUS "RT-extension not found. glTF import/export will be built without Open3DGC-compression.")
  786. #!TODO: off course is better to remove statistics timers from o3dgc codec. Or propose to choose what to use.
  787. ENDIF ()
  788. INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" )
  789. INCLUDE_DIRECTORIES( "../contrib" )
  790. # VC2010 fixes
  791. if(MSVC10)
  792. option( VC10_STDINT_FIX "Fix for VC10 Compiler regarding pstdint.h redefinition errors" OFF )
  793. if( VC10_STDINT_FIX )
  794. ADD_DEFINITIONS( -D_STDINT )
  795. endif( VC10_STDINT_FIX )
  796. endif(MSVC10)
  797. if ( MSVC )
  798. ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
  799. ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
  800. endif ( MSVC )
  801. # Urho3D: Always build UNZIP in-house
  802. SET (unzip_compile_SRCS ${unzip_SRCS})
  803. INCLUDE_DIRECTORIES( "../contrib/unzip/" )
  804. # Urho3D: disable status prints
  805. #MESSAGE(STATUS "Enabled formats:${ASSIMP_IMPORTERS_ENABLED}")
  806. #MESSAGE(STATUS "Disabled formats:${ASSIMP_IMPORTERS_DISABLED}")
  807. SET( assimp_src
  808. # Assimp Files
  809. ${Core_SRCS}
  810. ${Common_SRCS}
  811. ${Logging_SRCS}
  812. ${Exporter_SRCS}
  813. ${PostProcessing_SRCS}
  814. ${MaterialSystem_SRCS}
  815. ${Step_SRCS}
  816. # Model Support
  817. ${ASSIMP_LOADER_SRCS}
  818. # Third-party libraries
  819. ${IrrXML_SRCS}
  820. ${unzip_compile_SRCS}
  821. ${Poly2Tri_SRCS}
  822. ${Clipper_SRCS}
  823. ${openddl_parser_SRCS}
  824. ${open3dgc_SRCS}
  825. ${ziplib_SRCS}
  826. ${zlib_SRCS}
  827. # Necessary to show the headers in the project when using the VC++ generator:
  828. ${PUBLIC_HEADERS}
  829. ${COMPILER_HEADERS}
  830. )
  831. ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD )
  832. INCLUDE_DIRECTORIES(
  833. ../contrib/irrXML
  834. ../contrib/openddlparser/include
  835. )
  836. IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
  837. SET( assimp_src ${assimp_src} ${C4D_SRCS})
  838. INCLUDE_DIRECTORIES(${C4D_INCLUDES})
  839. ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
  840. # Urho3D - commented out targets defined by the original CMakeLists.txt and use our own macro instead
  841. # Define target name
  842. set (TARGET_NAME Assimp)
  843. # Define source files
  844. set (SOURCE_FILES ${assimp_src})
  845. # Since we only build AssetImporter as a single-arch native tool, there is no point to build Assimp as universal binary library
  846. list (APPEND TARGET_PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH YES)
  847. # Setup target
  848. setup_library ()
  849. IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
  850. TARGET_LINK_LIBRARIES(Assimp optimized ${C4D_RELEASE_LIBRARIES})
  851. TARGET_LINK_LIBRARIES(Assimp debug ${C4D_DEBUG_LIBRARIES})
  852. TARGET_LINK_LIBRARIES(Assimp ${C4D_EXTRA_LIBRARIES})
  853. ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
  854. # Add RT-extension library for glTF importer with Open3DGC-compression.
  855. IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
  856. TARGET_LINK_LIBRARIES(Assimp ${RT_LIBRARY})
  857. ENDIF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
  858. # When performing Xcode CI build suppress all the warnings for 3rd party libraries because there are just too many of them
  859. if (XCODE AND DEFINED ENV{CI})
  860. set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
  861. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
  862. endif ()