CMakeLists.txt (1877B)
1 set(GENERATE_OUT "${CMAKE_BINARY_DIR}/bin") 2 3 configure_file(demo_menu.conf ${GENERATE_OUT}/demo_menu.conf COPYONLY) 4 5 add_custom_command( 6 OUTPUT ${GENERATE_OUT}/demo_menu.hpp ${GENERATE_OUT}/demo_menu.cpp 7 COMMAND ${GENERATE_OUT}/stamen-generate --user -d test_display --cpp ${GENERATE_OUT}/demo_menu.conf 8 DEPENDS demo_menu.conf stamen-generate 9 COMMENT "Generating menu files" 10 ) 11 12 add_executable(demo main.cpp ${GENERATE_OUT}/demo_menu.cpp) 13 # target_link_libraries(demo stamen) - no need to link 14 target_include_directories(demo PRIVATE ../include) 15 set_target_properties(demo PROPERTIES LINKER_LANGUAGE CXX) 16 target_include_directories(demo PRIVATE ${GENERATE_OUT} ${CMAKE_CURRENT_SOURCE_DIR}) 17 18 set_target_properties(demo PROPERTIES 19 VERSION ${PROJECT_VERSION} 20 SOVERSION ${PROJECT_VERSION_MAJOR} 21 RUNTIME_OUTPUT_DIRECTORY "${GENERATE_OUT}" 22 ) 23 24 add_custom_command( 25 OUTPUT ${GENERATE_OUT}/demo_menu.h ${GENERATE_OUT}/demo_menu.c 26 COMMAND ${GENERATE_OUT}/stamen-generate --user --c ${GENERATE_OUT}/demo_menu.conf 27 DEPENDS demo_menu.conf stamen-generate 28 COMMENT "Generating cmenu files" 29 ) 30 31 add_executable(cdemo main.c ${GENERATE_OUT}/demo_menu.c) 32 target_link_libraries(cdemo stamen) 33 set_target_properties(cdemo PROPERTIES LINKER_LANGUAGE C) 34 target_include_directories(cdemo PRIVATE ${GENERATE_OUT} ${CMAKE_CURRENT_SOURCE_DIR}) 35 36 set_target_properties(cdemo PROPERTIES 37 VERSION ${PROJECT_VERSION} 38 SOVERSION ${PROJECT_VERSION_MAJOR} 39 RUNTIME_OUTPUT_DIRECTORY "${GENERATE_OUT}" 40 ) 41 42 add_executable(dynamic dynamic.cpp) 43 target_link_libraries(dynamic stamen) 44 target_include_directories(dynamic PRIVATE ../include) 45 set_target_properties(dynamic PROPERTIES LINKER_LANGUAGE CXX) 46 47 set_target_properties(dynamic PROPERTIES 48 VERSION ${PROJECT_VERSION} 49 SOVERSION ${PROJECT_VERSION_MAJOR} 50 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" 51 )