2021-08-01 00:32:48 +08:00
|
|
|
set(EXAMPLES_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
function(example name)
|
|
|
|
add_executable(${name} ${name}.cpp)
|
|
|
|
target_link_libraries(${name} PUBLIC ${DIRECTORY_LIB})
|
|
|
|
file(RELATIVE_PATH dir ${EXAMPLES_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
set_property(GLOBAL APPEND PROPERTY FTXUI::EXAMPLES ${dir}/${name})
|
|
|
|
endfunction(example)
|
|
|
|
|
2019-01-03 05:33:59 +08:00
|
|
|
add_subdirectory(component)
|
|
|
|
add_subdirectory(dom)
|
2021-03-22 07:26:52 +08:00
|
|
|
|
|
|
|
if (EMSCRIPTEN)
|
2021-08-01 00:32:48 +08:00
|
|
|
get_property(EXAMPLES GLOBAL PROPERTY FTXUI::EXAMPLES)
|
2021-03-22 07:26:52 +08:00
|
|
|
foreach(file
|
|
|
|
"index.html"
|
2021-08-01 00:32:48 +08:00
|
|
|
"run_webassembly.py")
|
|
|
|
configure_file(${file} ${file})
|
2021-03-22 07:26:52 +08:00
|
|
|
endforeach(file)
|
|
|
|
endif()
|