CMakeLists.txt 17 KB

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