mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
client
add wasm options
This commit is contained in:
+23
-21
@@ -7,12 +7,10 @@ add_subdirectory(qwt)
|
|||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
file(GLOB_RECURSE ui "ui/*.[hc]pp")
|
file(GLOB_RECURSE ui "ui/*")
|
||||||
file(GLOB_RECURSE ui_ui "ui/*.ui")
|
|
||||||
|
|
||||||
set(PROJECT_SOURCES
|
set(PROJECT_SOURCES
|
||||||
${ui}
|
${ui}
|
||||||
${ui_ui}
|
|
||||||
helpers.cpp
|
helpers.cpp
|
||||||
helpers.hpp
|
helpers.hpp
|
||||||
IterableEnum.hpp
|
IterableEnum.hpp
|
||||||
@@ -29,31 +27,35 @@ set(PROJECT_SOURCES
|
|||||||
web_socket_wrapper.hpp
|
web_socket_wrapper.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
file(GLOB_RECURSE sims "simulators/*.cpp")
|
if (NOT EMSCRIPTEN)
|
||||||
|
file(GLOB_RECURSE sims "simulators/*.cpp")
|
||||||
|
# Loop through each .cpp file and create a library for it
|
||||||
|
foreach(sim ${sims})
|
||||||
|
# Extract the base name of the file (without the directory and extension)
|
||||||
|
get_filename_component(LIB_NAME ${sim} NAME_WE)
|
||||||
|
|
||||||
# Loop through each .cpp file and create a library for it
|
# Create a library for each .cpp file
|
||||||
foreach(sim ${sims})
|
add_library(ui_${LIB_NAME} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/simulators/${LIB_NAME}.hpp ${CMAKE_CURRENT_SOURCE_DIR}/simulators/${LIB_NAME}.cpp ${CMAKE_CURRENT_SOURCE_DIR}/simulators/${LIB_NAME}.ui)
|
||||||
# Extract the base name of the file (without the directory and extension)
|
target_link_libraries(ui_${LIB_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets magic_enum::magic_enum nlohmann_json::nlohmann_json)
|
||||||
get_filename_component(LIB_NAME ${sim} NAME_WE)
|
target_include_directories(ui_${LIB_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/ui ${CMAKE_SOURCE_DIR}/external/qwt/src ${CMAKE_SOURCE_DIR}/external/spdlog/include ${PROJECT_BINARY_DIR}/)
|
||||||
|
|
||||||
# Create a library for each .cpp file
|
set_target_properties(
|
||||||
add_library(ui_${LIB_NAME} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/simulators/${LIB_NAME}.hpp ${CMAKE_CURRENT_SOURCE_DIR}/simulators/${LIB_NAME}.cpp ${CMAKE_CURRENT_SOURCE_DIR}/simulators/${LIB_NAME}.ui)
|
ui_${LIB_NAME}
|
||||||
target_link_libraries(ui_${LIB_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets magic_enum::magic_enum nlohmann_json::nlohmann_json)
|
PROPERTIES
|
||||||
target_include_directories(ui_${LIB_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/ui ${CMAKE_SOURCE_DIR}/external/qwt/src ${CMAKE_SOURCE_DIR}/external/spdlog/include ${PROJECT_BINARY_DIR}/)
|
AUTOUIC ON
|
||||||
|
AUTOMOC ON
|
||||||
set_target_properties(
|
AUTORCC ON
|
||||||
ui_${LIB_NAME}
|
)
|
||||||
PROPERTIES
|
endforeach()
|
||||||
AUTOUIC ON
|
else()
|
||||||
AUTOMOC ON
|
file(GLOB_RECURSE sims "simulators/*")
|
||||||
AUTORCC ON
|
endif()
|
||||||
)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||||
qt_add_executable(Simulator-CVS_I10
|
qt_add_executable(Simulator-CVS_I10
|
||||||
MANUAL_FINALIZATION
|
MANUAL_FINALIZATION
|
||||||
${PROJECT_SOURCES}
|
${PROJECT_SOURCES}
|
||||||
|
$<$<BOOL:${EMSCRIPTEN}>:${sims}>
|
||||||
)
|
)
|
||||||
# Define target properties for Android with Qt 6 as:
|
# Define target properties for Android with Qt 6 as:
|
||||||
# set_property(TARGET Simulator - CVS_I10 APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
# set_property(TARGET Simulator - CVS_I10 APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
||||||
|
|||||||
Reference in New Issue
Block a user