1 2 3add_custom_command(OUTPUT tikz-uml.sty 4 COMMAND wget http://perso.ensta-paristech.fr/~kielbasi/tikzuml/var/files/src/tikzuml-v1.0-2016-03-29.tbz 5 COMMAND tar xf tikzuml-v1.0-2016-03-29.tbz 6 COMMAND mv tikzuml-v1.0-2016-03-29/tikz-uml.sty tikz-uml.sty 7 ) 8add_custom_command(OUTPUT header.tex footer.tex 9 COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/common-header.tex header.tex 10 COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/common-footer.tex footer.tex 11 DEPENDS 12 ${CMAKE_CURRENT_SOURCE_DIR}/common-header.tex 13 ${CMAKE_CURRENT_SOURCE_DIR}/common-footer.tex 14 ) 15 16set(LATEX_SOURCES 17bar_handler.tex 18bind.tex 19bind_instance.tex 20cached_greeter.tex 21cached_greeter_test.tex 22car_component.tex 23checked_adder.tex 24checked_incrementer.tex 25component_composition.tex 26component_dep_loop.tex 27foo_handler.tex 28greeter.tex 29incrementer.tex 30incrementer_component.tex 31inject_macro.tex 32inject_macro_no_args.tex 33inject_macro_template.tex 34inject_typedef_greeter.tex 35inject_typedef_writer.tex 36inject_typedef_writer2.tex 37inject_typedef_templated_constructor.tex 38multiplier.tex 39parametrized_component.tex 40provider.tex 41provider_functor.tex 42register_constructor.tex 43register_constructor_component.tex 44register_factory.tex 45register_factory_use.tex 46register_factory_macro.tex 47request_dispatcher.tex 48request_injector.tex 49scaler.tex 50server.tex 51simple_greeter.tex 52simple_incrementer.tex 53simple_adder.tex 54templated_component.tex 55) 56 57foreach(S ${LATEX_SOURCES}) 58 string(REPLACE ".tex" "" N ${S}) 59 add_custom_command(OUTPUT ${N}.png 60 COMMAND pdflatex -halt-on-error ${CMAKE_CURRENT_SOURCE_DIR}/${N}.tex 61 COMMAND convert -density 300 -trim ${N}.pdf -quality 100 -sharpen 0x1.0 ${N}.png 62 # This normalizes the PNG files, so that we avoid tracking multiple copies of the same file in the Github wiki repo. 63 COMMAND exiftool -all= -overwrite_original ${N}.png 64 DEPENDS 65 tikz-uml.sty 66 header.tex 67 footer.tex 68 ${N}.tex 69 ) 70 add_custom_target(${N}-png ALL 71 DEPENDS ${N}.png) 72endforeach(S) 73 74set(EXAMPLE_DIRECTORIES 75hello_world 76server 77scaling_doubles 78multibindings 79simple_injection 80) 81 82foreach(D ${EXAMPLE_DIRECTORIES}) 83 add_custom_command(OUTPUT ${D}-deps.png 84 COMMAND bash < ${CMAKE_CURRENT_SOURCE_DIR}/extract_dependencies.sh > ${CMAKE_CURRENT_BINARY_DIR}/${D}.dot 85 COMMAND dot -Goverlap=prism10000 ${CMAKE_CURRENT_BINARY_DIR}/${D}.dot -Tpng -o ${CMAKE_CURRENT_BINARY_DIR}/${D}-deps.png 86 # This normalizes the PNG files, so that we avoid tracking multiple copies of the same file in the Github wiki repo. 87 COMMAND exiftool -all= -overwrite_original ${CMAKE_CURRENT_BINARY_DIR}/${D}-deps.png 88 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../examples/${D} 89 DEPENDS 90 ../../examples/${D} 91 extract_dependencies.sh 92 ) 93 add_custom_target(${D}-deps ALL 94 DEPENDS ${D}-deps.png) 95endforeach(D) 96 97