From 49eecaaf7d295fb61b4e5cb0daf1502b685f035b Mon Sep 17 00:00:00 2001 From: Transporter Date: Wed, 30 Oct 2024 22:00:12 +0100 Subject: [PATCH] Fix issue #142 (#143) --- lib/jkqtmathtext/CMakeLists.txt | 19 +++++++++++++++++- lib/jkqtmathtext/resources/CMakeLists.txt | 24 ----------------------- lib/jkqtplotter/CMakeLists.txt | 8 +++++++- lib/jkqtplotter/resources/CMakeLists.txt | 8 -------- 4 files changed, 25 insertions(+), 34 deletions(-) delete mode 100644 lib/jkqtmathtext/resources/CMakeLists.txt delete mode 100644 lib/jkqtplotter/resources/CMakeLists.txt diff --git a/lib/jkqtmathtext/CMakeLists.txt b/lib/jkqtmathtext/CMakeLists.txt index d2294bbabe9..070a0807828 100644 --- a/lib/jkqtmathtext/CMakeLists.txt +++ b/lib/jkqtmathtext/CMakeLists.txt @@ -32,7 +32,24 @@ target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS add_subdirectory(nodes) add_subdirectory(parsers) -add_subdirectory(resources) + +# add XITS as a ressource +if(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) + qt_add_resources(QRCSOURCES resources/xits.qrc) + target_sources(${lib_name} PRIVATE ${QRCSOURCES}) + target_compile_definitions(${lib_name} PUBLIC JKQTMATHTEXT_COMPILED_WITH_XITS) + install(FILES "${CMAKE_CURRENT_LIST_DIR}/resources/xits/OFL.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME "${lib_name}_XITS_LICENSE.txt" ) + install(FILES "${CMAKE_CURRENT_LIST_DIR}/resources/xits/README.md" DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME "${lib_name}_XITS_README.md" ) +endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) + +# add FIRAMATH as a ressource +if(JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS) + qt_add_resources(QRCSOURCES resources/firamath.qrc) + target_sources(${lib_name} PRIVATE ${QRCSOURCES}) + target_compile_definitions(${lib_name} PUBLIC JKQTMATHTEXT_COMPILED_WITH_FIRAMATH) + install(FILES "${CMAKE_CURRENT_LIST_DIR}/resources/firaMath/LICENSE" DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME "${lib_name}_FIRAMATH_LICENSE" ) + install(FILES "${CMAKE_CURRENT_LIST_DIR}/resources/firaMath/README.md" DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME "${lib_name}_FIRAMATH_README.md" ) +endif(JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS) # Installation jkqtplotter_installlibrary_new(${lib_name} ${libBaseName} ${CMAKE_CURRENT_LIST_DIR}) diff --git a/lib/jkqtmathtext/resources/CMakeLists.txt b/lib/jkqtmathtext/resources/CMakeLists.txt deleted file mode 100644 index 0423016925c..00000000000 --- a/lib/jkqtmathtext/resources/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.23) - - -# add XITS as aressource -if(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) - target_sources(${lib_name} PRIVATE - xits.qrc - ) - target_compile_definitions(${lib_name} PUBLIC JKQTMATHTEXT_COMPILED_WITH_XITS) - install(FILES "${CMAKE_CURRENT_LIST_DIR}/xits/OFL.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME "${lib_name}_XITS_LICENSE.txt" ) - install(FILES "${CMAKE_CURRENT_LIST_DIR}/xits/README.md" DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME "${lib_name}_XITS_README.md" ) -endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) - - -# add FIRAMATH as aressource -if(JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS) - target_sources(${lib_name} PRIVATE - firamath.qrc - ) - target_compile_definitions(${lib_name} PUBLIC JKQTMATHTEXT_COMPILED_WITH_FIRAMATH) - install(FILES "${CMAKE_CURRENT_LIST_DIR}/firaMath/LICENSE" DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME "${lib_name}_FIRAMATH_LICENSE" ) - install(FILES "${CMAKE_CURRENT_LIST_DIR}/firaMath/README.md" DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME "${lib_name}_FIRAMATH_README.md" ) -endif(JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS) - diff --git a/lib/jkqtplotter/CMakeLists.txt b/lib/jkqtplotter/CMakeLists.txt index 50ad03df573..a97a0aa2181 100644 --- a/lib/jkqtplotter/CMakeLists.txt +++ b/lib/jkqtplotter/CMakeLists.txt @@ -68,7 +68,13 @@ target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS add_subdirectory(graphs) add_subdirectory(gui) -add_subdirectory(resources) + +# add ressource +qt_add_resources(QRCSOURCES + resources/jkqtpbaseplotter.qrc + resources/jkqtpstyles.qrc +) +target_sources(${lib_name} PRIVATE ${QRCSOURCES}) # add version info target_include_directories(${lib_name} PRIVATE ${JKQTPLOTTER_VERSION_FILE_DIR}) diff --git a/lib/jkqtplotter/resources/CMakeLists.txt b/lib/jkqtplotter/resources/CMakeLists.txt deleted file mode 100644 index 170fff5eb25..00000000000 --- a/lib/jkqtplotter/resources/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.23) - - -# add aressource -target_sources(${lib_name} PRIVATE - jkqtpbaseplotter.qrc - jkqtpstyles.qrc -)