CMakeLists.txt 17 KB

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