1 2 3 add_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 ) 8 add_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 16 set(LATEX_SOURCES 17 bar_handler.tex 18 bind.tex 19 bind_instance.tex 20 cached_greeter.tex 21 cached_greeter_test.tex 22 car_component.tex 23 checked_adder.tex 24 checked_incrementer.tex 25 component_composition.tex 26 component_dep_loop.tex 27 foo_handler.tex 28 greeter.tex 29 incrementer.tex 30 incrementer_component.tex 31 inject_macro.tex 32 inject_macro_no_args.tex 33 inject_macro_template.tex 34 inject_typedef_greeter.tex 35 inject_typedef_writer.tex 36 inject_typedef_writer2.tex 37 inject_typedef_templated_constructor.tex 38 multiplier.tex 39 parametrized_component.tex 40 provider.tex 41 provider_functor.tex 42 register_constructor.tex 43 register_constructor_component.tex 44 register_factory.tex 45 register_factory_use.tex 46 register_factory_macro.tex 47 request_dispatcher.tex 48 request_injector.tex 49 scaler.tex 50 server.tex 51 simple_greeter.tex 52 simple_incrementer.tex 53 simple_adder.tex 54 templated_component.tex 55 ) 56 57 foreach(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) 72 endforeach(S) 73 74 set(EXAMPLE_DIRECTORIES 75 hello_world 76 server 77 scaling_doubles 78 multibindings 79 simple_injection 80 ) 81 82 foreach(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) 95 endforeach(D) 96 97