Files
Renderive/web.cmake
T
2026-08-11 06:21:51 +08:00

54 lines
2.0 KiB
CMake

set(renderive_web_sources
"${root_dir}/web_server/Gallery_Plot_Session.cpp"
"${root_dir}/web_server/Gallery_Protocol.cpp"
"${root_dir}/web_server/Gallery_WebSocket_Controller.cpp"
"${root_dir}/web_server/Pixel_Frame.cpp"
"${root_dir}/web_server/Renderive_WebSocket_Controller.cpp"
"${root_dir}/web_server/Web_Event_Adapter.cpp"
"${root_dir}/web_server/Web_Performance_Log.cpp"
"${root_dir}/web_server/Web_Plot_Session.cpp"
"${root_dir}/web_server/Web_Server.cpp"
)
add_library(Renderive_Web STATIC ${renderive_web_sources})
target_include_directories(Renderive_Web PUBLIC "${root_dir}")
target_compile_features(Renderive_Web PUBLIC cxx_std_20)
target_compile_definitions(Renderive_Web PRIVATE NOMINMAX)
target_link_libraries(Renderive_Web PRIVATE
Renderive_Core2
Renderive_Kernel
Adminive::Nlohmann
Drogon::Drogon
spdlog::spdlog
)
add_executable(Renderive_Web_Server "${root_dir}/web_server/main.cpp")
target_compile_features(Renderive_Web_Server PRIVATE cxx_std_20)
target_link_libraries(Renderive_Web_Server PRIVATE Renderive_Web)
add_custom_target(Renderive_Web_Assets
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${root_dir}/webapp"
"${CMAKE_CURRENT_BINARY_DIR}/webapp"
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${root_dir}/webapp_gallery"
"${CMAKE_CURRENT_BINARY_DIR}/webapp_gallery"
COMMENT "Synchronizing Renderive Web assets"
)
add_dependencies(Renderive_Web_Server Renderive_Web_Assets)
add_executable(Renderive_Web_Tests EXCLUDE_FROM_ALL
"${root_dir}/Kernel/tests/main.cpp"
"${root_dir}/web_server/tests/Web_Bridge_Tests.cpp"
)
target_link_libraries(Renderive_Web_Tests PRIVATE
Renderive_Web
Adminive::Nlohmann
GTest::GTest
)
add_test(NAME Renderive_Web_Tests COMMAND Renderive_Web_Tests)
if (MSVC)
target_compile_options(Renderive_Web PRIVATE /utf-8)
target_compile_options(Renderive_Web_Server PRIVATE /utf-8)
endif ()