]> www.ginac.de Git - ginac.git/blob - doc/tutorial/CMakeLists.txt
[build] GiNaC can be built with CMake now.
[ginac.git] / doc / tutorial / CMakeLists.txt
1 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.texi.cmake
2                ${CMAKE_CURRENT_BINARY_DIR}/version.texi @ONLY)
3
4 set(_ginac_tutorial_figures classhierarchy repnaive reppair repreal)
5 set(_ginac_tutorial_figures_pdf)
6 set(_ginac_tutorial_figures_png)
7 set(_ginac_tutorial_figures_eps)
8
9 macro(add_xfig_figure thename)
10         set(${thename}_XFIG ${CMAKE_CURRENT_SOURCE_DIR}/${thename}.fig)
11         set(${thename}_PDF ${CMAKE_CURRENT_BINARY_DIR}/${thename}.pdf)
12         set(${thename}_EPS ${CMAKE_CURRENT_BINARY_DIR}/${thename}.eps)
13         set(${thename}_PNG ${CMAKE_CURRENT_BINARY_DIR}/${thename}.png)
14         list(APPEND _ginac_tutorial_figures_pdf ${${thename}_PDF})
15         list(APPEND _ginac_tutorial_figures_png ${${thename}_PNG})
16         list(APPEND _ginac_tutorial_figures_png ${${thename}_EPS})
17         add_custom_command(
18                 OUTPUT ${${thename}_PDF}
19                 COMMAND ${FIG2DEV} -L pdf -m 0.9 ${${thename}_XFIG} ${${thename}_PDF}
20                 DEPENDS ${${thename}_XFIG}
21                 COMMENT "FIG2DEV ${thename}.xfig ==> ${thename}.pdf"
22                 VERBATIM)
23         add_custom_command(
24                 OUTPUT ${${thename}_EPS}
25                 COMMAND ${FIG2DEV} -L eps -m 0.9 ${${thename}_XFIG} ${${thename}_EPS}
26                 DEPENDS ${${thename}_XFIG}
27                 COMMENT "FIG2DEV ${thename}.xfig ==> ${thename}.eps"
28                 VERBATIM)
29         add_custom_command(
30                 OUTPUT ${${thename}_PNG}
31                 COMMAND ${FIG2DEV} -L png -m 0.9 ${${thename}_XFIG} ${${thename}_PNG}
32                 DEPENDS ${${thename}_XFIG}
33                 COMMENT "FIG2DEV ${thename}.xfig ==> ${thename}.png"
34                 VERBATIM)
35 endmacro()
36
37 macro(add_doc_format src fmt)
38         set(_out ${CMAKE_CURRENT_BINARY_DIR}/${src}.${fmt})
39         set(_src ${CMAKE_CURRENT_SOURCE_DIR}/${src}.texi)
40         add_custom_command(
41                 OUTPUT ${_out}
42                 COMMAND ${TEXI2DVI} --${fmt} --batch -o ${_out} ${_src}
43                 DEPENDS ${_src} ${_${src}_tutorial_figures_${fmt}}
44                 COMMENT "TEXI2DVI ${src}.texi => ${src}.${fmt}"
45                 VERBATIM)
46         add_custom_target(${fmt}_${src}_tutorial DEPENDS ${_out})
47         add_dependencies(${fmt} ${fmt}_${src}_tutorial)
48 endmacro()
49
50 if (TEXI2DVI AND FIG2DEV)
51         foreach(_f ${_ginac_tutorial_figures})
52                 add_xfig_figure(${_f})
53         endforeach()
54         set(ginac_HTML_EXTRA_DEPS ${_ginac_tutorial_figures_png})
55         add_doc_format(ginac pdf)
56 endif()
57
58 add_info_file(ginac)
59