Files
FTXUI/examples/CMakeLists.txt
ArthurSonzogni bfd07ba309 Example. Add missing file.
The file "sw.js" was removed mistakenly

Fixed: https://github.com/ArthurSonzogni/FTXUI/issues/1098
2025-08-18 20:50:31 +02:00

29 lines
773 B
CMake

if(NOT FTXUI_BUILD_EXAMPLES)
return()
endif()
set(EXAMPLES_DIR ${CMAKE_CURRENT_SOURCE_DIR})
function(example name)
add_executable(ftxui_example_${name} ${name}.cpp)
target_link_libraries(ftxui_example_${name} PUBLIC ${DIRECTORY_LIB})
file(RELATIVE_PATH dir ${EXAMPLES_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set_property(GLOBAL APPEND PROPERTY FTXUI::EXAMPLES ${dir}/${name})
target_compile_features(ftxui_example_${name} PRIVATE cxx_std_20)
endfunction(example)
add_subdirectory(component)
add_subdirectory(dom)
if (EMSCRIPTEN)
get_property(EXAMPLES GLOBAL PROPERTY FTXUI::EXAMPLES)
foreach(file
"index.css"
"index.html"
"index.mjs"
"run_webassembly.py"
"sw.js"
)
configure_file(${file} ${file})
endforeach(file)
endif()