CMakeLists.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. add_library(document SHARED)
  2. add_library(nodes SHARED)
  3. option(BUILD_NODES "Whether to build actual nodes (useful to turn off to just run basic tests)" ON)
  4. option(NODES_SCU "Use single compilation unit for nodes (speeds up one time build if you have enough RAM)" OFF)
  5. target_sources(document
  6. PRIVATE
  7. context.cpp
  8. document.cpp
  9. instance.cpp
  10. color.cpp
  11. shading.cpp
  12. action.cpp
  13. action_stack.cpp
  14. node_tree.cpp
  15. node/abstract_node.cpp
  16. )
  17. set(ALL_NODES
  18. nodes/frame.cpp
  19. nodes/animated.cpp
  20. nodes/frame_list.cpp
  21. nodes/interpolate.cpp
  22. nodes/operators.cpp
  23. nodes/time.cpp
  24. nodes/time_list.cpp
  25. nodes/time_period.cpp
  26. nodes/dynamic_node.cpp
  27. nodes/morph.cpp
  28. nodes/format_string.cpp
  29. nodes/format_number.cpp
  30. nodes/color.cpp
  31. nodes/color_mix.cpp
  32. nodes/follow_path.cpp
  33. nodes/path_xy.cpp
  34. nodes/extract_coord.cpp
  35. nodes/point_xy.cpp
  36. nodes/knot.cpp
  37. nodes/knot_list.cpp
  38. nodes/shading.cpp
  39. nodes/linear.cpp
  40. nodes/truncate.cpp
  41. nodes/to_string.cpp
  42. nodes/color_string.cpp
  43. nodes/file_string.cpp
  44. nodes/average.cpp
  45. nodes/math.cpp
  46. nodes/boolean.cpp
  47. nodes/rectangle.cpp
  48. nodes/circle.cpp
  49. nodes/list.cpp
  50. nodes/compare.cpp
  51. nodes/conditional.cpp
  52. nodes/split_string.cpp
  53. nodes/random.cpp
  54. nodes/audio.cpp
  55. nodes/translate.cpp
  56. nodes/scale.cpp
  57. nodes/rotate.cpp
  58. nodes/renderable/empty.cpp
  59. nodes/renderable/composite.cpp
  60. nodes/renderable/image.cpp
  61. nodes/renderable/transform.cpp
  62. nodes/renderable/text.cpp
  63. nodes/renderable/render_shape.cpp
  64. )
  65. function(make_single_compile_unit fname file_list)
  66. set(content "// single compilation unit auto-generated by cmake\n")
  67. foreach (f ${file_list})
  68. string(APPEND content "#include \"${CMAKE_CURRENT_LIST_DIR}/${f}\"\n")
  69. endforeach()
  70. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${fname} ${content})
  71. endfunction()
  72. if (BUILD_NODES)
  73. if (NODES_SCU)
  74. make_single_compile_unit(all_nodes.cpp "${ALL_NODES}")
  75. target_sources(nodes PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/all_nodes.cpp)
  76. else()
  77. target_sources(nodes PRIVATE ${ALL_NODES})
  78. endif()
  79. endif()
  80. target_link_libraries(document log morphing fmt)
  81. target_link_libraries(nodes document)
  82. install(
  83. TARGETS document nodes
  84. EXPORT rainynite_core
  85. LIBRARY DESTINATION lib/rainynite/
  86. ARCHIVE DESTINATION lib/rainynite/
  87. )