CMakeLists.txt 2.3 KB

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