CMakeLists.txt 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. add_library(rmlui_debugger
  2. BeaconSource.h
  3. CommonSource.h
  4. Debugger.cpp
  5. DebuggerPlugin.cpp
  6. DebuggerPlugin.h
  7. DebuggerSystemInterface.cpp
  8. DebuggerSystemInterface.h
  9. ElementContextHook.cpp
  10. ElementContextHook.h
  11. ElementDataModels.cpp
  12. ElementDataModels.h
  13. ElementDebugDocument.cpp
  14. ElementDebugDocument.h
  15. ElementInfo.cpp
  16. ElementInfo.h
  17. ElementLog.cpp
  18. ElementLog.h
  19. FontSource.h
  20. Geometry.cpp
  21. Geometry.h
  22. InfoSource.h
  23. LogSource.h
  24. MenuSource.h
  25. )
  26. set_common_target_options(rmlui_debugger)
  27. target_include_directories(rmlui_debugger PRIVATE "${PROJECT_SOURCE_DIR}/Include")
  28. target_include_directories(rmlui_debugger INTERFACE
  29. "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Include>"
  30. "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
  31. )
  32. # Add public headers as files in the project (it's not necessary but convenient for IDE integration)
  33. # Setting them as PRIVATE so that it's addition doesn't propagate, it won't affect availability since
  34. # the entire include directory has already been declared as public
  35. target_sources(rmlui_debugger PRIVATE
  36. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Debugger/Debugger.h"
  37. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Debugger/Header.h"
  38. "${PROJECT_SOURCE_DIR}/Include/RmlUi/Debugger.h"
  39. )
  40. target_link_libraries(rmlui_debugger PUBLIC rmlui_core)
  41. add_library(RmlUi::Debugger ALIAS rmlui_debugger)
  42. # Set up definitions to export functions and classes as appropriate
  43. get_target_property(rmlui_debugger_TYPE rmlui_debugger "TYPE")
  44. if(rmlui_debugger_TYPE STREQUAL "SHARED_LIBRARY")
  45. # If RmlUi debugger is being compiled as a shared library, notify code to export functions using __dllspec()
  46. # For applications consuming the library, the headers will automatically use dllimport
  47. # Platform and compiler handling is already done by code via pre-processor macros
  48. target_compile_definitions(rmlui_debugger PRIVATE "RMLUI_DEBUGGER_EXPORTS")
  49. endif()
  50. # Set additional target properties
  51. set_target_properties(rmlui_debugger PROPERTIES
  52. # Add export name so that it can be exported with a namespaced name instead
  53. # of using the name we actually used to declare the target
  54. EXPORT_NAME "Debugger"
  55. )
  56. install(TARGETS rmlui_debugger
  57. EXPORT RmlUiTargets
  58. ${RMLUI_RUNTIME_DEPENDENCY_SET_ARG}
  59. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  60. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  61. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  62. )
  63. install_target_pdb(rmlui_debugger)