mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 10:01:38 +08:00
fixed issue #41: "Build error when JKQtPlotter_BUILD_INCLUDE_XITS_FONTS set to OFF", code tried to use XITS-ressources, which were not there oif option is switched off. --> solved by adding optional private preprocessor definition
This commit is contained in:
parent
b22b4ca935
commit
f6505e35fc
@ -50,6 +50,9 @@ if(JKQtPlotter_BUILD_SHARED_LIBS)
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
if(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS)
|
||||
target_compile_definitions(${libsh_name} PRIVATE JKQTMATHTEXT_COMPILED_WITH_XITS)
|
||||
endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS)
|
||||
set_target_properties(${libsh_name} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS "ON")
|
||||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
@ -61,6 +64,9 @@ if(JKQtPlotter_BUILD_STATIC_LIBS)
|
||||
target_compile_features(${lib_name} PUBLIC cxx_std_11)
|
||||
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
||||
if(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS)
|
||||
target_compile_definitions(${lib_name} PRIVATE JKQTMATHTEXT_COMPILED_WITH_XITS)
|
||||
endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS)
|
||||
target_link_libraries(${lib_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport JKQTCommonLib)
|
||||
target_include_directories(${lib_name} PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
|
||||
|
@ -3257,7 +3257,7 @@ JKQTMathText::JKQTMathText(QObject* parent):
|
||||
QObject(parent)
|
||||
{
|
||||
//std::chrono::high_resolution_clock::time_point t0=std::chrono::high_resolution_clock::now();
|
||||
Q_INIT_RESOURCE(xits);
|
||||
initJKQTMathTextResources();
|
||||
//qDebug()<<"init_resoucre: "<<std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now()-t0).count()/1000.0<<"ms"; t0=std::chrono::high_resolution_clock::now();
|
||||
QFontDatabase fontdb;
|
||||
//qDebug()<<"init_fontDB: "<<std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now()-t0).count()/1000.0<<"ms"; t0=std::chrono::high_resolution_clock::now();
|
||||
@ -4983,7 +4983,13 @@ QString JKQTMathText::MTplainTextNode::textTransform(const QString &_text, JKQTM
|
||||
|
||||
void initJKQTMathTextResources()
|
||||
{
|
||||
static bool initialized=false;
|
||||
if (!initialized) {
|
||||
#ifdef JKQTMATHTEXT_COMPILED_WITH_XITS
|
||||
Q_INIT_RESOURCE(xits);
|
||||
#endif
|
||||
initialized=true;
|
||||
}
|
||||
}
|
||||
|
||||
JKQTMathText::MTnodeSize::MTnodeSize():
|
||||
|
@ -421,6 +421,11 @@ class JKQTMATHTEXT_LIB_EXPORT JKQTMathText : public QObject {
|
||||
* These are included by default in this library and also activated by default.
|
||||
*
|
||||
* \image html jkqtmathparser_xits.png
|
||||
*
|
||||
* \note The XITS fonts can be compiled into JKQTPlotter, when the CMake-option \c is set to ON (default: ON).
|
||||
* Then the XITS fonts are added as Qt-Ressources to the library binary.
|
||||
* If this is not the case, you have to provide the XITS fonts on the target system by other means, if you want
|
||||
* to use them.
|
||||
*/
|
||||
bool useXITS(bool mathModeOnly=true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user