Skip to content

Commit 2f75aed

Browse files
committed
cmake:doc: drop octave, use python
Figures generated with Python/Matplotlib are quite similar to the orinially generated with Octave/epstk. We need Python anyway for testig. Trading 2 dependencies for something that is going to be used further.
1 parent 5c4edf5 commit 2f75aed

File tree

2 files changed

+19
-36
lines changed

2 files changed

+19
-36
lines changed

qucs-doc/CMakeLists.txt

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,11 @@ else()
1919
message(FATAL_ERROR "fig2dev was requested but not found.")
2020
endif()
2121

22-
# check for octave
23-
find_program(OCTAVE octave)
24-
if(OCTAVE)
25-
message(STATUS "Using ${OCTAVE} to generate figures.")
22+
find_program(PYTHON python3)
23+
if(PYTHON)
24+
message(STATUS "Using ${PYTHON} to generate figures.")
2625
else()
27-
message(FATAL_ERROR "octave was requested but not found.")
28-
endif()
29-
30-
# check for epstk
31-
execute_process(
32-
COMMAND ${OCTAVE} --eval eglobpar
33-
OUTPUT_VARIABLE EPSTK )
34-
if(NOT EPSTK)
35-
message(STATUS "Using epstk (octave) to generate figures.")
36-
else()
37-
message(FATAL_ERROR "epstk (octave) was requested but not found.")
26+
message(FATAL_ERROR "python3 was requested but not found.")
3827
endif()
3928

4029
add_subdirectory(report)

qucs-doc/technical/CMakeLists.txt

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11

2-
set(MFILES
3-
coplanarzl.m
4-
mscomparezl.m
5-
mszl.m
6-
radius.m
7-
stabbashford.m
8-
stabgear.m
9-
stabgearex.m
10-
stabmoulton.m
11-
)
122

133
set(FIGS
144
acstrafo.fig
@@ -184,17 +174,21 @@ foreach(file ${FIGS})
184174
endforeach()
185175

186176

187-
# generate .m --> eps
188-
set(m_gen)
189-
foreach(file ${MFILES})
190-
get_filename_component(_name ${file} NAME_WE)
191-
add_custom_command(
192-
OUTPUT ${_name}.eps
193-
COMMAND octave --path ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${file}
194-
DEPENDS ${file})
195-
list(APPEND m_gen ${_name}.eps)
196-
endforeach()
177+
# generate figures from python script
178+
set(pyFigs
179+
coplanarzl.pdf
180+
mscomparezl.pdf
181+
mszl.pdf
182+
radius.pdf
183+
stabbashford.pdf
184+
stabgear.pdf
185+
stabgearex.pdf
186+
stabmoulton.pdf)
197187

188+
add_custom_command(
189+
OUTPUT ${pyFigs}
190+
COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/figures.py
191+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/figures.py)
198192

199193
# Compile LaTeX document
200194
# If fig2eps and m2eps were known formatds they could be on IMAGE.
@@ -204,7 +198,7 @@ add_latex_document(
204198
INPUTS ${CHAPTERS}
205199
IMAGES ${PSFILES}
206200
BIBFILES literature.bib
207-
DEPENDS ${fig_gen} ${m_gen}
201+
DEPENDS ${fig_gen} ${pyFigs}
208202
)
209203

210204
# Handle install

0 commit comments

Comments
 (0)