Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

CMakeLists.txt 3.5 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  1. #
  2. #
  3. # Copyright (c) 1991-2020 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
  4. # See LICENSE.TXT file for copying and redistribution conditions.
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; version 3 or any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU Lesser General Public License for more details.
  14. #
  15. # Contact info: www.generic-mapping-tools.org
  16. #-------------------------------------------------------------------------------
  17. # Convert PS to PNG
  18. file (GLOB _scripts_ps2png RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*.ps")
  19. set (_scripts_png)
  20. foreach (_fig ${_scripts_ps2png})
  21. string (REPLACE ".ps" ".png" _png_fig ${_fig})
  22. list (APPEND _scripts_png ${RST_BINARY_DIR}/_images/${_png_fig})
  23. add_custom_command (OUTPUT ${RST_BINARY_DIR}/_images/${_png_fig}
  24. COMMAND ${CMAKE_COMMAND} -E env
  25. GMT_SHAREDIR=${GMT_SOURCE_DIR}/share
  26. ${GMT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/src/gmt psconvert
  27. -A -P -E150 -Tg -Qg4 -Qt4
  28. -D${RST_BINARY_DIR}/_images
  29. ${CMAKE_CURRENT_SOURCE_DIR}/${_fig}
  30. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  31. DEPENDS gmt_for_img_convert _docs_rst_mkdir_images ${_fig})
  32. endforeach (_fig ${_scripts_ps2png})
  33. # Convert PS to PDF
  34. set (_scripts_ps2pdf GMT_RGBchart_a4.ps GMT_RGBchart_letter.ps GMT_RGBchart_tabloid.ps)
  35. set (_scripts_pdf)
  36. foreach (_fig ${_scripts_ps2pdf})
  37. string (REPLACE ".ps" ".pdf" _pdf_fig ${_fig})
  38. list (APPEND _scripts_pdf ${RST_BINARY_DIR}/_images/${_pdf_fig})
  39. add_custom_command (OUTPUT ${RST_BINARY_DIR}/_images/${_pdf_fig}
  40. COMMAND ${CMAKE_COMMAND} -E env
  41. GMT_SHAREDIR=${GMT_SOURCE_DIR}/share
  42. ${GMT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/src/gmt psconvert -A -P -Tf
  43. -D${RST_BINARY_DIR}/_images
  44. ${CMAKE_CURRENT_SOURCE_DIR}/${_fig}
  45. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  46. DEPENDS gmt_for_img_convert _docs_rst_mkdir_images ${_fig})
  47. endforeach (_fig ${_scripts_ps})
  48. # Convert script to verbatim txt
  49. file (GLOB _scripts_sh2txt RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*.sh")
  50. set (_scripts_txt)
  51. foreach (_script ${_scripts_sh2txt})
  52. string (REPLACE ".sh" ".txt" _txt ${_script})
  53. list (APPEND _scripts_txt ${RST_BINARY_DIR}/_verbatim/${_txt})
  54. add_custom_command (OUTPUT ${RST_BINARY_DIR}/_verbatim/${_txt}
  55. COMMAND ${GMT_BINARY_DIR}/src/script2verbatim --strip-comments --ps2pdf
  56. ${CMAKE_CURRENT_SOURCE_DIR}/${_script}
  57. ${RST_BINARY_DIR}/_verbatim/${_txt}
  58. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  59. DEPENDS script2verbatim _docs_rst_mkdir_verbatim ${CMAKE_CURRENT_SOURCE_DIR}/${_script})
  60. endforeach (_script)
  61. # Add build target
  62. add_custom_target (_docs_scripts_verbatim DEPENDS ${_scripts_txt})
  63. add_custom_target (_docs_html_scripts_fig DEPENDS ${_scripts_png} ${_scripts_pdf})
  64. add_depend_to_target (docs_depends _docs_html_scripts_fig _docs_scripts_verbatim)
  65. # run tests
  66. file (GLOB _scripts_tests RELATIVE ${CMAKE_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*.sh")
  67. # GMT_-U.sh always fails
  68. foreach (skip_test GMT_-U.sh GMT_encoding.sh gen_data_App_O.sh gen_data_dummy.sh)
  69. list (REMOVE_ITEM _scripts_tests doc/scripts/${skip_test})
  70. endforeach()
  71. if (DO_TESTS AND BASH)
  72. foreach (_job ${_scripts_tests})
  73. add_test (NAME ${_job}
  74. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  75. COMMAND ${BASH} ${CMAKE_BINARY_DIR}/test/gmtest ${_job})
  76. endforeach (_job)
  77. endif (DO_TESTS AND BASH)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...