stamen

Static Menu Generator
git clone git://git.dimitrijedobrota.com/stamen.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |

CMakeLists.txt (1135B)


1 cmake_minimum_required(VERSION 3.14) 2 3 project(stamenExamples CXX) 4 5 include(../cmake/project-is-top-level.cmake) 6 include(../cmake/folders.cmake) 7 if(PROJECT_IS_TOP_LEVEL) 8 find_package(stamen REQUIRED) 9 endif() 10 11 configure_file(demo_menu.conf demo_menu.conf COPYONLY) 12 13 add_custom_target(run-examples) 14 15 add_custom_command( 16 OUTPUT demo_menu.hpp demo_menu.cpp 17 COMMAND stamen::exe --namespace example demo_menu.conf 18 DEPENDS demo_menu.conf stamen::exe 19 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" 20 COMMENT "Generating menu files" 21 ) 22 23 function(add_example NAME EXT) 24 add_executable("${NAME}" "${NAME}.${EXT}") 25 target_include_directories("${NAME}" PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") 26 target_link_libraries("${NAME}" PRIVATE stamen::stamen) 27 target_compile_features("${NAME}" PRIVATE cxx_std_20) 28 add_custom_target("run_${NAME}" COMMAND "${NAME}" demo_menu.conf VERBATIM) 29 add_dependencies("run_${NAME}" "${NAME}") 30 add_dependencies(run-examples "run_${NAME}") 31 endfunction() 32 33 add_example(static cpp) 34 target_sources(static PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/demo_menu.cpp") 35 36 add_example(dynamic cpp) 37 38 add_folders(Example)