CMakeLists.txt 17 KB

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