CMakeLists.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. # Declare RmlUi core library
  2. # Not explicitly setting library type so that it can be chosen by consumer using BUILD_SHARED_LIBS. Header files are not
  3. # necessary, but are included to improve navigation and code completion on IDEs and language servers.
  4. add_library(rmlui_core
  5. BaseXMLParser.cpp
  6. Box.cpp
  7. CallbackTexture.cpp
  8. Clock.cpp
  9. Clock.h
  10. CompiledFilterShader.cpp
  11. ComputedValues.cpp
  12. ComputeProperty.cpp
  13. ComputeProperty.h
  14. Context.cpp
  15. ContextInstancer.cpp
  16. ContextInstancerDefault.cpp
  17. ContextInstancerDefault.h
  18. ControlledLifetimeResource.h
  19. ConvolutionFilter.cpp
  20. Core.cpp
  21. DataController.cpp
  22. DataController.h
  23. DataControllerDefault.cpp
  24. DataControllerDefault.h
  25. DataExpression.cpp
  26. DataExpression.h
  27. DataModel.cpp
  28. DataModel.h
  29. DataModelHandle.cpp
  30. DataTypeRegister.cpp
  31. DataVariable.cpp
  32. DataView.cpp
  33. DataView.h
  34. DataViewDefault.cpp
  35. DataViewDefault.h
  36. Decorator.cpp
  37. DecoratorGradient.cpp
  38. DecoratorGradient.h
  39. DecoratorNinePatch.cpp
  40. DecoratorNinePatch.h
  41. DecoratorShader.cpp
  42. DecoratorShader.h
  43. DecoratorText.cpp
  44. DecoratorText.h
  45. DecoratorTiled.cpp
  46. DecoratorTiled.h
  47. DecoratorTiledBox.cpp
  48. DecoratorTiledBox.h
  49. DecoratorTiledHorizontal.cpp
  50. DecoratorTiledHorizontal.h
  51. DecoratorTiledImage.cpp
  52. DecoratorTiledImage.h
  53. DecoratorTiledVertical.cpp
  54. DecoratorTiledVertical.h
  55. DecoratorUtilities.cpp
  56. DecoratorUtilities.h
  57. DocumentHeader.cpp
  58. DocumentHeader.h
  59. EffectSpecification.cpp
  60. Element.cpp
  61. ElementAnimation.cpp
  62. ElementAnimation.h
  63. ElementBackgroundBorder.cpp
  64. ElementBackgroundBorder.h
  65. ElementDefinition.cpp
  66. ElementDefinition.h
  67. ElementDocument.cpp
  68. ElementEffects.cpp
  69. ElementEffects.h
  70. ElementHandle.cpp
  71. ElementHandle.h
  72. ElementInstancer.cpp
  73. ElementMeta.cpp
  74. ElementMeta.h
  75. ElementScroll.cpp
  76. ElementStyle.cpp
  77. ElementStyle.h
  78. ElementText.cpp
  79. ElementUtilities.cpp
  80. Event.cpp
  81. EventDispatcher.cpp
  82. EventDispatcher.h
  83. EventInstancer.cpp
  84. EventInstancerDefault.cpp
  85. EventInstancerDefault.h
  86. EventListenerInstancer.cpp
  87. EventSpecification.cpp
  88. EventSpecification.h
  89. Factory.cpp
  90. FileInterface.cpp
  91. FileInterfaceDefault.cpp
  92. FileInterfaceDefault.h
  93. Filter.cpp
  94. FilterBasic.cpp
  95. FilterBasic.h
  96. FilterBlur.cpp
  97. FilterBlur.h
  98. FilterDropShadow.cpp
  99. FilterDropShadow.h
  100. FontEffect.cpp
  101. FontEffectBlur.cpp
  102. FontEffectBlur.h
  103. FontEffectGlow.cpp
  104. FontEffectGlow.h
  105. FontEffectInstancer.cpp
  106. FontEffectOutline.cpp
  107. FontEffectOutline.h
  108. FontEffectShadow.cpp
  109. FontEffectShadow.h
  110. FontEngineInterface.cpp
  111. Geometry.cpp
  112. GeometryBackgroundBorder.cpp
  113. GeometryBackgroundBorder.h
  114. GeometryBoxShadow.cpp
  115. GeometryBoxShadow.h
  116. IdNameMap.h
  117. Log.cpp
  118. LogDefault.cpp
  119. LogDefault.h
  120. Math.cpp
  121. Memory.cpp
  122. Memory.h
  123. MeshUtilities.cpp
  124. ObserverPtr.cpp
  125. Plugin.cpp
  126. PluginRegistry.cpp
  127. PluginRegistry.h
  128. Pool.h
  129. precompiled.h
  130. Profiling.cpp
  131. PropertiesIterator.h
  132. PropertiesIteratorView.cpp
  133. Property.cpp
  134. PropertyDefinition.cpp
  135. PropertyDictionary.cpp
  136. PropertyParserAnimation.cpp
  137. PropertyParserAnimation.h
  138. PropertyParserBoxShadow.cpp
  139. PropertyParserBoxShadow.h
  140. PropertyParserColorStopList.cpp
  141. PropertyParserColorStopList.h
  142. PropertyParserColour.cpp
  143. PropertyParserColour.h
  144. PropertyParserDecorator.cpp
  145. PropertyParserDecorator.h
  146. PropertyParserFilter.cpp
  147. PropertyParserFilter.h
  148. PropertyParserFontEffect.cpp
  149. PropertyParserFontEffect.h
  150. PropertyParserKeyword.cpp
  151. PropertyParserKeyword.h
  152. PropertyParserNumber.cpp
  153. PropertyParserNumber.h
  154. PropertyParserRatio.cpp
  155. PropertyParserRatio.h
  156. PropertyParserString.cpp
  157. PropertyParserString.h
  158. PropertyParserTransform.cpp
  159. PropertyParserTransform.h
  160. PropertyShorthandDefinition.h
  161. PropertySpecification.cpp
  162. RenderInterface.cpp
  163. RenderInterfaceCompatibility.cpp
  164. RenderManager.cpp
  165. RenderManagerAccess.cpp
  166. RenderManagerAccess.h
  167. ScrollController.cpp
  168. ScrollController.h
  169. Spritesheet.cpp
  170. Stream.cpp
  171. StreamFile.cpp
  172. StreamFile.h
  173. StreamMemory.cpp
  174. StringUtilities.cpp
  175. StyleSheet.cpp
  176. StyleSheetContainer.cpp
  177. StyleSheetFactory.cpp
  178. StyleSheetFactory.h
  179. StyleSheetNode.cpp
  180. StyleSheetNode.h
  181. StyleSheetParser.cpp
  182. StyleSheetParser.h
  183. StyleSheetSelector.cpp
  184. StyleSheetSelector.h
  185. StyleSheetSpecification.cpp
  186. SystemInterface.cpp
  187. Template.cpp
  188. Template.h
  189. TemplateCache.cpp
  190. TemplateCache.h
  191. Texture.cpp
  192. TextureDatabase.cpp
  193. TextureDatabase.h
  194. TextureLayout.cpp
  195. TextureLayout.h
  196. TextureLayoutRectangle.cpp
  197. TextureLayoutRectangle.h
  198. TextureLayoutRow.cpp
  199. TextureLayoutRow.h
  200. TextureLayoutTexture.cpp
  201. TextureLayoutTexture.h
  202. Traits.cpp
  203. Transform.cpp
  204. TransformPrimitive.cpp
  205. TransformState.cpp
  206. TransformState.h
  207. TransformUtilities.cpp
  208. TransformUtilities.h
  209. Tween.cpp
  210. TypeConverter.cpp
  211. URL.cpp
  212. Variant.cpp
  213. WidgetScroll.cpp
  214. WidgetScroll.h
  215. XMLNodeHandler.cpp
  216. XMLNodeHandlerBody.cpp
  217. XMLNodeHandlerBody.h
  218. XMLNodeHandlerDefault.cpp
  219. XMLNodeHandlerDefault.h
  220. XMLNodeHandlerHead.cpp
  221. XMLNodeHandlerHead.h
  222. XMLNodeHandlerTemplate.cpp
  223. XMLNodeHandlerTemplate.h
  224. XMLParser.cpp
  225. XMLParseTools.cpp
  226. XMLParseTools.h
  227. )
  228. # Add public headers as files in the project (it's not necessary but convenient for IDE integration)
  229. # Setting them as PRIVATE so that it's addition doesn't propagate, it won't affect availability since
  230. # the entire include directory has already been declared as public
  231. target_sources(rmlui_core PRIVATE
  232. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Config/Config.h"
  233. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core.h"
  234. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/BaseXMLParser.h"
  235. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Box.h"
  236. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/CallbackTexture.h"
  237. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Colour.h"
  238. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Colour.inl"
  239. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/CompiledFilterShader.h"
  240. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ComputedValues.h"
  241. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Containers/itlib/flat_map.hpp"
  242. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Containers/itlib/flat_set.hpp"
  243. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Containers/robin_hood.h"
  244. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Context.h"
  245. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ContextInstancer.h"
  246. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ConvolutionFilter.h"
  247. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Core.h"
  248. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/DataModelHandle.h"
  249. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/DataStructHandle.h"
  250. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/DataTypeRegister.h"
  251. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/DataTypes.h"
  252. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/DataVariable.h"
  253. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Debug.h"
  254. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/DecorationTypes.h"
  255. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Decorator.h"
  256. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Dictionary.h"
  257. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/EffectSpecification.h"
  258. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Element.h"
  259. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Element.inl"
  260. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ElementDocument.h"
  261. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ElementInstancer.h"
  262. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ElementScroll.h"
  263. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Elements/ElementForm.h"
  264. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Elements/ElementFormControl.h"
  265. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Elements/ElementFormControlInput.h"
  266. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Elements/ElementFormControlSelect.h"
  267. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Elements/ElementFormControlTextArea.h"
  268. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Elements/ElementProgress.h"
  269. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Elements/ElementTabSet.h"
  270. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ElementText.h"
  271. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ElementUtilities.h"
  272. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Event.h"
  273. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/EventInstancer.h"
  274. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/EventListener.h"
  275. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/EventListenerInstancer.h"
  276. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Factory.h"
  277. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/FileInterface.h"
  278. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Filter.h"
  279. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/FontEffect.h"
  280. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/FontEffectInstancer.h"
  281. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/FontEngineInterface.h"
  282. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/FontGlyph.h"
  283. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/FontMetrics.h"
  284. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Geometry.h"
  285. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Header.h"
  286. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ID.h"
  287. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Input.h"
  288. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Log.h"
  289. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Math.h"
  290. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Matrix4.h"
  291. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Matrix4.inl"
  292. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Mesh.h"
  293. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/MeshUtilities.h"
  294. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/NumericValue.h"
  295. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ObserverPtr.h"
  296. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Platform.h"
  297. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Plugin.h"
  298. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Profiling.h"
  299. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/PropertiesIteratorView.h"
  300. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Property.h"
  301. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/PropertyDefinition.h"
  302. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/PropertyDictionary.h"
  303. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/PropertyIdSet.h"
  304. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/PropertyParser.h"
  305. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/PropertySpecification.h"
  306. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Rectangle.h"
  307. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/RenderBox.h"
  308. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/RenderInterface.h"
  309. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/RenderInterfaceCompatibility.h"
  310. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/RenderManager.h"
  311. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ScriptInterface.h"
  312. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ScrollTypes.h"
  313. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Span.h"
  314. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Spritesheet.h"
  315. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/StableVector.h"
  316. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Stream.h"
  317. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/StreamMemory.h"
  318. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/StringUtilities.h"
  319. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/StyleSheet.h"
  320. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/StyleSheetContainer.h"
  321. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/StyleSheetSpecification.h"
  322. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/StyleSheetTypes.h"
  323. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/StyleTypes.h"
  324. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/SystemInterface.h"
  325. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/TextInputContext.h"
  326. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/TextInputHandler.h"
  327. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/TextShapingContext.h"
  328. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Texture.h"
  329. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Traits.h"
  330. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Transform.h"
  331. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/TransformPrimitive.h"
  332. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Tween.h"
  333. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/TypeConverter.h"
  334. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/TypeConverter.inl"
  335. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Types.h"
  336. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/UniqueRenderResource.h"
  337. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Unit.h"
  338. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/URL.h"
  339. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Utilities.h"
  340. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Variant.h"
  341. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Variant.inl"
  342. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Vector2.h"
  343. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Vector2.inl"
  344. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Vector3.h"
  345. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Vector3.inl"
  346. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Vector4.h"
  347. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Vector4.inl"
  348. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Vertex.h"
  349. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/XMLNodeHandler.h"
  350. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/XMLParser.h"
  351. )
  352. set_common_target_options(rmlui_core)
  353. target_include_directories(rmlui_core PRIVATE "${PROJECT_SOURCE_DIR}/Include")
  354. target_include_directories(rmlui_core INTERFACE
  355. "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Include>"
  356. "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
  357. )
  358. add_library(RmlUi::Core ALIAS rmlui_core)
  359. set_target_properties(rmlui_core PROPERTIES
  360. # Add export name so that it can be exported with a namespaced name instead
  361. # of using the name we actually used to declare the target
  362. EXPORT_NAME "Core"
  363. # Change output name of the final library file
  364. OUTPUT_NAME "rmlui"
  365. )
  366. generate_rmlui_version_string()
  367. target_compile_definitions(rmlui_core PRIVATE "RMLUI_VERSION=\"${RMLUI_VERSION_SHORT}\"")
  368. add_subdirectory("Elements")
  369. add_subdirectory("Layout")
  370. # Set up definitions to export functions and classes as appropriate
  371. get_target_property(rmlui_core_TYPE rmlui_core "TYPE")
  372. if(rmlui_core_TYPE STREQUAL "STATIC_LIBRARY")
  373. # If RmlUi is being compiled as a static library, notify code to disable usage of __dllspec()
  374. # Since public headers also detect it, it needs to be a public definition
  375. target_compile_definitions(rmlui_core PUBLIC "RMLUI_STATIC_LIB")
  376. elseif(rmlui_core_TYPE STREQUAL "SHARED_LIBRARY")
  377. # If RmlUi is being compiled as a shared library, notify code to export functions using __dllspec()
  378. # For applications consuming the library, the headers will automatically use dllimport
  379. # Platform and compiler handling is already done by code via pre-processor macros
  380. target_compile_definitions(rmlui_core PRIVATE "RMLUI_CORE_EXPORTS")
  381. endif()
  382. unset(rmlui_core_TYPE)
  383. if(RMLUI_FONT_ENGINE STREQUAL "freetype")
  384. # Include the source files for the default font engine.
  385. add_subdirectory("FontEngineDefault")
  386. # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE:
  387. # From CMake 3.13 the next line can be moved into `FontEngineDefault/CMakeLists.txt`, see CMP0079.
  388. target_link_libraries(rmlui_core PRIVATE Freetype::Freetype)
  389. endif()
  390. if(RMLUI_LOTTIE_PLUGIN)
  391. # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE:
  392. # From CMake 3.13 we could move this to `Lottie/CMakeLists.txt`, see CMP0079.
  393. target_link_libraries(rmlui_core PRIVATE rlottie::rlottie)
  394. endif()
  395. if(RMLUI_SVG_PLUGIN)
  396. # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE:
  397. # From CMake 3.13 we could move this to `Lottie/CMakeLists.txt`, see CMP0079.
  398. target_link_libraries(rmlui_core PRIVATE lunasvg::lunasvg)
  399. endif()
  400. if(RMLUI_TRACY_PROFILING)
  401. if(CMAKE_CONFIGURATION_TYPES AND RMLUI_TRACY_CONFIGURATION)
  402. target_link_libraries(rmlui_core PUBLIC "$<$<CONFIG:Tracy>:Tracy::TracyClient>")
  403. target_compile_definitions(rmlui_core PUBLIC "$<$<CONFIG:Tracy>:RMLUI_TRACY_PROFILING>")
  404. if(RMLUI_TRACY_MEMORY_PROFILING)
  405. target_compile_definitions(rmlui_core PRIVATE "$<$<CONFIG:Tracy>:RMLUI_TRACY_MEMORY_PROFILING>")
  406. endif()
  407. message(STATUS "Tracy profiling enabled in configuration `Tracy`.")
  408. else()
  409. target_link_libraries(rmlui_core PUBLIC Tracy::TracyClient)
  410. target_compile_definitions(rmlui_core PUBLIC "RMLUI_TRACY_PROFILING")
  411. if(RMLUI_TRACY_MEMORY_PROFILING)
  412. target_compile_definitions(rmlui_core PRIVATE "RMLUI_TRACY_MEMORY_PROFILING")
  413. endif()
  414. message(STATUS "Tracy profiling enabled.")
  415. endif()
  416. endif()
  417. if(NOT RMLUI_THIRDPARTY_CONTAINERS)
  418. target_compile_definitions(rmlui_core PUBLIC "RMLUI_NO_THIRDPARTY_CONTAINERS")
  419. message(STATUS "Disabling third-party containers for RmlUi.")
  420. endif()
  421. if(RMLUI_CUSTOM_RTTI)
  422. target_compile_definitions(rmlui_core PUBLIC "RMLUI_CUSTOM_RTTI")
  423. message(STATUS "Enabling custom RTTI for RmlUi.")
  424. endif()
  425. if(RMLUI_MATRIX_ROW_MAJOR)
  426. target_compile_definitions(rmlui_core PUBLIC "RMLUI_MATRIX_ROW_MAJOR")
  427. message(STATUS "Configuring RmlUi to use row-major matrix types.")
  428. endif()
  429. # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE:
  430. # From CMake 3.16 we can skip the version check.
  431. if(RMLUI_PRECOMPILED_HEADERS AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.16")
  432. target_precompile_headers(rmlui_core PRIVATE "${PROJECT_SOURCE_DIR}/Source/Core/precompiled.h")
  433. elseif(RMLUI_PRECOMPILED_HEADERS)
  434. message(STATUS "Could not enable precompiled headers, requires CMake version 3.16 or greater.")
  435. endif()
  436. if(RMLUI_CUSTOM_CONFIGURATION AND RMLUI_CUSTOM_CONFIGURATION_FILE)
  437. target_compile_definitions(rmlui_core PUBLIC "RMLUI_CUSTOM_CONFIGURATION_FILE=\"${RMLUI_CUSTOM_CONFIGURATION_FILE}\"")
  438. message(STATUS "Including ${RMLUI_CUSTOM_CONFIGURATION_FILE} instead of <RmlUi/Config/Config.h>")
  439. endif()
  440. if(RMLUI_CUSTOM_CONFIGURATION AND RMLUI_CUSTOM_INCLUDE_DIRS)
  441. target_include_directories(rmlui_core PUBLIC ${RMLUI_CUSTOM_INCLUDE_DIRS})
  442. endif()
  443. if(RMLUI_CUSTOM_CONFIGURATION AND RMLUI_CUSTOM_LINK_LIBRARIES)
  444. target_link_libraries(rmlui_core PUBLIC ${RMLUI_CUSTOM_LINK_LIBRARIES})
  445. endif()
  446. # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE:
  447. # We use default paths provided from GNUInstallDirs. From CMake 3.14 these paths (CMAKE_INSTALL_...) will be used
  448. # automatically and can be removed from the following call. The same applies to many other calls to install(TARGETS...).
  449. # Note that GNUInstallDirs should still be included in the project root.
  450. install(TARGETS rmlui_core
  451. EXPORT RmlUiTargets
  452. ${RMLUI_RUNTIME_DEPENDENCY_SET_ARG}
  453. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  454. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  455. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  456. )
  457. install_target_pdb(rmlui_core)