mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-11-16 02:25:50 +08:00
96 lines
3.8 KiB
CMake
96 lines
3.8 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
|
|
|
|
if(JKQtPlotter_BUILD_TOOLS)
|
|
|
|
# custom target that generates the images for the JKQTMathText documentation
|
|
set(JKQTMathText_GenerateDocImages_DefaultOptions --resolution=96 --fontsize=15 --fontmathroman=XITS --background=white --sizeincrease=5)
|
|
set(JKQTMathText_GenerateDocImages_StdInputFiles
|
|
jkqtmathtext_docimages_accents.jkmt
|
|
jkqtmathtext_docimages_boxes.jkmt
|
|
jkqtmathtext_docimages_braces.jkmt
|
|
jkqtmathtext_docimages_formating.jkmt
|
|
jkqtmathtext_docimages_frac.jkmt
|
|
jkqtmathtext_docimages_math.jkmt
|
|
jkqtmathtext_docimages_matrix.jkmt
|
|
jkqtmathtext_docimages_misc.jkmt
|
|
jkqtmathtext_docimages_specialfonts.jkmt
|
|
jkqtmathtext_docimages_symbolsandencoding.jkmt
|
|
jkqtmathtext_docimages_spaces.jkmt
|
|
)
|
|
|
|
|
|
set(JKQTMathText_GenerateDocImages_COMMAND $<TARGET_FILE:jkqtmathtext_render> ${JKQTMathText_GenerateDocImages_DefaultOptions})
|
|
set(JKQTMathText_GenerateDocImages_OutputDir "${CMAKE_CURRENT_LIST_DIR}/images/jkqtmathtext/")
|
|
add_custom_target(JKQTMathText_GenerateDocImages
|
|
COMMENT "Building JKQTMathText Documentation Images ..."
|
|
DEPENDS jkqtmathtext_render
|
|
)
|
|
|
|
foreach(file ${JKQTMathText_GenerateDocImages_StdInputFiles})
|
|
string(REGEX MATCH ".*_([^_\.]+)\.[A-Za-z]+" dummy ${file})
|
|
set(loc_name ${CMAKE_MATCH_1})
|
|
string(TOUPPER ${loc_name} loc_name_upper ${file})
|
|
set(loc_target_name "JKQTMathText_GenerateDocImages_${loc_name}")
|
|
|
|
add_custom_target(${loc_target_name}
|
|
COMMENT "Building JKQTMathText Documentation Images: ${loc_name_upper}"
|
|
COMMAND ${JKQTMathText_GenerateDocImages_COMMAND} --inputfile="${CMAKE_CURRENT_LIST_DIR}/${file}" --outputdir="${JKQTMathText_GenerateDocImages_OutputDir}"
|
|
WORKING_DIRECTORY ${JKQtPlotter_QT_BINDIR}
|
|
DEPENDS jkqtmathtext_render
|
|
)
|
|
|
|
add_dependencies(JKQTMathText_GenerateDocImages ${loc_target_name})
|
|
|
|
unset(loc_name)
|
|
unset(loc_target_name)
|
|
unset(loc_name_upper)
|
|
unset(dummy)
|
|
endforeach()
|
|
|
|
add_custom_target(JKQTMathText_GenerateDocImages_listsymbols
|
|
COMMENT "Building JKQTMathText Documentation Images: LISTSYMBOLS"
|
|
COMMAND ${JKQTMathText_GenerateDocImages_COMMAND} --listsymbols="${CMAKE_CURRENT_LIST_DIR}/dox/jkqtmathtext_supportedlatexsymbols.dox" --outputdir="${JKQTMathText_GenerateDocImages_OutputDir}/symbols/"
|
|
WORKING_DIRECTORY ${JKQtPlotter_QT_BINDIR}
|
|
DEPENDS jkqtmathtext_render
|
|
)
|
|
|
|
add_dependencies(JKQTMathText_GenerateDocImages JKQTMathText_GenerateDocImages_listsymbols)
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(JKQtPlotter_BUILD_EXAMPLES)
|
|
|
|
# custom target that generates the images for the JKQTMathText documentation
|
|
set(JKQTPlotter_GenerateDocScreenshots_DefaultOptions --screenshotdir="${CMAKE_CURRENT_LIST_DIR}/../screenshots/" --screenshot --smallscreenshotplot)
|
|
set(JKQTPlotter_GenerateDocScreenshots_From
|
|
scatter
|
|
)
|
|
|
|
add_custom_target(JKQTPlotter_GenerateDocScreenshots
|
|
COMMENT "Building JKQTPlotter Documentation Screenshots ..."
|
|
)
|
|
|
|
foreach(example ${JKQTPlotter_GenerateDocScreenshots_From})
|
|
set(loc_target_name JKQTPlotter_GenerateDocScreenshots_${example})
|
|
set(dep_name jkqtptest_${example})
|
|
add_custom_target(${loc_target_name}
|
|
COMMENT "Building JKQTPlotter Documentation Screenshot: ${loc_name_upper}"
|
|
COMMAND $<TARGET_FILE:${dep_name}> ${JKQTPlotter_GenerateDocScreenshots_DefaultOptions} --screenshotbasename=${example}
|
|
WORKING_DIRECTORY ${JKQtPlotter_QT_BINDIR}
|
|
DEPENDS ${dep_name}
|
|
)
|
|
|
|
add_dependencies(JKQTPlotter_GenerateDocScreenshots ${loc_target_name})
|
|
|
|
unset(loc_target_name)
|
|
unset(dep_name)
|
|
endforeach()
|
|
|
|
endif()
|