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.9 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
84
85
86
87
88
89
90
  1. #
  2. #
  3. # Copyright (c) 1991-2021 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. if (SPHINX_FOUND)
  18. # Convert PS to PNG
  19. file (GLOB _scripts_ps2png RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*.ps")
  20. set (_scripts_png)
  21. foreach (_fig ${_scripts_ps2png})
  22. string (REPLACE ".ps" ".png" _png_fig ${_fig})
  23. list (APPEND _scripts_png ${RST_BINARY_DIR}/_images/${_png_fig})
  24. add_custom_command (OUTPUT ${RST_BINARY_DIR}/_images/${_png_fig}
  25. COMMAND ${CMAKE_COMMAND} -E env
  26. GMT_SHAREDIR=${GMT_SOURCE_DIR}/share
  27. ${GMT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/src/gmt psconvert
  28. -A -P -E150 -Tg -Qg4 -Qt4
  29. -D${RST_BINARY_DIR}/_images
  30. ${CMAKE_CURRENT_SOURCE_DIR}/${_fig}
  31. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  32. DEPENDS gmt_for_img_convert _docs_rst_mkdir_images ${_fig})
  33. endforeach (_fig ${_scripts_ps2png})
  34. # Convert PS to PDF
  35. set (_scripts_ps2pdf GMT_RGBchart_a4.ps GMT_RGBchart_letter.ps GMT_RGBchart_tabloid.ps GMT_App_F_stand+_iso+.ps GMT_App_F_symbol_dingbats.ps)
  36. set (_scripts_pdf)
  37. foreach (_fig ${_scripts_ps2pdf})
  38. string (REPLACE ".ps" ".pdf" _pdf_fig ${_fig})
  39. list (APPEND _scripts_pdf ${RST_BINARY_DIR}/_images/${_pdf_fig})
  40. add_custom_command (OUTPUT ${RST_BINARY_DIR}/_images/${_pdf_fig}
  41. COMMAND ${CMAKE_COMMAND} -E env
  42. GMT_SHAREDIR=${GMT_SOURCE_DIR}/share
  43. ${GMT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/src/gmt psconvert -A -P -Tf
  44. -D${RST_BINARY_DIR}/_images
  45. ${CMAKE_CURRENT_SOURCE_DIR}/${_fig}
  46. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  47. DEPENDS gmt_for_img_convert _docs_rst_mkdir_images ${_fig})
  48. endforeach (_fig ${_scripts_ps})
  49. # Convert script to verbatim txt
  50. file (GLOB _scripts_sh2txt RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*.sh")
  51. set (_scripts_txt)
  52. foreach (_script ${_scripts_sh2txt})
  53. string (REPLACE ".sh" ".txt" _txt ${_script})
  54. list (APPEND _scripts_txt ${RST_BINARY_DIR}/_verbatim/${_txt})
  55. add_custom_command (OUTPUT ${RST_BINARY_DIR}/_verbatim/${_txt}
  56. COMMAND ${GMT_BINARY_DIR}/src/script2verbatim --strip-comments --ps2pdf
  57. ${CMAKE_CURRENT_SOURCE_DIR}/${_script}
  58. ${RST_BINARY_DIR}/_verbatim/${_txt}
  59. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  60. DEPENDS script2verbatim _docs_rst_mkdir_verbatim ${CMAKE_CURRENT_SOURCE_DIR}/${_script})
  61. endforeach (_script)
  62. # Add build target
  63. add_custom_target (_docs_scripts_verbatim DEPENDS ${_scripts_txt})
  64. add_custom_target (_docs_html_scripts_fig DEPENDS ${_scripts_png} ${_scripts_pdf})
  65. add_depend_to_target (docs_depends _docs_html_scripts_fig _docs_scripts_verbatim)
  66. endif (SPHINX_FOUND)
  67. # run tests
  68. file (GLOB _scripts_tests RELATIVE ${CMAKE_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*.sh")
  69. # GMT_-U.sh always fails
  70. foreach (skip_test GMT_-U.sh GMT_encoding.sh gen_data_App_O.sh gen_data_dummy.sh)
  71. list (REMOVE_ITEM _scripts_tests doc/scripts/${skip_test})
  72. endforeach()
  73. # Remove GMT_latex.sh if latex or dvips not found
  74. if (NOT LATEX OR NOT DVIPS)
  75. list (REMOVE_ITEM _scripts_tests doc/scripts/GMT_latex.sh doc/scripts/GMT_slope2intensity.sh)
  76. endif (NOT LATEX OR NOT DVIPS)
  77. if (DO_TESTS AND BASH)
  78. foreach (_job ${_scripts_tests})
  79. add_test (NAME ${_job}
  80. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  81. COMMAND ${BASH} ${CMAKE_BINARY_DIR}/test/gmtest ${_job})
  82. endforeach (_job)
  83. endif (DO_TESTS AND BASH)
Tip!

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

Comments

Loading...