NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)

NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
This commit is contained in:
jkriege2 2024-01-16 13:05:52 +01:00
parent 7402343279
commit b0df7a1fd7
99 changed files with 1024 additions and 1645 deletions

View File

@ -45,10 +45,21 @@ include(jkqtplotter_common_qtsettings)
# additionnal common macros
include(jkqtplotter_macros)
set(jkqtplotter_LIBNAME_VERSION_PART ${QT_VERSION_MAJOR})
# defines the CMake-namespace for all libraries
set(jkqtplotter_namespace JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART}::)
# defines the subdirectory for CMake-files, when installing
set(jkqtplotter_cmakeSubdir JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# now add subdirectories with the library code ...
add_subdirectory(lib)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
# We're in the root, define additional targets for developers.
# This prepares the library to be used with CMake's FetchContent
# ... and optionally the examples
if(JKQtPlotter_BUILD_EXAMPLES)
add_subdirectory(examples)
@ -60,5 +71,5 @@ endif()
add_subdirectory(doc)
endif()

View File

@ -93,10 +93,22 @@ JKQTPlotter contains two different build systems: A modern [CMake](https://cmake
With [CMake](https://cmake.org/) you can easily build JKQTPlotter and all its examples, by calling something like:
```
$ mkdir build; cd build
$ cmake .. -G "<cmake_generator>" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources>"
$ cmake .. -G "<cmake_generator>" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources>" "-DCMAKE_INSTALL_PREFIX=<where_to_install>"
$ cmake --build . --config "Debug"
$ cmake --install . --config "Debug"
```
This will create CMake targets, which you can easily link against. For the main plotter library, the target's name is \c JKQTPlotter5::JKQTPlotter5 or \c JKQTPlotter6::JKQTPlotter6 depending on the Qt-Version you use. You can then simmply link against this via:
```
find_package(JKQTPlotter6 REQUIRED)
target_link_libraries(${PROJECT_NAME} JKQTPlotter6::JKQTPlotter6)
```
or on a Qt-version agnostic way via:
```
find_package(JKQTPlotter${QT_VERSION_MAJOR} REQUIRED)
target_link_libraries(${PROJECT_NAME} JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR})
```
See http://jkriege2.github.io/JKQtPlotter/page_buildinstructions_cmake.html for details.
## Stargazers over time

View File

@ -121,17 +121,33 @@ for:
build_script:
- cmd: echo == BUILD JKQtPlotter ============================================================================
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: mkdir build
- cmd: mkdir install
- cmd: cd build
- cmd: if %USE_CMAKE%==true cmake --version
- cmd: if %USE_CMAKE%==true cmake -G "%CMAKE_GENERATOR%" "-DCMAKE_PREFIX_PATH=%QTDIR%;%CIMG_INCLUDE_DIR%" ..
- cmd: if %USE_CMAKE%==true cmake -G "%CMAKE_GENERATOR%" "-DCMAKE_PREFIX_PATH=%QTDIR%;%CIMG_INCLUDE_DIR%" "-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%\install" ..
- cmd: if %USE_CMAKE%==true cmake --build . --config "%CONFIGURATION%" -j%NUMBER_OF_PROCESSORS% -- %CMAKE_BUILDFLAGS%
- cmd: if %USE_CMAKE%==false qmake.exe -v
- cmd: if %USE_CMAKE%==false qmake.exe CONFIG+=%CONFIGURATION% ..\JKQtPlotterBuildAllExamples.pro
- cmd: if %USE_CMAKE%==false call %MAKETOOL%
- cmd: cd ..
install:
- cmd: echo == INSTALL JKQtPlotter ==========================================================================
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: cd build
- cmd: if %USE_CMAKE%==true cmake --install . --config "%CONFIGURATION%" -j%NUMBER_OF_PROCESSORS% -- %CMAKE_BUILDFLAGS%
test_usage:
- cmd: echo == TEST: USE JKQtPlotter CMAKE BUILD ============================================================
- cmd: if %USE_CMAKE%==true cd %APPVEYOR_BUILD_FOLDER%
- cmd: if %USE_CMAKE%==true cd examples\cmake_link_example
- cmd: mkdir build
- cmd: cd build
- cmd: if %USE_CMAKE%==true cmake -G "%CMAKE_GENERATOR%" "-DCMAKE_PREFIX_PATH=%QTDIR%;%CIMG_INCLUDE_DIR%;%APPVEYOR_BUILD_FOLDER%\install" ..
- cmd: if %USE_CMAKE%==true cmake --build . --config "%CONFIGURATION%" -j%NUMBER_OF_PROCESSORS% -- %CMAKE_BUILDFLAGS%
- cmd: cd ..
# Linux (Ubuntu2004)
@ -185,13 +201,15 @@ for:
build_script:
- sh: echo == BUILD JKQtPlotter ============================================================================
- sh: cd %APPVEYOR_BUILD_FOLDER%
- sh: mkdir build
- sh: mkdir install
- sh: cd build
- sh: |
if [ "$USE_CMAKE" = true ]; then
echo --- Run CMake Configure -----------------------------------------------------------------------------
cmake --version
cmake -G "$CMAKE_GENERATOR" "-DCMAKE_PREFIX_PATH=$QTDIR;$CIMG_INCLUDE_DIR" ..
cmake -G "$CMAKE_GENERATOR" "-DCMAKE_PREFIX_PATH=$QTDIR;$CIMG_INCLUDE_DIR" "-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/install" ..
echo --- Build using CMake -------------------------------------------------------------------------------
cmake --build . --config "$CONFIGURATION" -j$(getconf _NPROCESSORS_ONLN) -- $CMAKE_BUILDFLAGS
fi
@ -204,8 +222,30 @@ for:
make -j$(getconf _NPROCESSORS_ONLN)
fi
install:
- sh: echo == INSTALL JKQtPlotter ==========================================================================
- sh: cd %APPVEYOR_BUILD_FOLDER%
- sh: cd build
- sh: |
if [ "$USE_CMAKE" = true ]; then
echo --- Install using CMake -------------------------------------------------------------------------------
cmake --install . --config "$CONFIGURATION" -j$(getconf _NPROCESSORS_ONLN) -- $CMAKE_BUILDFLAGS
fi
test_usage:
- sh: echo == TEST: USE JKQtPlotter CMAKE BUILD ============================================================
- sh: cd %APPVEYOR_BUILD_FOLDER%
- sh: if %USE_CMAKE%==true cd examples\cmake_link_example
- sh: mkdir build
- sh: cd build
- sh: |
if [ "$USE_CMAKE" = true ]; then
cmake -G "%CMAKE_GENERATOR%" "-DCMAKE_PREFIX_PATH=%QTDIR%;%CIMG_INCLUDE_DIR%;%APPVEYOR_BUILD_FOLDER%\install" ..
cmake --build . --config "%CONFIGURATION%" -j%NUMBER_OF_PROCESSORS% -- %CMAKE_BUILDFLAGS%
fi
- sh: cd ..
# MacOS (Monterey)

View File

@ -1,8 +1,5 @@
if(NOT DEFINED JKQtPlotter_BUILD_SHARED_LIBS)
option(JKQtPlotter_BUILD_SHARED_LIBS "Build as shared library" ON)
endif()
if(NOT DEFINED JKQtPlotter_BUILD_STATIC_LIBS)
option(JKQtPlotter_BUILD_STATIC_LIBS "Build as static library" OFF)
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build as shared library" ON)
endif()
if(NOT DEFINED JKQtPlotter_BUILD_INCLUDE_XITS_FONTS)
option(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS "Include XITS fonts (SIL OPEN FONT LICENSE Version 1.1) as resources in library" ON)
@ -16,6 +13,18 @@ endif()
if(NOT DEFINED JKQtPlotter_BUILD_EXAMPLES)
option(JKQtPlotter_BUILD_EXAMPLES "Build the examples" ON)
endif()
if(NOT DEFINED JKQtPlotter_BUILD_LIB_JKQTMATH)
option(JKQtPlotter_BUILD_LIB_JKQTMATH "Build the sub-library JKQTMath" ON)
endif()
if(NOT DEFINED JKQtPlotter_BUILD_LIB_JKQTMATHTEXT)
option(JKQtPlotter_BUILD_LIB_JKQTMATHTEXT "Build the sub-library JKQTMathText" ON)
endif()
if(NOT DEFINED JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER)
option(JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER "Build the sub-library JKQTFastPlotter" ON)
endif()
if(NOT DEFINED JKQtPlotter_BUILD_LIB_JKQTPLOTTER)
option(JKQtPlotter_BUILD_LIB_JKQTPLOTTER "Build the sub-library JKQTPlotter" ON)
endif()
if(NOT DEFINED JKQtPlotter_BUILD_TOOLS)
option(JKQtPlotter_BUILD_TOOLS "Build the tools" ON)
endif()
@ -35,6 +44,7 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX)
option(CMAKE_INSTALL_PREFIX "Install directory" ${CMAKE_CURRENT_SOURCE_DIR}/install)
endif()
include(GNUInstallDirs)
#evaluate the settings above
if (NOT CMAKE_INSTALL_LIBDIR)
@ -55,8 +65,18 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/output)
if(JKQtPlotter_BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE)
set(JKQtPlotter_LIBNAME_ADDITION "_$<CONFIG>") #"_${CMAKE_BUILD_TYPE}")
set(JKQtPlotter_LIBNAME_ADDITION "_$<CONFIG>")
else()
set(JKQtPlotter_LIBNAME_ADDITION )
endif()
if (JKQtPlotter_BUILD_FORCE_NO_PRINTER_SUPPORT)
set(JKQtPlotter_BUILD_WITH_PRINTER_SUPPORT "OFF")
else()
set(JKQtPlotter_BUILD_WITH_PRINTER_SUPPORT "ON")
endif()
if(JKQtPlotter_BUILD_LIB_JKQTPLOTTER)
set(JKQtPlotter_BUILD_LIB_JKQTMATH "ON")
set(JKQtPlotter_BUILD_LIB_JKQTMATHTEXT "ON")
endif()

View File

@ -1,3 +1,67 @@
include(CMakePackageConfigHelpers)
function(jkqtplotter_add_library lib_name)
# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS
add_library(${lib_name} )
# ... add an alias with the correct namespace
add_library(${jkqtplotter_namespace}${lib_name} ALIAS ${lib_name})
# set the libraries output name
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name}${JKQtPlotter_LIBNAME_ADDITION}")
endfunction()
function(jkqtplotter_setDefaultLibOptions TARGETNAME libBaseName PRECOMPHEADERFILE)
string(TOUPPER ${libBaseName} libBasenameUPPER)
# set library version
set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}")
# set required Cxx-Standard
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD})
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED})
target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE})
# set options, specific to shared libraries
if (BUILD_SHARED_LIBS)
target_compile_definitions(${TARGETNAME} PUBLIC ${libBasenameUPPER}_LIB_IN_DLL)
target_compile_definitions(${TARGETNAME} PRIVATE ${libBasenameUPPER}_LIB_EXPORT_LIBRARY)
set_target_properties(${TARGETNAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS "ON")
endif(BUILD_SHARED_LIBS)
if(MINGW)
# COMPILER-SETTINGS FOR MINGW
target_compile_options(${TARGETNAME} PUBLIC -fexceptions)
elseif(MSVC)
# COMPILER-SETTINGS FOR MS VISUAL C++
target_compile_options(${TARGETNAME} PUBLIC /EHsc)
target_compile_definitions(${TARGETNAME} PUBLIC NOMINMAX)
endif()
# enable TIMING INFO output (if activated by option JKQtPlotter_BUILD_WITH_TIMING_INFO_OUTPUT)
if(JKQtPlotter_BUILD_WITH_TIMING_INFO_OUTPUT)
target_compile_definitions(${TARGETNAME} PRIVATE JKQTBP_AUTOTIMER)
endif()
# set default include paths
target_include_directories(${TARGETNAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS AND (NOT PRECOMPHEADERFILE EQUAL ""))
target_precompile_headers(${TARGETNAME} PRIVATE ${PRECOMPHEADERFILE})
target_sources(${TARGETNAME} PRIVATE ${PRECOMPHEADERFILE})
endif()
endfunction()
include(GNUInstallDirs)
function(jkqtplotter_installlibrary lib_name libIncludeSubdir BuildTypePart)
install(TARGETS ${lib_name} EXPORT ${lib_name}_TARGETS
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@ -6,7 +70,6 @@ function(jkqtplotter_installlibrary lib_name libIncludeSubdir BuildTypePart)
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
)
if(WIN32 AND MSVC AND (NOT MSVC_VERSION LESS 1600) AND (NOT CMAKE_VERSION VERSION_LESS "3.1") AND (NOT BuildTypePart STREQUAL ""))
message(STATUS "?????????????? INSTALL PDF BuildTypePart=${BuildTypePart}")
install(FILES $<TARGET_PDB_FILE:${lib_name}> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
endif()
set(JKQTP_CURRENT_TARGET_SHAREDPART "${BuildTypePart}")
@ -14,11 +77,57 @@ function(jkqtplotter_installlibrary lib_name libIncludeSubdir BuildTypePart)
configure_file(LibTarget.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Config.cmake" @ONLY)
install(EXPORT ${lib_name}_TARGETS
FILE "${JKQTP_CURRENT_TARGET_FILENAME}"
DESTINATION lib/cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake"
DESTINATION lib/cmake )
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake )
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Config.cmake"
DESTINATION lib/cmake )
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake )
endfunction(jkqtplotter_installlibrary)
function(jkqtplotter_installlibrary_new lib_name libIncludeSubdir libSrcDir)
# export targets (including headers!)
install(TARGETS ${lib_name}
EXPORT ${lib_name}_TARGETS
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
)
# generate ...Config.cmake
set(JKQTP_CURRENT_TARGET_FILENAME "${lib_name}Targets.cmake")
configure_file(${libSrcDir}/LibTarget.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Config.cmake" @ONLY)
# install export files
install(EXPORT ${lib_name}_TARGETS
FILE "${JKQTP_CURRENT_TARGET_FILENAME}"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${jkqtplotter_cmakeSubdir}
NAMESPACE ${jkqtplotter_namespace}
)
# write CMake version file
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion )
#install PDB-files
if(WIN32 AND MSVC AND (NOT MSVC_VERSION LESS 1600) AND (NOT CMAKE_VERSION VERSION_LESS "3.1") AND BUILD_SHARED_LIBS)
install(FILES $<TARGET_PDB_FILE:${lib_name}> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
endif()
# install ...Version.cmake
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${jkqtplotter_cmakeSubdir} )
# install ...Config.cmake
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Config.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${jkqtplotter_cmakeSubdir} )
# install readme.txt
configure_file(${PROJECT_SOURCE_DIR}/readme.txt.in ${CMAKE_CURRENT_BINARY_DIR}/${lib_name}_Readme.txt @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}_Readme.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
# install license
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION ${CMAKE_INSTALL_DOCDIR}) # RENAME "${lib_name}_LICENSE.txt" )
endfunction(jkqtplotter_installlibrary_new)

View File

@ -7,99 +7,120 @@
\section page_buildinstructions_CMAKE_RUN Running a Build with CMake
The preferred way to build JKQTPlotter is using <a href="https://cmake.org/">CMake</a>. You can find a detailed explanation of CMake at https://cliutils.gitlab.io/modern-cmake/. The CMake-build is defined in `CMakeLists.txt` files, found in many of the directories of the code repository. Especially in the root directory and the two subdirectories <code> ./lib/ </code> and <code> ./examples/ </code> .
The preferred way to build JKQTPlotter is using <a href="https://cmake.org/">CMake</a> (at least using version 3.23). You can find a detailed explanation of CMake at https://cliutils.gitlab.io/modern-cmake/. The CMake-build is defined in `CMakeLists.txt` files, found in many of the directories of the code repository. Especially in the root directory and the two subdirectories <code> ./lib/ </code> and <code> ./examples/ </code> .
You can build JKQTPlotter (and also the examples) by either opening the file <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/CMakeLists.txt">CMakeLists.txt</a> in QTCreator (which has CMake integration), or by calling \c CMake by hand. How to do this depends on your local system und build environment.
\subsection page_buildinstructions_CMAKE_MAKEFILE Building with MinGW/GNU/... Makefiles
\subsection page_buildinstructions_CMAKE_MAKEFILE Generic Configuring&Building
You can use (MinGW) Makefiles by calling:
The first step is to configure the bild,using:
\code{.sh}
$ mkdir build
$ cd build
$ cmake .. -G "MinGW Makefiles" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources>"
$ cmake --build . --config "Debug"
$ cmake --build . --config "Debug" --target install
$ cmake .. -G "<GENERATOR>" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources>"
\endcode
This configures the CMake build. The Parameter \c <GENERATOR> tells CMake, which build-file generator to use (e.g. use <code>MinGW Makefiles</code> for MinGW Makefiles on Windows or <code>Unix Makefiles</code> on Unix, see <a href="https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html">https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html</a> for a list of available generators). The parameter \c <path_to_your_qt_sources> should be the path to your Qt installation. You can also add (separated by semicolon) paths to other libraries that JKQTPlotter should use, e.g. <a href="https://cimg.eu/">CImg</a> or <a href="https://cimg.eu/">OpenCV</a>. JKQTPlotter does not have any neccessary dependencies, apart from Qt5 or 6, but it contains binding code to somme popular 3rd party libraries (as e.g. CImmg or OpenCV). Also see \ref page_buildinstructions_CMAKE_CONFIG for a listing of additional configuration options for JKQTPlotter. You might e.g. want to set \c CMAKE_INSTALL_PREFIX to a path in which you want to install the build results. This also has to be done at this stage.
\subsection page_buildinstructions_CMAKE_VSTUDIO Building with Visual Studio
Of course you can also perform this step in the <a href="https://cmake.org/cmake/help/latest/manual/cmake-gui.1.html">CMake GUI</a> or <a href="https://cmake.org/cmake/help/latest/manual/ccmake.1.html">ccmake</a>.
For Visual Studio it could look like this:
Now you can build the library using:
\code{.sh}
$ cmake --build . --config "Debug"
\endcode
Here we explicitly build the configuration \c Debug ... you can also build other configurations here, as e.g. \c Release . The final build will put all of these side-by-side into the install directory, sou can can generate a multi-configuration installation. When linking to JKQTBuilder, the matching condfiguration´should be selected automatically!
\subsection page_buildinstructions_CMAKE_VSTUDIO Configuring&Building with Visual Studio/MSVC
For Visual Studio / Visual C++ the build looks similar, but you will have to select one of the <a href="https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14"><code>Visula Studio ...</code> generators</a>, e.g. :
\code{.sh}
$ mkdir build
$ cd build
$ cmake .. -G "Visual Studio 15 2017 Win64" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources>"
$ cmake .. -G "Visual Studio 16 2019 Win64" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources>"
\endcode
Where \c \<path_to_your_qt_sources\> could be e.g. \c C:/development/Qt5/5.12.0/msvc2017_64 . This call results in a Visual Studio solution \c build/JKQTPlotter.sln that you can load and compile from the Visual Studio IDE. Alternatively you can also build the solution directly calling:
Where \c \<path_to_your_qt_sources\> could be e.g. \c C:/Qt/6.5.0/msvc2019_64 . This call results in a Visual Studio solution \c build/JKQTPlotter.sln that you can load and compile from the Visual Studio IDE. Alternatively you can also build the solution directly calling:
\code{.sh}
$ cmake --build . --config "Debug"
\endcode
Afterwards you can install the library by
\code{.sh}
$ cmake --build . --config "Debug" --target install
\endcode
Again we explicitly build the configuration \c Debug ... you can also build other configurations here, as e.g. \c Release . The final build will put all of these side-by-side into the install directory, sou can can generate a multi-configuration installation. When linking to JKQTBuilder, the matching condfiguration´should be selected automatically!
\section page_buildinstructions_CMAKE_CONFIG Configuring a Build with CMake
\subsection page_buildinstructions_CMAKE_CONFIG Configuring a Build with CMake
The CMake build system offers several configuration variables that you may set/change to modify the outcome of the build:
The CMake build system offers several configuration variables that you may set/change to modify the outcome of the build (in the examples above, \c CMAKE_PREFIX_PATH is already used, you may set the following options in the same way:
- \c CMAKE_INSTALL_PREFIX : Install directory for the library
- \c CMAKE_PREFIX_PATH : add the path to your Qt installatrion to this variable, so the \c find_package(Qt5...) commands find the libraries you want to use
- \c JKQtPlotter_BUILD_SHARED_LIBS : Build as shared library (default: \c ON )
- \c JKQtPlotter_BUILD_STATIC_LIBS : Build as static library (default: \c ON )
- \c BUILD_SHARED_LIBS : Build as shared library (default: \c ON ), if this is \c OFF the library will be built as a static library
- \c JKQtPlotter_BUILD_INCLUDE_XITS_FONTS : Include XITS fonts as resources in library (default: \c ON )
- \c JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS : Include Fira Math fonts as resources in library (default: \c ON )
- \c JKQtPlotter_BUILD_FORCE_NO_PRINTER_SUPPORT : switches off print-support (when set to \c ON ), even if the current platform supports it (default: \c OFF )
- \c JKQtPlotter_BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE : If set, the build-type is appended to the library name (default: \c ON )
- \c JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS : If set, the build uses precompiled headers to speed up (a bit) (default: \c ON )
- \c JKQtPlotter_ENABLED_CXX20 : Build using C++20 (requires a compiler that supports this! (default: \c OFF )
- \c JKQtPlotter_BUILD_WITH_TIMING_INFO_OUTPUT : If enabled (\c ON ), additional tiing code is activated (and built into the library), which outputs timming information for several functions of the library into \c qDebug() . This is intended for development putposes only, NOT for productive builds! (default: \c OFF )
- \c JKQtPlotter_BUILD_EXAMPLES : Build examples (default: \c ON )
- \c JKQtPlotter_BUILD_TOOLS : Build tools (default: \c ON )
- \c CMAKE_INSTALL_PREFIX : Install directory for the library
- \c JKQtPlotter_BUILD_LIB_JKQTMATH : Build sub-library JKQTMath (default: \c ON )
- \c JKQtPlotter_BUILD_LIB_JKQTMATHTEXT : Build sub-library JKQTMathText (default: \c ON )
- DEPRECATED: \c JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER : Build sub-library JKQTFastPlotter (default: \c ON ) ... Note: This option may change to default=OFF in future ... and may be removed thereafter!
- \c JKQtPlotter_BUILD_LIB_JKQTPLOTTER : Build sub-library JKQTPlotter (default: \c ON )
.
\subsection page_buildinstructions_CMAKE_INSTALL Installing with CMake
Finally, after a successful build, you can install the binaries, headers etc. into a directory, given by the CMake option \c CMAKE_INSTALL_PREFIX . Simply run:
\code{.sh}
$ cmake --build . --config "Debug" --target install
\endcode
or:
\code{.sh}
$ cmake --install . --config "Debug"
\endcode
in your build directory. Again we explicitly build the configuration \c Debug ... you can also build other configurations here, as e.g. \c Release . The final build will put all of these side-by-side into the install directory, sou can can generate a multi-configuration installation. When linking to JKQTBuilder, the matching condfiguration´should be selected automatically!
You will end up with an install directory that constains subdirectories, such as \c lib/ , \c include/ or \c bin/ . Thesecontain the build results. The next section \ref page_buildinstructions_CMAKE_USAGE describes how to use such an installation to link against JKQTPlotter.
\section page_buildinstructions_CMAKE_USAGE Using a built, generated with CMake
\section page_buildinstructions_CMAKE_USAGE Using a CMake Build
After building and installing JKQTPlotter you have all files that you need inside the instal directory:
- \c \<INSTALLDIR\>/include contains all required header files
- \c \<INSTALLDIR\>/bin contains the shared libraries
- \c \<INSTALLDIR\>/lib contains the link libraries
- \c \<INSTALLDIR\>/lib/cmake contains files necessary for CMake's \c find_package() to work
- \c \<CMAKE_INSTALL_PREFIX\>/include contains all required header files
- \c \<CMAKE_INSTALL_PREFIX\>/bin contains the shared libraries, examples, tools
- \c \<CMAKE_INSTALL_PREFIX\>/lib contains the link libraries
- \c \<CMAKE_INSTALL_PREFIX\>/lib/cmake/JKQTPlotterX/ contains files necessary for CMake's \c find_package() to work
.
You can find an example project that uses a complete cmake-build here: \ref JKQTCMakeLinkExample (online: <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/examples/cmake_link_example">https://github.com/jkriege2/JKQtPlotter/blob/master/examples/cmake_link_example</a>).
The build/install above generates several CMake targets that can be used to link against JKQTPlotter (or one of its sub libraries). The generated targets are (note that the Qt-version number appears the target names!!!):
- \c JKQTPlotter6::JKQTPlotter6 / \c JKQTPlotter5::JKQTPlotter5 : the main plotting library, containing JKQTPlottter and JKQTBasePlotter
- \c JKQTPlotter6::JKQTMathText6 / \c JKQTPlotter5::JKQTMathText5 : the LaTeX rendering library containing JKQTMathText
- \c JKQTPlotter6::JKQTCommmon6 / \c JKQTPlotter5::JKQTCommon5 : basic tools and facilities for the other libraries
- \c JKQTPlotter6::JKQTMath6 / \c JKQTPlotter5::JKQTMath5 : additional mathematical algorithms to be used with JKQTPlotter (e.g. a statistics library with histograming, KDE or regression)
- \DEPRECATED: c JKQTPlotter6::JKQTFastPlotter6 / \c JKQTPlotter5::JKQTFastPlotter5 : an alternative plotting library with less features, but which is supposed to be fast,conatins JKQTFastPlotter
You can find an example project that uses a complete cmake-build here: \ref JKQTCMakeLinkExample (online: <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/examples/cmake_link_example"><code>examples/cmake_link_example</code></a>).
Here is the \c CMakeLists.txt from that directory:
\code{.cmake}
# set minimum required CMake-Version
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.23)
# set Project name
set(EXAMPLE_NAME simpletest)
set(EXENAME jkqtptest_${EXAMPLE_NAME})
project(${EXAMPLE_NAME} LANGUAGES CXX)
project(simpletest_cmake LANGUAGES CXX)
# some basic configurations
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 11)
#set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# Configure project for usage of Qt5
find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGl REQUIRED)
# Configure project for usage of Qt6
#find_package(Qt6 COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGl OpenGLWidgets REQUIRED)
# Configure project for usage of Qt5/Qt6
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGl REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGL REQUIRED)
# include JKQTPlotter
find_package(JKQTCommonLib REQUIRED)
find_package(JKQTMathTextLib REQUIRED)
find_package(JKQTPlotterLib REQUIRED)
find_package(JKQTPlotter${QT_VERSION_MAJOR} REQUIRED)
# For Visual Studio, we need to set some additional compiler options
if(MSVC)
@ -114,28 +135,48 @@ Here is the \c CMakeLists.txt from that directory:
endif()
# add the example executable
add_executable(${EXENAME} WIN32 simpletest.cpp)
# ... link against Qt5 and JKQTPlotterLib
add_executable(${PROJECT_NAME} WIN32 simpletest.cpp)
# ... link against Qt5/6 and JKQTPlotterLib
# (you could use JKQTPlotterSharedLib if you don't want to link againast the
# static version, but against the shared/DLL version).
target_link_libraries(${EXENAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::PrintSupport Qt5::Svg Qt5::Xml JKQTPlotterLib)
target_link_libraries(${PROJECT_NAME} Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::PrintSupport Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Xml)
# ... link against JKQTPlotter: As the Targets contain the Qt-Version-Number in their names, we can
# link against 'JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR}' and it works
# for Qt5 AND Qt6 ...
# if you have a speific Qt-Version, you can also write e.g. 'JKQTPlotter6::JKQTPlotter6'
target_link_libraries(${PROJECT_NAME} JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR})
# Installation
install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
\endcode
As you can see this cooks down to first finding the library, using
\code{.cmake}
find_package(JKQTPlotter${QT_VERSION_MAJOR} REQUIRED)
\endcode
and then linking against the appropriate target from the list above:
\code{.cmake}
target_link_libraries(${PROJECT_NAME} JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR})
\endcode
If you don't need to be Qt-version agnostic, you can simply write:
\code{.cmake}
find_package(JKQTPlotter6 REQUIRED)
target_link_libraries(${PROJECT_NAME} JKQTPlotter6::JKQTPlotter6)
\endcode
To build this example, you first need to make a subdirectory `build` and then call CMake form that subdirectory:
To build this example, you first need to make a subdirectory `build` inside the example directory <code>examples/cmake_link_example</code> and then call CMake form that subdirectory:
\code{.sh}
$ mkdir build
$ cd build
$ cmake .. -G "<GENERATOR>" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources> -DCMAKE_MODULE_PATH=<path_to_lib/cmake_dir_of_JKQTPLOTTER>"
$ cmake .. -G "<GENERATOR>" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources>;<JKQTPLOTTER_INSTALL_DIR>"
\endcode
The you can use the generated makefiles (e.g. load them in an editor, or build them jsing \c make ). In the last line above, you need to specify two directories:
- \c \<path_to_your_qt_sources\> points to you Qt installation
- \c \<path_to_lib/cmake_dir_of_JKQTPLOTTER\> points to the directory containing the \c XYZ.cmake -files from the JKQTPlotter build. Typically this is \c \<JKQTPLOTTER_INSTALL_DIR\>/lib/cmake , where \c \<JKQTPLOTTER_INSTALL_DIR\> is the directory into which you installed JKQTPlotter.
.
Again choose any CMake \c <GENERATOR> that is appropriate for your use-case. Replace \c <path_to_your_qt_sources> by the path of your Qt installation and \c <JKQTPLOTTER_INSTALL_DIR> by the \c CMAKE_INSTALL_PREFIX of your JKQTPlotter Build (see above).
Then you can again build the example either using the generated builf files (e.g. a Visual Studio solution), or by running
\code{.sh}
$ cmake --build . --config "Debug" --target install
\endcode
*/

View File

@ -1,14 +1,14 @@
/*!
\page page_buildinstructions_QMAKE Build using QMake
\page page_buildinstructions_QMAKE DEPRECATED: Build using QMake
\warning The <a href="https://doc.qt.io/qt-6/qmake-manual.html">QMake</a> build system is deprecated and will
not get the same love and atttention as the recommended CMake system, see \ref page_buildinstructions_CMAKE !
\tableofcontents
\section page_buildinstructions_QMAKEINCLUDE QMake Include Project
\section page_buildinstructions_QMAKEINCLUDE DEPRECATED: QMake Include Project
If you want to simply include the JKQTPlotter Source code into your projects, without build a shared or static library and linking against it, you can use one of these QMake-Include files:
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/lib/jkqtplotter.pri">lib/jkqtplotter.pri</a> includes the complete library (JKQTPlotter, JKQTFastPlotter, JKQTMathText)
@ -21,7 +21,7 @@ In your <a href="https://doc.qt.io/qt-6/qmake-manual.html">QMake</a>-projects it
include(<PATHTOJKQTPLOTTERDIR>/lib/jkqtplotter.pri)
\endcode
\section page_buildinstructions_QMAKESTATIC QMake Static Library
\section page_buildinstructions_QMAKESTATIC DEPRECATED: QMake Static Library
There are several `.PRO`-files, that can be used to build the full library, or a limited subsets of it as static link library:
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro">qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro</a> builds the complete library (JKQTPlotter, JKQTFastPlotter, JKQTMathText) as static link library
@ -64,7 +64,7 @@ SUBDIRS += jkqtplotterlib_static test_styling
\section page_buildinstructions_QMAKEDYNAMIC QMake Dynamic Library
\section page_buildinstructions_QMAKEDYNAMIC DEPRECATED: QMake Dynamic Library
There are several `.PRO`-files, that can be used to build the full library, or a limited subsets of it as shred library:
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pro">qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pro</a> builds the complete library (JKQTPlotter, JKQTFastPlotter, JKQTMathText) as shared library
@ -118,7 +118,7 @@ SUBDIRS += jkqtplotterlib_shared test_styling
\section page_buildinstructions_QMAKEQTCREATOR QMake in QTCreator
\section page_buildinstructions_QMAKEQTCREATOR DEPRECATED: QMake in QTCreator
You can load the file \c JKQtPlotterBuildAllExamples.pro in te base directory of the project directly in QtCreator and use it to build the library and the examples.

View File

@ -6,9 +6,6 @@ This page lists several todos and wishes for future version of JKQTPlotter
<ul>
<li>General:<ul>
<li>build system: provide general targets JKQTPlotter::JKQTPlotter, JKQTPlotter::JKQTMathText, instead of targets which differ by linking option</li>
<li>build system: refactor CMake-Code, so static/dynamic switch is done on compile and only one variant is built</li>
<li>build system: maybe prepare for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API (+ possibly providing a reduced source-package for each release)</li>
<li>Lib Utilities: General and portable way to mark functions and classes as deprecated for different compilers</li>
</ul></li>
<li>JKQTPlotter:<ul>

View File

@ -29,16 +29,20 @@ message( STATUS "...............................................................
message( STATUS ".. BUILDING EXAMPLE TOOLS LIB:" )
add_subdirectory(libexampletools)
if (JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER)
# examples for JKQtFastPlotter
message( STATUS ".. BUILDING EXAMPLES FOR JKQTFASTPLOTTER:" )
add_subdirectory(jkqtfastplotter_test)
endif()
if (JKQtPlotter_BUILD_LIB_JKQTMATHTEXT)
# examples specific to JKQtMathText
message( STATUS ".. BUILDING EXAMPLES FOR JKQTMATHTEXT:" )
add_subdirectory(jkqtmathtext_simpletest)
add_subdirectory(jkqtmathtext_test)
endif()
if (JKQtPlotter_BUILD_LIB_JKQTPLOTTER)
# examples for JKQtPlotter
message( STATUS ".. BUILDING EXAMPLES FOR JKQTPLOTTER:" )
# needs to be first for Precompiled Headers to work
@ -104,4 +108,4 @@ add_subdirectory(ui)
add_subdirectory(user_interaction)
add_subdirectory(violinplot)
add_subdirectory(wiggleplots)
endif()

View File

@ -15,11 +15,7 @@ set(UIS advplotstyling.qrc )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,11 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,11 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,11 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,11 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,11 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -1,16 +1,12 @@
# set minimum required CMake-Version
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.23)
# set Project name
set(EXAMPLE_NAME simpletest)
set(EXENAME jkqtptest_${EXAMPLE_NAME})
project(${EXAMPLE_NAME} LANGUAGES CXX)
project(simpletest_cmake LANGUAGES CXX)
# some basic configurations
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 11)
#set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# Configure project for usage of Qt5/Qt6
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGl REQUIRED)
@ -18,7 +14,7 @@ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets PrintSupport Svg
# include JKQTPlotter
find_package(JKQTPlotterLib REQUIRED)
find_package(JKQTPlotter${QT_VERSION_MAJOR} REQUIRED)
# For Visual Studio, we need to set some additional compiler options
if(MSVC)
@ -33,15 +29,19 @@ if(MSVC)
endif()
# add the example executable
add_executable(${EXENAME} WIN32 simpletest.cpp)
add_executable(${PROJECT_NAME} WIN32 simpletest.cpp)
# ... link against Qt5/6 and JKQTPlotterLib
# (you could use JKQTPlotterSharedLib if you don't want to link againast the
# static version, but against the shared/DLL version).
target_link_libraries(${EXENAME} Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::PrintSupport Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Xml JKQTPlotterLib)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::PrintSupport Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Xml)
# ... link against JKQTPlotter: As the Targets contain the Qt-Version-Number in their names, we can
# link against 'JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR}' and it works
# for Qt5 AND Qt6 ...
# if you have a speific Qt-Version, you can also write e.g. 'JKQTPlotter6::JKQTPlotter6'
target_link_libraries(${PROJECT_NAME} PUBLIC JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR})
# Installation
install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
#Installation of Qt DLLs on Windows
include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/jkqtplotter_deployqt.cmake)
jkqtplotter_deployqt(${EXENAME})
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@ -5,28 +5,22 @@ This project (see [`cmake_link_example`](https://github.com/jkriege2/JKQtPlotter
This example uses very simple code, which simply displays a plotter and shows some data. The important part of this example is the ´CMakeLists.txt`-file:
```
# set minimum required CMake-Version
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.23)
# set Project name
set(EXAMPLE_NAME simpletest)
set(EXENAME jkqtptest_${EXAMPLE_NAME})
project(${EXAMPLE_NAME} LANGUAGES CXX)
project(simpletest_cmake LANGUAGES CXX)
# some basic configurations
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 11) # for Qt5
#set(CMAKE_CXX_STANDARD 17) # for QT6
#set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# Configure project for usage of Qt5/Qt6
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGl REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGL REQUIRED)
# include JKQTPlotter
find_package(JKQTCommonLib REQUIRED)
find_package(JKQTMathTextLib REQUIRED)
find_package(JKQTPlotterLib REQUIRED)
find_package(JKQTPlotter${QT_VERSION_MAJOR} REQUIRED)
# For Visual Studio, we need to set some additional compiler options
if(MSVC)
@ -41,27 +35,49 @@ This example uses very simple code, which simply displays a plotter and shows so
endif()
# add the example executable
add_executable(${EXENAME} WIN32 simpletest.cpp)
# ... link against Qt5 and JKQTPlotterLib
add_executable(${PROJECT_NAME} WIN32 simpletest.cpp)
# ... link against Qt5/6 and JKQTPlotterLib
# (you could use JKQTPlotterSharedLib if you don't want to link againast the
# static version, but against the shared/DLL version).
target_link_libraries(${EXENAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::PrintSupport Qt5::Svg Qt5::Xml JKQTPlotterLib)
target_link_libraries(${PROJECT_NAME} Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::PrintSupport Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Xml)
# ... link against JKQTPlotter: As the Targets contain the Qt-Version-Number in their names, we can
# link against 'JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR}' and it works
# for Qt5 AND Qt6 ...
# if you have a speific Qt-Version, you can also write e.g. 'JKQTPlotter6::JKQTPlotter6'
target_link_libraries(${PROJECT_NAME} JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR})
# Installation
install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
#Installation of Qt DLLs on Windows
include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/jkqtplotter_deployqt.cmake)
jkqtplotter_deployqt(${EXENAME})
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
```
The important steps here are
```
# find JKQTPlotter
find_package(JKQTPlotter${QT_VERSION_MAJOR} REQUIRED)
# ...
# link against JKQtPlotter:
target_link_libraries(${EXENAME} JKQTPlotter${QT_VERSION_MAJOR}::JKQTPlotter${QT_VERSION_MAJOR})
```
We are using `${QT_VERSION_MAJOR}` here, as this file is supposed to work with both Qt5 AND Qt6. If you only use say Qt6, you can also write:
```
find_package(JKQTPlotter6 REQUIRED)
target_link_libraries(${EXENAME} JKQTPlotter6::JKQTPlotter6)
```
To build this example, you first need to make a subdirectory `build` and then call CMake form that subdirectory:
```.sh
$ mkdir build
$ cd build
$ cmake .. -G "<GENERATOR>" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources> -DCMAKE_MODULE_PATH=<path_to_lib/cmake_dir_of_JKQTPLOTTER>"
$ cmake .. -G "<GENERATOR>" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources>;<path_to_JKQTPlotter_installdir>"
```
The you can use the generated makefiles (e.g. load them in an editor, or build them jsing `make`). In the last line above, you need to specify two directories:
- `<path_to_your_qt_sources>` points to you Qt installation
- `<path_to_lib/cmake_dir_of_JKQTPLOTTER>` points to the directory containing the `XYZ.cmake`-files from the JKQTPlotter build. Typically this is `<JKQTPLOTTER_INSTALL_DIR>/lib/cmake`, where `<JKQTPLOTTER_INSTALL_DIR>` is the directory into which you installed JKQTPlotter.
- `<path_to_JKQTPlotter_installdir>` points to the directory containing the JKQTPlotter build. Typically this is will conatin a subdirectory`<JKQTPLOTTER_INSTALL_DIR>/lib/cmake/JKQtPlottr6` with all necessary CMake-scripts. Here `<JKQTPLOTTER_INSTALL_DIR>` is the directory into which you installed JKQTPlotter.

View File

@ -4,7 +4,6 @@
* \ref JKQTCMakeLinkExample
*/
#include "jkqtpexampleapplication.h"
#include <QApplication>
#include "jkqtplotter/jkqtplotter.h"
#include "jkqtplotter/graphs/jkqtpscatter.h"

View File

@ -15,11 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,11 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -18,11 +18,7 @@ if(CImg_FOUND)
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
target_link_libraries(${EXENAME} CImg::CImg)
# precomiled headers to speed up compilation

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -18,11 +18,7 @@ if(OpenCV_FOUND)
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
include_directories(${EXENAME} ${OpenCV_INCLUDE_DIRS} )
target_link_libraries(${EXENAME} ${OpenCV_LIBS} )

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -17,11 +17,8 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTFastPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTFastPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTFastPlotter${jkqtplotter_LIBNAME_VERSION_PART})

View File

@ -16,11 +16,8 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTMathTextLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTMathTextSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTMathText${jkqtplotter_LIBNAME_VERSION_PART})

View File

@ -2,23 +2,8 @@
JKQTMathText is a hand-written LaTeX-renderer for Qt (implemented in native C++, using Qt). It supports a large set of standard LaTeX markup and can render it to a QPainter.
This project (see `./examples/jkqtmathtext_simpletest/`) simply creates a QLabel (as a new window) that displays a rendered LaTeX equation (here the time-dependent Schrödinger equation).
The QMake project looks like this (see [`jkqtmathtext_simpletest.pro`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.pro):
```.qmake
# include JKQTMathText source-code, including the open-source XITS fonts
include(../../lib/jkqtmathtext_with_xits.pri)
SOURCES += jkqtmathtext_simpletest.cpp
# if you don't want to use the XITS fonts, use this line (and uncomment the
# last two line!):
#include(../../lib/jkqtmathtext.pri)
CONFIG += qt
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
TARGET = jkqtmathtext_simpletest
```
And the source code of the main application is (see [`jkqtmathtext_simpletest.cpp`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.cpp):
The source code of the main application is (see [`jkqtmathtext_simpletest.cpp`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.cpp):
```.cpp
#include <QApplication>
#include <QLabel>

View File

@ -17,11 +17,7 @@ set(UIS testform.ui )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTMathTextLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTMathTextSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTMathText${jkqtplotter_LIBNAME_VERSION_PART})

View File

@ -24,12 +24,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
# precomiled headers to speed up compilation

View File

@ -1,22 +1,12 @@
cmake_minimum_required(VERSION 3.15)
set(libBasename JKQTPExampleTools)
set(lib_name ${libBasename}Lib)
message( STATUS "-- Building ${lib_name}" )
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# Set up source files
set(SOURCES
${CMAKE_CURRENT_LIST_DIR}/jkqtpexampleapplication.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpappsettingcontroller.cpp
)
set(HEADERS
${CMAKE_CURRENT_LIST_DIR}/jkqtpexampleapplication.h
${CMAKE_CURRENT_LIST_DIR}/jkqtpappsettingcontroller.h
)
include(CMakePackageConfigHelpers)
@ -45,13 +35,16 @@ endfunction()
add_library(${lib_name} STATIC ${SOURCES} ${RESOURCES} ${HEADERS})
jkqtpexampletools_setDefaultLibOptions(${lib_name})
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${lib_name} PUBLIC JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${lib_name} PUBLIC JKQTPlotterSharedLib)
endif()
target_link_libraries(${lib_name} PUBLIC ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion )
target_sources(${lib_name}
PUBLIC
jkqtpexampleapplication.h
jkqtpappsettingcontroller.h
PRIVATE
jkqtpexampleapplication.cpp
jkqtpappsettingcontroller.cpp
)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -16,13 +16,7 @@ set(UIS mandelbrotmainwindow.ui)
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
target_link_libraries(${EXENAME} Threads::Threads)
# precomiled headers to speed up compilation

View File

@ -15,13 +15,7 @@ set(UIS test_multiplot_ui.ui )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -16,12 +16,7 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,12 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -18,11 +18,7 @@ if(CImg_FOUND)
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
target_link_libraries(${EXENAME} CImg::CImg)
# precomiled headers to speed up compilation

View File

@ -18,11 +18,7 @@ if (OpenCV_FOUND)
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
include_directories(${EXENAME} ${OpenCV_INCLUDE_DIRS} )
target_link_libraries(${EXENAME} ${OpenCV_LIBS} )

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,12 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h)

View File

@ -15,12 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h)

View File

@ -15,11 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,12 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h)

View File

@ -1,44 +1,7 @@
# Example (JKQTPlotter): Very simple line-graph {#JKQTPlotterSimpleTest}
This project (see `./examples/simpletest/`) simply creates a JKQTPlotter widget (as a new window) and adds a single line-graph (a sine-wave). Data is initialized from two QVector<double> objects.
The QMake project looks like this (see [`jkqtplotter_simpletest.pro`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest/jkqtplotter_simpletest.pro):
```.qmake
# source code for this simple demo
SOURCES = jkqtplotter_simpletest.cpp
# configure Qt
CONFIG += qt
QT += core gui xml svg
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
# output executable name
TARGET = jkqtplotter_simpletest
# include JKQTPlotter source headers and link against library
DEPENDPATH += ../../lib ../../qmake/staticlib/jkqtplotterlib
INCLUDEPATH += ../../lib
CONFIG (debug, debug|release) {
LIBS += -L../../qmake/staticlib/jkqtplotterlib/debug -ljkqtplotterlib_debug
} else {
LIBS += -L../../qmake/staticlib/jkqtplotterlib/release -ljkqtplotterlib
}
```
Alternatively to linking agains a `libjkqtplotter`, you can also directy add the JKQTPlotter sources to the project:
```.qmake
# source code for this simple demo
SOURCES = jkqtplotter_simpletest.cpp
# configure Qt
CONFIG += qt
QT += core gui svg
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
# output executable name
TARGET = jkqtplotter_simpletest
# include JKQTPlotter source code
include(../../lib/jkqtplotter.pri)
```
The source code of the main application is (see [`jkqtplotter_simpletest.cpp`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest/jkqtplotter_simpletest.cpp):
```.cpp
#include <QApplication>

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS test_styling.ui )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS formwithjkqtplotter.ui )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -16,45 +16,7 @@ For this to work you have to follow the steps shown below:
# QMake-Project of this example
The QMake project for such a project looks like this (see [`ui.pro`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/ui/ui.pro):
```.qmake
# source code for this simple demo
SOURCES = ui.cpp \
formwithjkqtplotter.cpp
FORMS += formwithjkqtplotter.ui
HEADERS += formwithjkqtplotter.h
# configure Qt
CONFIG += qt
QT += core gui xml svg
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
# output executable name
TARGET = ui
# include JKQTPlotter source headers and link against library
DEPENDPATH += ../../lib ../../qmake/staticlib/jkqtplotterlib
INCLUDEPATH += ../../lib
CONFIG (debug, debug|release) {
LIBS += -L../../qmake/staticlib/jkqtplotterlib/debug -ljkqtplotterlib_debug
} else {
LIBS += -L../../qmake/staticlib/jkqtplotterlib/release -ljkqtplotterlib
}
message("LIBS = $$LIBS")
win32-msvc*: DEFINES += _USE_MATH_DEFINES
win32-msvc*: DEFINES += NOMINMAX
```
As you can see there is a main CPP-file (shown below) and a `formwithjkqtplotter.ui`-file with the `formwithjkqtplotter.cpp/.h`-files that are used to implement the functionality behind the form (see next chapter).
In the example, there is a main CPP-file (shown below) and a `formwithjkqtplotter.ui`-file with the `formwithjkqtplotter.cpp/.h`-files that are used to implement the functionality behind the form (see next chapter).
The source code of the main application is simply instanciating the Form class `FormWithJKQTPlotter` from `formwithjkqtplotter.ui/.h/.cpp`:
```.cpp

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -15,13 +15,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_link_libraries(${EXENAME} JKQTPExampleToolsLib)
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.23)
@ -9,8 +9,9 @@ message( STATUS "===============================================================
message( STATUS "Version: ${PROJECT_VERSION}")
message( STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message( STATUS "Build types: ${CMAKE_CONFIGURATION_TYPES}")
message( STATUS "Build shared lib: ${BUILD_SHARED_LIBS}")
message( STATUS "Using CMake: ${CMAKE_VERSION}")
message( STATUS " Generator: ${CMAKE_GENERATOR}")
message( STATUS "Using CMake Generator: ${CMAKE_GENERATOR}")
message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}, platform: ${CMAKE_CXX_PLATFORM_ID}" )
message( STATUS "C++ Standard: C++ ${JKQtPlotter_QT_CXX_STANDARD}, required: ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED}" )
message( STATUS "LIB-Architecture: CXX: ${CMAKE_CXX_LIBRARY_ARCHITECTURE} / BASE: ${CMAKE_LIBRARY_ARCHITECTURE}" )
@ -44,6 +45,26 @@ if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)
else()
message( STATUS "Precompiled Header: OFF")
endif()
if (JKQtPlotter_BUILD_LIB_JKQTMATH)
message( STATUS "build JKQTMath: ON" )
else()
message( STATUS "build JKQTMath: OFF")
endif()
if (JKQtPlotter_BUILD_LIB_JKQTMATHTEXT)
message( STATUS "build JKQTMathText: ON" )
else()
message( STATUS "build JKQTMathText: OFF")
endif()
if (JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER)
message( STATUS "build JKQTFastPlotter: ON" )
else()
message( STATUS "build JKQTFastPlotter: OFF")
endif()
if (JKQtPlotter_BUILD_LIB_JKQTPLOTTER)
message( STATUS "build JKQTPlotter: ON" )
else()
message( STATUS "build JKQTPlotter: OFF")
endif()
message( STATUS "Installing to: ${CMAKE_INSTALL_PREFIX}" )
message( STATUS "=============================================================================" )
message( STATUS )
@ -56,13 +77,26 @@ message( STATUS "...............................................................
set(JKQTPLOTTER_VERSION_FILE_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(JKQTPLOTTER_VERSION_FILE ${JKQTPLOTTER_VERSION_FILE_DIR}/jkqtplotter_version.h)
configure_file(${CMAKE_CURRENT_LIST_DIR}/jkqtplotter_version.h.in
${JKQTPLOTTER_VERSION_FILE})
configure_file(${CMAKE_CURRENT_LIST_DIR}/jkqtplotter_version.h.in ${JKQTPLOTTER_VERSION_FILE})
include_directories(.)
# this library is the base for ALL other libraries, so it is always built!
add_subdirectory(jkqtcommon)
# all other libraries are built only, when activated by CMake options
if (JKQtPlotter_BUILD_LIB_JKQTMATH)
add_subdirectory(jkqtmath)
endif()
if (JKQtPlotter_BUILD_LIB_JKQTMATHTEXT)
add_subdirectory(jkqtmathtext)
endif()
if (JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER)
add_subdirectory(jkqtfastplotter)
endif()
if (JKQtPlotter_BUILD_LIB_JKQTPLOTTER)
add_subdirectory(jkqtplotter)
endif()

View File

@ -1,142 +1,57 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.23)
set(libBasename JKQTCommon)
set(libIncludeSubdir jkqtcommon)
set(libBaseName JKQTCommon)
set(lib_name ${libBaseName}${jkqtplotter_LIBNAME_VERSION_PART})
if(JKQtPlotter_BUILD_SHARED_LIBS)
set(libsh_name ${libBasename}SharedLib)
set(libsh_name_decorated ${libsh_name}${JKQtPlotter_LIBNAME_ADDITION})
set(${libBasename}_SHARED_LIBRARY ${libsh_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE)
message( STATUS "-- Building ${libsh_name}" )
endif(JKQtPlotter_BUILD_SHARED_LIBS)
if(JKQtPlotter_BUILD_STATIC_LIBS)
set(lib_name ${libBasename}Lib)
set(lib_name_decorated ${lib_name}${JKQtPlotter_LIBNAME_ADDITION})
set(${libBasename}_STATIC_LIBRARY ${lib_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE)
message( STATUS "-- Building ${lib_name}" )
endif(JKQtPlotter_BUILD_STATIC_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS
jkqtplotter_add_library(${lib_name} )
# Set up source files
set(SOURCES
${CMAKE_CURRENT_LIST_DIR}/jkqtpdebuggingtools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpmathtools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpstringtools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpcodestructuring.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpbasicimagetools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpconcurrencytools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpcachingtools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpgeometrytools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpdrawingtools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpenhancedpainter.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtphighrestimer.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqttools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpicons.cpp
# set all default library options
jkqtplotter_setDefaultLibOptions(${lib_name} ${libBaseName} "${CMAKE_CURRENT_LIST_DIR}/private/jkqtcommon_precomp.h")
# DEPENDENCIES: Qt
target_link_libraries(${lib_name} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::Widgets)
# add source files
target_sources(${lib_name} PRIVATE
jkqtpdebuggingtools.cpp
jkqtpmathtools.cpp
jkqtpstringtools.cpp
jkqtpcodestructuring.cpp
jkqtpbasicimagetools.cpp
jkqtpconcurrencytools.cpp
jkqtpcachingtools.cpp
jkqtpgeometrytools.cpp
jkqtpdrawingtools.cpp
jkqtpenhancedpainter.cpp
jkqtphighrestimer.cpp
jkqttools.cpp
jkqtpicons.cpp
)
set(HEADERS
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtcommon_imexport.h>
$<INSTALL_INTERFACE:jkqtcommon_imexport.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpdebuggingtools.h>
$<INSTALL_INTERFACE:jkqtpdebuggingtools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpmathtools.h>
$<INSTALL_INTERFACE:jkqtpmathtools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpstringtools.h>
$<INSTALL_INTERFACE:jkqtpstringtools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpcodestructuring.h>
$<INSTALL_INTERFACE:jkqtpcodestructuring.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpbasicimagetools.h>
$<INSTALL_INTERFACE:jkqtpbasicimagetools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpdrawingtools.h>
$<INSTALL_INTERFACE:jkqtpdrawingtools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpenhancedpainter.h>
$<INSTALL_INTERFACE:jkqtpenhancedpainter.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtphighrestimer.h>
$<INSTALL_INTERFACE:jkqtphighrestimer.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqttools.h>
$<INSTALL_INTERFACE:jkqttools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpicons.h>
$<INSTALL_INTERFACE:jkqtpicons.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpgeometrytools.h>
$<INSTALL_INTERFACE:jkqtpgeometrytools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpconcurrencytools.h>
$<INSTALL_INTERFACE:jkqtpconcurrencytools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpcachingtools.h>
$<INSTALL_INTERFACE:jkqtpcachingtools.h>
# ... and add headers
target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS
FILES
jkqtcommon_imexport.h
jkqtpdebuggingtools.h
jkqtpmathtools.h
jkqtpstringtools.h
jkqtpcodestructuring.h
jkqtpbasicimagetools.h
jkqtpdrawingtools.h
jkqtpenhancedpainter.h
jkqtphighrestimer.h
jkqttools.h
jkqtpicons.h
jkqtpgeometrytools.h
jkqtpconcurrencytools.h
jkqtpcachingtools.h
)
include(CMakePackageConfigHelpers)
function(JKQtCommon_setDefaultLibOptions TARGETNAME)
set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}")
target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::Widgets)
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD})
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED})
target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE})
if(MINGW)
# COMPILER-SETTINGS FOR MINGW
target_compile_options(${TARGETNAME} PUBLIC -fexceptions)
elseif(MSVC)
# COMPILER-SETTINGS FOR MS VISUAL C++
target_compile_options(${TARGETNAME} PUBLIC /EHsc)
target_compile_definitions(${TARGETNAME} PUBLIC NOMINMAX)
endif()
if(JKQtPlotter_BUILD_WITH_TIMING_INFO_OUTPUT)
target_compile_definitions(${TARGETNAME} PRIVATE JKQTBP_AUTOTIMER)
endif()
target_include_directories(${TARGETNAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)
target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtcommon_precomp.h)
target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtcommon_precomp.h)
endif(JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)
endfunction()
if(JKQtPlotter_BUILD_SHARED_LIBS)
add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS} )
JKQtCommon_setDefaultLibOptions(${libsh_name})
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
target_compile_definitions(${libsh_name} PUBLIC JKQTCOMMON_LIB_IN_DLL)
target_compile_definitions(${libsh_name} PRIVATE JKQTCOMMON_LIB_EXPORT_LIBRARY)
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}
COMPATIBILITY AnyNewerVersion )
endif()
if(JKQtPlotter_BUILD_STATIC_LIBS)
add_library(${lib_name} STATIC ${SOURCES} ${HEADERS})
JKQtCommon_setDefaultLibOptions(${lib_name})
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion )
endif()
# Installation
if(JKQtPlotter_BUILD_SHARED_LIBS)
jkqtplotter_installlibrary(${libsh_name} ${libIncludeSubdir} "Shared")
endif(JKQtPlotter_BUILD_SHARED_LIBS)
if(JKQtPlotter_BUILD_STATIC_LIBS)
jkqtplotter_installlibrary(${lib_name} ${libIncludeSubdir} "")
endif(JKQtPlotter_BUILD_STATIC_LIBS)
install(FILES ${HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
COMPONENT Headers)
jkqtplotter_installlibrary_new(${lib_name} ${libBaseName} ${CMAKE_CURRENT_LIST_DIR})
configure_file(${PROJECT_SOURCE_DIR}/readme.txt.in ${CMAKE_CURRENT_BINARY_DIR}/${libBasename}_Readme.txt @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libBasename}_Readme.txt" DESTINATION doc/JKQtPlotter )
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION doc/JKQtPlotter RENAME "${libBasename}_LICENSE.txt" )

View File

@ -1,102 +1,36 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.23)
set(libBasename JKQTFastPlotter)
set(libIncludeSubdir jkqtfastplotter)
set(libBaseName JKQTFastPlotter)
set(lib_name ${libBaseName}${jkqtplotter_LIBNAME_VERSION_PART})
if(JKQtPlotter_BUILD_SHARED_LIBS)
set(libsh_name ${libBasename}SharedLib)
set(libsh_name_decorated ${libsh_name}${JKQtPlotter_LIBNAME_ADDITION})
set(${libBasename}_SHARED_LIBRARY ${libsh_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE)
message( STATUS "-- Building ${libsh_name}" )
endif(JKQtPlotter_BUILD_SHARED_LIBS)
if(JKQtPlotter_BUILD_STATIC_LIBS)
set(lib_name ${libBasename}Lib)
set(lib_name_decorated ${lib_name}${JKQtPlotter_LIBNAME_ADDITION})
set(${libBasename}_STATIC_LIBRARY ${lib_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE)
message( STATUS "-- Building ${lib_name}" )
endif(JKQtPlotter_BUILD_STATIC_LIBS)
message(WARNING "-- You are building the sub-library JKQTFastPlotter, which is DEPRECTAED and may be removed in future!")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS
jkqtplotter_add_library(${lib_name} )
# Set up source files
set(SOURCES
${CMAKE_CURRENT_LIST_DIR}/jkqtfastplotter.cpp
)
# set all default library options
jkqtplotter_setDefaultLibOptions(${lib_name} ${libBaseName} "")
set(HEADERS
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtfastplotter.h>
$<INSTALL_INTERFACE:jkqtfastplotter.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtfastplotter_imexport.h>
$<INSTALL_INTERFACE:jkqtfastplotter_imexport.h>
)
include(CMakePackageConfigHelpers)
function(JKQtFastPlotter_setDefaultLibOptions TARGETNAME)
set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}")
target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::OpenGL Qt${QT_VERSION_MAJOR}::Widgets)
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD})
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED})
target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE})
# DEPENDENCIES: Qt
target_link_libraries(${lib_name} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::OpenGL Qt${QT_VERSION_MAJOR}::Widgets)
if(${QT_VERSION_MAJOR} VERSION_GREATER_EQUAL "6")
target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
target_link_libraries(${lib_name} PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
endif()
target_link_libraries(${lib_name} PUBLIC ${jkqtplotter_namespace}JKQTCommon${jkqtplotter_LIBNAME_VERSION_PART})
if(MINGW)
# COMPILER-SETTINGS FOR MINGW
target_compile_options(${TARGETNAME} PUBLIC -fexceptions)
elseif(MSVC)
# COMPILER-SETTINGS FOR MS VISUAL C++
target_compile_options(${TARGETNAME} PUBLIC /EHsc)
target_compile_definitions(${TARGETNAME} PUBLIC NOMINMAX)
endif()
target_include_directories(${TARGETNAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
# add source files
target_sources(${lib_name} PRIVATE
jkqtfastplotter.cpp
)
# ... and add headers
target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS
FILES
jkqtfastplotter_imexport.h
jkqtfastplotter.h
)
endfunction()
if(JKQtPlotter_BUILD_SHARED_LIBS)
add_library(${libsh_name} SHARED ${SOURCES} ${RESOURCES} ${HEADERS})
JKQtFastPlotter_setDefaultLibOptions(${libsh_name})
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
target_link_libraries(${libsh_name} PUBLIC JKQTCommonSharedLib)
target_compile_definitions(${libsh_name} PUBLIC JKQTFASTPLOTTER_LIB_IN_DLL)
target_compile_definitions(${libsh_name} PRIVATE JKQTFASTPLOTTER_LIB_EXPORT_LIBRARY)
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}
COMPATIBILITY AnyNewerVersion )
endif()
if(JKQtPlotter_BUILD_STATIC_LIBS)
add_library(${lib_name} STATIC ${SOURCES} ${RESOURCES} ${HEADERS})
JKQtFastPlotter_setDefaultLibOptions(${lib_name})
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
target_link_libraries(${lib_name} PUBLIC JKQTCommonLib)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion )
endif()
# Installation
if(JKQtPlotter_BUILD_SHARED_LIBS)
jkqtplotter_installlibrary(${libsh_name} ${libIncludeSubdir} "Shared")
endif(JKQtPlotter_BUILD_SHARED_LIBS)
if(JKQtPlotter_BUILD_STATIC_LIBS)
jkqtplotter_installlibrary(${lib_name} ${libIncludeSubdir} "")
endif(JKQtPlotter_BUILD_STATIC_LIBS)
install(FILES ${HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
COMPONENT Headers)
configure_file(${PROJECT_SOURCE_DIR}/readme.txt.in ${CMAKE_CURRENT_BINARY_DIR}/${libBasename}_Readme.txt @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libBasename}_Readme.txt" DESTINATION doc/JKQtPlotter )
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION doc/JKQtPlotter RENAME "${libBasename}_LICENSE.txt" )
jkqtplotter_installlibrary_new(${lib_name} ${libBaseName} ${CMAKE_CURRENT_LIST_DIR})

View File

@ -11,7 +11,7 @@ find_package(Qt@QT_VERSION_MAJOR@ COMPONENTS Core Gui Widgets OpenGL REQUIRED)
if(${QT_VERSION_MAJOR} VERSION_GREATER_EQUAL "6")
find_package(Qt@QT_VERSION_MAJOR@ REQUIRED COMPONENTS OpenGLWidgets)
endif()
find_package(JKQTCommon@JKQTP_CURRENT_TARGET_SHAREDPART@Lib REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
find_package(JKQTCommon@jkqtplotter_LIBNAME_VERSION_PART@ REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
# include auto-generated targets.cmake file
include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@")

View File

@ -1,143 +1,52 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.23)
set(libBasename JKQTMath)
set(oldlibBasename JKQTCommonStatisticsAndMath)
set(libIncludeSubdir jkqtmath)
set(libBaseName JKQTMath)
set(lib_name ${libBaseName}${jkqtplotter_LIBNAME_VERSION_PART})
if(JKQtPlotter_BUILD_SHARED_LIBS)
set(libsh_name ${libBasename}SharedLib)
set(libsh_name_decorated ${libsh_name}${JKQtPlotter_LIBNAME_ADDITION})
set(oldlibsh_name ${oldlibBasename}SharedLib)
set(oldlibsh_name_decorated ${oldlibsh_name}${JKQtPlotter_LIBNAME_ADDITION})
set(${libBasename}_SHARED_LIBRARY ${libsh_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE)
message( STATUS "-- Building ${libsh_name}" )
endif(JKQtPlotter_BUILD_SHARED_LIBS)
if(JKQtPlotter_BUILD_STATIC_LIBS)
set(lib_name ${libBasename}Lib)
set(lib_name_decorated ${lib_name}${JKQtPlotter_LIBNAME_ADDITION})
set(oldlib_name ${oldlibBasename}Lib)
set(oldlib_name_decorated ${oldlib_name}${JKQtPlotter_LIBNAME_ADDITION})
set(${libBasename}_STATIC_LIBRARY ${lib_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE)
message( STATUS "-- Building ${lib_name}" )
endif(JKQtPlotter_BUILD_STATIC_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS
jkqtplotter_add_library(${lib_name} )
# Set up source files
set(SOURCES
${CMAKE_CURRENT_LIST_DIR}/jkqtpalgorithms.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtplinalgtools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpmathparser.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtparraytools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpstatbasics.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpstathistogram.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpstatkde.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpstatregression.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpstatpoly.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpstatgrouped.cpp
# set all default library options
jkqtplotter_setDefaultLibOptions(${lib_name} ${libBaseName} "${CMAKE_CURRENT_LIST_DIR}/private/jkqtmath_precomp.h")
# DEPENDENCIES: Qt
target_link_libraries(${lib_name} PUBLIC Qt${QT_VERSION_MAJOR}::Core)
target_link_libraries(${lib_name} PUBLIC ${jkqtplotter_namespace}JKQTCommon${jkqtplotter_LIBNAME_VERSION_PART})
# add source files
target_sources(${lib_name} PRIVATE
jkqtpalgorithms.cpp
jkqtplinalgtools.cpp
jkqtpmathparser.cpp
jkqtparraytools.cpp
jkqtpstatbasics.cpp
jkqtpstathistogram.cpp
jkqtpstatkde.cpp
jkqtpstatregression.cpp
jkqtpstatpoly.cpp
jkqtpstatgrouped.cpp
)
# ... and add headers
target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS
FILES
jkqtmath_imexport.h
jkqtpalgorithms.h
jkqtplinalgtools.h
jkqtpmathparser.h
jkqtparraytools.h
jkqtpstatisticstools.h
jkqtpstatbasics.h
jkqtpstathistogram.h
jkqtpstatkde.h
jkqtpstatregression.h
jkqtpstatpoly.h
jkqtpstatgrouped.h
set(HEADERS
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtmath_imexport.h>
$<INSTALL_INTERFACE:jkqtmath_imexport.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpalgorithms.h>
$<INSTALL_INTERFACE:jkqtpalgorithms.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtplinalgtools.h>
$<INSTALL_INTERFACE:jkqtplinalgtools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpmathparser.h>
$<INSTALL_INTERFACE:jkqtpmathparser.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtparraytools.h>
$<INSTALL_INTERFACE:jkqtparraytools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpstatisticstools.h>
$<INSTALL_INTERFACE:jkqtpstatisticstools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpstatbasics.h>
$<INSTALL_INTERFACE:jkqtpstatbasics.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpstathistogram.h>
$<INSTALL_INTERFACE:jkqtpstathistogram.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpstatkde.h>
$<INSTALL_INTERFACE:jkqtpstatkde.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpstatregression.h>
$<INSTALL_INTERFACE:jkqtpstatregression.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpstatpoly.h>
$<INSTALL_INTERFACE:jkqtpstatpoly.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpstatgrouped.h>
$<INSTALL_INTERFACE:jkqtpstatgrouped.h>
)
include(CMakePackageConfigHelpers)
function(JKQtCommon_setDefaultLibOptions TARGETNAME)
set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}")
target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core )
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD})
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED})
target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE})
if(MINGW)
# COMPILER-SETTINGS FOR MINGW
target_compile_options(${TARGETNAME} PUBLIC -fexceptions)
elseif(MSVC)
# COMPILER-SETTINGS FOR MS VISUAL C++
target_compile_options(${TARGETNAME} PUBLIC /EHsc)
target_compile_definitions(${TARGETNAME} PUBLIC NOMINMAX)
endif()
if(JKQtPlotter_BUILD_WITH_TIMING_INFO_OUTPUT)
target_compile_definitions(${TARGETNAME} PRIVATE JKQTBP_AUTOTIMER)
endif()
target_include_directories(${TARGETNAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)
target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtmath_precomp.h)
target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtmath_precomp.h)
endif(JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)
endfunction()
if(JKQtPlotter_BUILD_SHARED_LIBS)
add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS} )
JKQtCommon_setDefaultLibOptions(${libsh_name})
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
target_compile_definitions(${libsh_name} PUBLIC jkqtmath_LIB_IN_DLL)
target_compile_definitions(${libsh_name} PRIVATE jkqtmath_LIB_EXPORT_LIBRARY)
target_link_libraries(${libsh_name} PUBLIC JKQTCommonSharedLib)
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}
COMPATIBILITY AnyNewerVersion )
add_library(${oldlibsh_name} ALIAS ${libsh_name})
endif()
if(JKQtPlotter_BUILD_STATIC_LIBS)
add_library(${lib_name} STATIC ${SOURCES} ${HEADERS})
JKQtCommon_setDefaultLibOptions(${lib_name})
target_link_libraries(${lib_name} PUBLIC JKQTCommonLib)
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion )
add_library(${oldlib_name} ALIAS ${lib_name})
endif()
# Installation
if(JKQtPlotter_BUILD_SHARED_LIBS)
jkqtplotter_installlibrary(${libsh_name} ${libIncludeSubdir} "Shared")
endif(JKQtPlotter_BUILD_SHARED_LIBS)
jkqtplotter_installlibrary_new(${lib_name} ${libBaseName} ${CMAKE_CURRENT_LIST_DIR})
if(JKQtPlotter_BUILD_STATIC_LIBS)
jkqtplotter_installlibrary(${lib_name} ${libIncludeSubdir} "")
endif(JKQtPlotter_BUILD_STATIC_LIBS)
install(FILES ${HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
COMPONENT Headers)
configure_file(${PROJECT_SOURCE_DIR}/readme.txt.in ${CMAKE_CURRENT_BINARY_DIR}/${libBasename}_Readme.txt @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libBasename}_Readme.txt" DESTINATION doc/JKQtPlotter )
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION doc/JKQtPlotter RENAME "${libBasename}_LICENSE.txt" )

View File

@ -8,6 +8,7 @@
# package requires Qt 5/6
find_package(Qt@QT_VERSION_MAJOR@ COMPONENTS Core REQUIRED)
find_package(JKQTCommon@jkqtplotter_LIBNAME_VERSION_PART@ REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
# include auto-generated targets.cmake file
include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@")

View File

@ -1,214 +1,40 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.23)
set(libBasename JKQTMathText)
set(libIncludeSubdir jkqtmathtext)
set(libBaseName JKQTMathText)
set(lib_name ${libBaseName}${jkqtplotter_LIBNAME_VERSION_PART})
if(JKQtPlotter_BUILD_SHARED_LIBS)
set(libsh_name ${libBasename}SharedLib)
set(libsh_name_decorated ${libsh_name}${JKQtPlotter_LIBNAME_ADDITION})
set(${libBasename}_SHARED_LIBRARY ${libsh_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE)
message( STATUS "-- Building ${libsh_name}" )
endif(JKQtPlotter_BUILD_SHARED_LIBS)
if(JKQtPlotter_BUILD_STATIC_LIBS)
set(lib_name ${libBasename}Lib)
set(lib_name_decorated ${lib_name}${JKQtPlotter_LIBNAME_ADDITION})
set(${libBasename}_STATIC_LIBRARY ${lib_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE)
message( STATUS "-- Building ${lib_name}" )
endif(JKQtPlotter_BUILD_STATIC_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS
jkqtplotter_add_library(${lib_name} )
# Set up source files
set(SOURCES
${CMAKE_CURRENT_LIST_DIR}/jkqtmathtext.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtmathtexttools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtmathtextlabel.cpp
# set all default library options
jkqtplotter_setDefaultLibOptions(${lib_name} ${libBaseName} "${CMAKE_CURRENT_LIST_DIR}/private/jkqtmathtext_precomp.h")
# DEPENDENCIES: Qt
target_link_libraries(${lib_name} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets)
target_link_libraries(${lib_name} PUBLIC ${jkqtplotter_namespace}JKQTCommon${jkqtplotter_LIBNAME_VERSION_PART})
# add source files
target_sources(${lib_name} PRIVATE
jkqtmathtext.cpp
jkqtmathtexttools.cpp
jkqtmathtextlabel.cpp
)
# ... and add headers
target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS
FILES
jkqtmathtext.h
jkqtmathtexttools.h
jkqtmathtextlabel.h
jkqtmathtext_imexport.h
)
set(HEADERS
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtmathtext.h>
$<INSTALL_INTERFACE:jkqtmathtext.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtmathtexttools.h>
$<INSTALL_INTERFACE:jkqtmathtexttools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtmathtextlabel.h>
$<INSTALL_INTERFACE:jkqtmathtextlabel.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtmathtext_imexport.h>
$<INSTALL_INTERFACE:jkqtmathtext_imexport.h>
)
set(SOURCES_NODES
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtexttextnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextbracenode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextdecoratednode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextfracnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextinstructionnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextboxinstructionnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextmodifyenvironmentnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextverticallistnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtexthorizontallistnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextmatrixnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextsqrtnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextsubsupernode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextsymbolnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextnodetools.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextwhitespacenode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextnoopnode.cpp
${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextverbatimnode.cpp
)
set(HEADERS_NODES
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtexttextnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtexttextnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextboxinstructionnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextboxinstructionnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextmodifyenvironmentnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextmodifyenvironmentnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextbracenode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextbracenode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextdecoratednode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextdecoratednode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextfracnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextfracnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextinstructionnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextinstructionnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextlistnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextlistnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextverticallistnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextverticallistnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtexthorizontallistnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtexthorizontallistnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextmatrixnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextmatrixnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextsqrtnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextsqrtnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextsubsupernode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextsubsupernode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextsymbolnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextsymbolnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextnodetools.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextnodetools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextwhitespacenode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextwhitespacenode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextnoopnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextnoopnode.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes/jkqtmathtextverbatimnode.h>
$<INSTALL_INTERFACE:nodes/jkqtmathtextverbatimnode.h>
)
set(SOURCES_PARSERS
${CMAKE_CURRENT_LIST_DIR}/parsers/jkqtmathtextparser.cpp
${CMAKE_CURRENT_LIST_DIR}/parsers/jkqtmathtextlatexparser.cpp
)
set(HEADERS_PARSERS
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/parsers/jkqtmathtextparser.h>
$<INSTALL_INTERFACE:parsers/jkqtmathtextparser.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/parsers/jkqtmathtextlatexparser.h>
$<INSTALL_INTERFACE:parsers/jkqtmathtextlatexparser.h>
)
set(RESOURCES "")
if(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS)
list(APPEND RESOURCES ${CMAKE_CURRENT_LIST_DIR}/resources/xits.qrc )
endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS)
if(JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS)
list(APPEND RESOURCES ${CMAKE_CURRENT_LIST_DIR}/resources/firamath.qrc )
endif(JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS)
include(CMakePackageConfigHelpers)
function(JKQtMathText_setDefaultLibOptions TARGETNAME)
set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}")
target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets)
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD})
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED})
target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE})
if(MINGW)
# COMPILER-SETTINGS FOR MINGW
target_compile_options(${TARGETNAME} PUBLIC -fexceptions)
elseif(MSVC)
# COMPILER-SETTINGS FOR MS VISUAL C++
target_compile_options(${TARGETNAME} PUBLIC /EHsc)
target_compile_definitions(${TARGETNAME} PUBLIC NOMINMAX)
endif()
target_include_directories(${TARGETNAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
if(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS)
target_compile_definitions(${TARGETNAME} PRIVATE JKQTMATHTEXT_COMPILED_WITH_XITS)
endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS)
if(JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS)
target_compile_definitions(${TARGETNAME} PRIVATE JKQTMATHTEXT_COMPILED_WITH_FIRAMATH)
endif(JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS)
if(JKQtPlotter_BUILD_WITH_TIMING_INFO_OUTPUT)
target_compile_definitions(${TARGETNAME} PRIVATE JKQTBP_AUTOTIMER)
endif()
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)
target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtmathtext_precomp.h)
target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtmathtext_precomp.h)
endif(JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)
endfunction()
if(JKQtPlotter_BUILD_SHARED_LIBS)
add_library(${libsh_name} SHARED ${SOURCES} ${RESOURCES} ${HEADERS} ${SOURCES_NODES} ${HEADERS_NODES} ${SOURCES_PARSERS} ${HEADERS_PARSERS})
JKQtMathText_setDefaultLibOptions(${libsh_name})
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
target_link_libraries(${libsh_name} PUBLIC JKQTCommonSharedLib)
target_compile_definitions(${libsh_name} PUBLIC JKQTMATHTEXT_LIB_IN_DLL)
target_compile_definitions(${libsh_name} PRIVATE JKQTMATHTEXT_LIB_EXPORT_LIBRARY)
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}
COMPATIBILITY AnyNewerVersion )
endif()
if(JKQtPlotter_BUILD_STATIC_LIBS)
add_library(${lib_name} STATIC ${SOURCES} ${RESOURCES} ${HEADERS} ${SOURCES_NODES} ${HEADERS_NODES} ${SOURCES_PARSERS} ${HEADERS_PARSERS})
JKQtMathText_setDefaultLibOptions(${lib_name})
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
target_link_libraries(${lib_name} PUBLIC JKQTCommonLib)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion )
endif()
add_subdirectory(nodes)
add_subdirectory(parsers)
add_subdirectory(resources)
# Installation
if(JKQtPlotter_BUILD_SHARED_LIBS)
jkqtplotter_installlibrary(${libsh_name} ${libIncludeSubdir} "Shared")
endif(JKQtPlotter_BUILD_SHARED_LIBS)
jkqtplotter_installlibrary_new(${lib_name} ${libBaseName} ${CMAKE_CURRENT_LIST_DIR})
if(JKQtPlotter_BUILD_STATIC_LIBS)
jkqtplotter_installlibrary(${lib_name} ${libIncludeSubdir} "")
endif(JKQtPlotter_BUILD_STATIC_LIBS)
install(FILES ${HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
COMPONENT Headers)
install(FILES ${HEADERS_NODES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}/nodes
COMPONENT Headers)
install(FILES ${SOURCES_PARSERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}/parsers
COMPONENT Headers)
configure_file(${PROJECT_SOURCE_DIR}/readme.txt.in ${CMAKE_CURRENT_BINARY_DIR}/${libBasename}_Readme.txt @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libBasename}_Readme.txt" DESTINATION doc/JKQtPlotter )
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION doc/JKQtPlotter RENAME "${libBasename}_LICENSE.txt" )
install(FILES "${PROJECT_SOURCE_DIR}/lib/jkqtmathtext/resources/xits/OFL.txt" DESTINATION doc/JKQtPlotter RENAME "${libBasename}_XITS_LICENSE.txt" )
install(FILES "${PROJECT_SOURCE_DIR}/lib/jkqtmathtext/resources/xits/README.md" DESTINATION doc/JKQtPlotter RENAME "${libBasename}_XITS_README.md" )
install(FILES "${PROJECT_SOURCE_DIR}/lib/jkqtmathtext/resources/firaMath/LICENSE" DESTINATION doc/JKQtPlotter RENAME "${libBasename}_FIRAMATH_LICENSE" )
install(FILES "${PROJECT_SOURCE_DIR}/lib/jkqtmathtext/resources/firaMath/README.md" DESTINATION doc/JKQtPlotter RENAME "${libBasename}_FIRAMATH_README.md" )

View File

@ -9,7 +9,7 @@
# package requires Qt 5/6
find_package(Qt@QT_VERSION_MAJOR@ COMPONENTS Core Gui Widgets REQUIRED)
find_package(JKQTCommon@JKQTP_CURRENT_TARGET_SHAREDPART@Lib REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
find_package(JKQTCommon@jkqtplotter_LIBNAME_VERSION_PART@ REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
# include auto-generated targets.cmake file
include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@")

View File

@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 3.23)
# add source files
target_sources(${lib_name} PRIVATE
jkqtmathtextnode.cpp
jkqtmathtexttextnode.cpp
jkqtmathtextbracenode.cpp
jkqtmathtextdecoratednode.cpp
jkqtmathtextfracnode.cpp
jkqtmathtextinstructionnode.cpp
jkqtmathtextboxinstructionnode.cpp
jkqtmathtextmodifyenvironmentnode.cpp
jkqtmathtextverticallistnode.cpp
jkqtmathtexthorizontallistnode.cpp
jkqtmathtextmatrixnode.cpp
jkqtmathtextsqrtnode.cpp
jkqtmathtextsubsupernode.cpp
jkqtmathtextsymbolnode.cpp
jkqtmathtextnodetools.cpp
jkqtmathtextwhitespacenode.cpp
jkqtmathtextnoopnode.cpp
jkqtmathtextverbatimnode.cpp
)
# ... and add headers
target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS
FILES
jkqtmathtextnode.h
jkqtmathtexttextnode.h
jkqtmathtextboxinstructionnode.h
jkqtmathtextmodifyenvironmentnode.h
jkqtmathtextbracenode.h
jkqtmathtextdecoratednode.h
jkqtmathtextfracnode.h
jkqtmathtextinstructionnode.h
jkqtmathtextlistnode.h
jkqtmathtextverticallistnode.h
jkqtmathtexthorizontallistnode.h
jkqtmathtextmatrixnode.h
jkqtmathtextsqrtnode.h
jkqtmathtextsubsupernode.h
jkqtmathtextsymbolnode.h
jkqtmathtextnodetools.h
jkqtmathtextwhitespacenode.h
jkqtmathtextnoopnode.h
jkqtmathtextverbatimnode.h
)

View File

@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.23)
# add source files
target_sources(${lib_name} PRIVATE
jkqtmathtextparser.cpp
jkqtmathtextlatexparser.cpp
)
# ... and add headers
target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS
FILES
jkqtmathtextparser.h
jkqtmathtextlatexparser.h
)

View File

@ -0,0 +1,24 @@
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)

View File

@ -1,302 +1,80 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.23)
set(libBasename JKQTPlotter)
set(libIncludeSubdir jkqtplotter)
set(libBaseName JKQTPlotter)
set(lib_name ${libBaseName}${jkqtplotter_LIBNAME_VERSION_PART})
if(JKQtPlotter_BUILD_SHARED_LIBS)
set(libsh_name ${libBasename}SharedLib)
set(libsh_name_decorated ${libsh_name}${JKQtPlotter_LIBNAME_ADDITION})
set(${libBasename}_SHARED_LIBRARY ${libsh_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE)
message( STATUS "-- Building ${libsh_name}" )
endif(JKQtPlotter_BUILD_SHARED_LIBS)
if(JKQtPlotter_BUILD_STATIC_LIBS)
set(lib_name ${libBasename}Lib)
set(lib_name_decorated ${lib_name}${JKQtPlotter_LIBNAME_ADDITION})
set(${libBasename}_STATIC_LIBRARY ${lib_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE)
message( STATUS "-- Building ${lib_name}" )
endif(JKQtPlotter_BUILD_STATIC_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS
jkqtplotter_add_library(${lib_name} )
# Set up source files
set(SOURCES_BASE
${CMAKE_CURRENT_LIST_DIR}/jkqtptools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpbaseelements.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpbaseplotter.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpdatastorage.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpgraphsbase.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpgraphsbaseerrors.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpgraphsbasestylingmixins.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtplotter.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtplotterstyle.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpkeystyle.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpkey.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpbaseplotterstyle.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpcoordinateaxes.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpcoordinateaxesstyle.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpimagetools.cpp
${CMAKE_CURRENT_LIST_DIR}/jkqtpgraphsbasestyle.cpp
)
set(SOURCES_GRAPHS
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpscatter.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtprange.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpspecialline.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpbarchartbase.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpbarchart.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpboxplot.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpboxplotbase.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpboxplotstylingmixins.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpevaluatedfunctionbase.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpevaluatedfunction.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpfilledcurve.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpgeometric.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpgeoannotations.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpgeobase.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpgeolines.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpgeoshapes.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpimage.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpimpulses.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpparsedfunction.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtppeakstream.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpsinglecolumnsymbols.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpimageoverlays.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpcontour.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpimagergb.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpviolinplot.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpviolinplotstylingmixins.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpstatisticsadaptors.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpevaluatedparametriccurve.cpp
${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtplines.cpp
)
set(SOURCES_GUI
${CMAKE_CURRENT_LIST_DIR}/gui/jkqtpcomboboxes.cpp
${CMAKE_CURRENT_LIST_DIR}/gui/jkqtpenhancedspinboxes.cpp
${CMAKE_CURRENT_LIST_DIR}/gui/jkqtpenhancedtableview.cpp
${CMAKE_CURRENT_LIST_DIR}/gui/jkqtpgraphsmodel.cpp
${CMAKE_CURRENT_LIST_DIR}/gui/jkvanishqtoolbar.cpp
)
# set all default library options
jkqtplotter_setDefaultLibOptions(${lib_name} ${libBaseName} "${CMAKE_CURRENT_LIST_DIR}/private/jkqtplotter_precomp.h")
set(HEADERS_BASE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtptools.h>
$<INSTALL_INTERFACE:jkqtptools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpbaseelements.h>
$<INSTALL_INTERFACE:jkqtpbaseelements.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpbaseplotter.h>
$<INSTALL_INTERFACE:jkqtpbaseplotter.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpdatastorage.h>
$<INSTALL_INTERFACE:jkqtpdatastorage.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpgraphsbase.h>
$<INSTALL_INTERFACE:jkqtpgraphsbase.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpgraphsbaseerrors.h>
$<INSTALL_INTERFACE:jkqtpgraphsbaseerrors.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpgraphsbasestylingmixins.h>
$<INSTALL_INTERFACE:jkqtpgraphsbasestylingmixins.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtplotter.h>
$<INSTALL_INTERFACE:jkqtplotter.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtplotterstyle.h>
$<INSTALL_INTERFACE:jkqtplotterstyle.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpkeystyle.h>
$<INSTALL_INTERFACE:jkqtpkeystyle.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpkey.h>
$<INSTALL_INTERFACE:jkqtpkey.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpbaseplotterstyle.h>
$<INSTALL_INTERFACE:jkqtpbaseplotterstyle.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpcoordinateaxes.h>
$<INSTALL_INTERFACE:jkqtpcoordinateaxes.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpcoordinateaxesstyle.h>
$<INSTALL_INTERFACE:jkqtpcoordinateaxesstyle.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpimagetools.h>
$<INSTALL_INTERFACE:jkqtpimagetools.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtpgraphsbasestyle.h>
$<INSTALL_INTERFACE:jkqtpgraphsbasestyle.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtplotter_configmacros.h>
$<INSTALL_INTERFACE:jkqtplotter_configmacros.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/jkqtplotter_imexport.h>
$<INSTALL_INTERFACE:jkqtplotter_imexport.h>
)
set(HEADERS_GRAPHS
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpboxplot.h>
$<INSTALL_INTERFACE:graphs/jkqtpboxplot.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpboxplotbase.h>
$<INSTALL_INTERFACE:graphs/jkqtpboxplotbase.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpboxplotstylingmixins.h>
$<INSTALL_INTERFACE:graphs/jkqtpboxplotstylingmixins.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpevaluatedfunctionbase.h>
$<INSTALL_INTERFACE:graphs/jkqtpevaluatedfunctionbase.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpevaluatedfunction.h>
$<INSTALL_INTERFACE:graphs/jkqtpevaluatedfunction.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpfilledcurve.h>
$<INSTALL_INTERFACE:graphs/jkqtpfilledcurve.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpgeometric.h>
$<INSTALL_INTERFACE:graphs/jkqtpgeometric.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpgeoannotations.h>
$<INSTALL_INTERFACE:graphs/jkqtpgeoannotations.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpgeobase.h>
$<INSTALL_INTERFACE:graphs/jkqtpgeobase.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpgeolines.h>
$<INSTALL_INTERFACE:graphs/jkqtpgeolines.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpgeoshapes.h>
$<INSTALL_INTERFACE:graphs/jkqtpgeoshapes.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpimage.h>
$<INSTALL_INTERFACE:graphs/jkqtpimage.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpimpulses.h>
$<INSTALL_INTERFACE:graphs/jkqtpimpulses.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpparsedfunction.h>
$<INSTALL_INTERFACE:graphs/jkqtpparsedfunction.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtppeakstream.h>
$<INSTALL_INTERFACE:graphs/jkqtppeakstream.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpsinglecolumnsymbols.h>
$<INSTALL_INTERFACE:graphs/jkqtpsinglecolumnsymbols.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpimageoverlays.h>
$<INSTALL_INTERFACE:graphs/jkqtpimageoverlays.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpcontour.h>
$<INSTALL_INTERFACE:graphs/jkqtpcontour.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpimagergb.h>
$<INSTALL_INTERFACE:graphs/jkqtpimagergb.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpviolinplot.h>
$<INSTALL_INTERFACE:graphs/jkqtpviolinplot.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpviolinplotstylingmixins.h>
$<INSTALL_INTERFACE:graphs/jkqtpviolinplotstylingmixins.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpstatisticsadaptors.h>
$<INSTALL_INTERFACE:graphs/jkqtpstatisticsadaptors.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpscatter.h>
$<INSTALL_INTERFACE:graphs/jkqtpscatter.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtprange.h>
$<INSTALL_INTERFACE:graphs/jkqtprange.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpspecialline.h>
$<INSTALL_INTERFACE:graphs/jkqtpspecialline.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpbarchartbase.h>
$<INSTALL_INTERFACE:graphs/jkqtpbarchartbase.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpbarchart.h>
$<INSTALL_INTERFACE:graphs/jkqtpbarchart.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtpevaluatedparametriccurve.h>
$<INSTALL_INTERFACE:graphs/jkqtpevaluatedparametriccurve.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphs/jkqtplines.h>
$<INSTALL_INTERFACE:graphs/jkqtplines.h>
)
set(HEADERS_GUI
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/gui/jkqtpcomboboxes.h>
$<INSTALL_INTERFACE:gui/jkqtpcomboboxes.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/gui/jkqtpenhancedspinboxes.h>
$<INSTALL_INTERFACE:gui/jkqtpenhancedspinboxes.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/gui/jkqtpenhancedtableview.h>
$<INSTALL_INTERFACE:gui/jkqtpenhancedtableview.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/gui/jkqtpgraphsmodel.h>
$<INSTALL_INTERFACE:gui/jkqtpgraphsmodel.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/gui/jkvanishqtoolbar.h>
$<INSTALL_INTERFACE:gui/jkvanishqtoolbar.h>
)
set(RESOURCES
${CMAKE_CURRENT_LIST_DIR}/resources/jkqtpbaseplotter.qrc
${CMAKE_CURRENT_LIST_DIR}/resources/jkqtpstyles.qrc
)
include(CMakePackageConfigHelpers)
function(JKQtPlottter_setDefaultLibOptions TARGETNAME)
set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}")
target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Xml)
# DEPENDENCIES: Qt
target_link_libraries(${lib_name} PUBLIC ${jkqtplotter_namespace}JKQTCommon${jkqtplotter_LIBNAME_VERSION_PART})
target_link_libraries(${lib_name} PUBLIC ${jkqtplotter_namespace}JKQTMath${jkqtplotter_LIBNAME_VERSION_PART})
target_link_libraries(${lib_name} PUBLIC ${jkqtplotter_namespace}JKQTMathText${jkqtplotter_LIBNAME_VERSION_PART})
target_link_libraries(${lib_name} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Xml)
if(JKQtPlotter_HAS_NO_PRINTER_SUPPORT)
target_compile_definitions(${TARGETNAME} PUBLIC JKQTPLOTTER_HAS_NO_PRINTSUPPORT)
target_compile_definitions(${lib_name} PUBLIC JKQTPLOTTER_HAS_NO_PRINTSUPPORT)
else()
target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::PrintSupport)
target_compile_definitions(${TARGETNAME} PUBLIC JKQTPLOTTER_HAS_PRINTSUPPORT)
endif()
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD})
set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED})
target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE})
if(JKQtPlotter_BUILD_WITH_TIMING_INFO_OUTPUT)
target_compile_definitions(${TARGETNAME} PRIVATE JKQTBP_AUTOTIMER)
target_link_libraries(${lib_name} PUBLIC Qt${QT_VERSION_MAJOR}::PrintSupport)
target_compile_definitions(${lib_name} PUBLIC JKQTPLOTTER_HAS_PRINTSUPPORT)
endif()
if(MINGW)
# COMPILER-SETTINGS FOR MINGW
target_compile_options(${TARGETNAME} PUBLIC -fexceptions)
elseif(MSVC)
# COMPILER-SETTINGS FOR MS VISUAL C++
target_compile_options(${TARGETNAME} PUBLIC /EHsc)
target_compile_definitions(${TARGETNAME} PUBLIC NOMINMAX)
endif()
target_include_directories(${TARGETNAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
# add source files
target_sources(${lib_name} PRIVATE
jkqtptools.cpp
jkqtpbaseelements.cpp
jkqtpbaseplotter.cpp
jkqtpdatastorage.cpp
jkqtpgraphsbase.cpp
jkqtpgraphsbaseerrors.cpp
jkqtpgraphsbasestylingmixins.cpp
jkqtplotter.cpp
jkqtplotterstyle.cpp
jkqtpkeystyle.cpp
jkqtpkey.cpp
jkqtpbaseplotterstyle.cpp
jkqtpcoordinateaxes.cpp
jkqtpcoordinateaxesstyle.cpp
jkqtpimagetools.cpp
jkqtpgraphsbasestyle.cpp
)
target_include_directories(${TARGETNAME} PUBLIC
$<BUILD_INTERFACE:${JKQTPLOTTER_VERSION_FILE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
# ... and add headers
target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS
FILES
jkqtptools.h
jkqtpbaseelements.h
jkqtpbaseplotter.h
jkqtpdatastorage.h
jkqtpgraphsbase.h
jkqtpgraphsbaseerrors.h
jkqtpgraphsbasestylingmixins.h
jkqtplotter.h
jkqtplotterstyle.h
jkqtpkeystyle.h
jkqtpkey.h
jkqtpbaseplotterstyle.h
jkqtpcoordinateaxes.h
jkqtpcoordinateaxesstyle.h
jkqtpimagetools.h
jkqtpgraphsbasestyle.h
jkqtplotter_configmacros.h
jkqtplotter_imexport.h
)
# precomiled headers to speed up compilation
if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)
target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtplotter_precomp.h)
target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtplotter_precomp.h)
endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)
endfunction()
if(JKQtPlotter_BUILD_SHARED_LIBS)
add_library(${libsh_name} SHARED
${SOURCES_BASE}
${SOURCES_GRAPHS}
${SOURCES_GUI}
${RESOURCES}
${HEADERS_BASE}
${HEADERS_GRAPHS}
${HEADERS_GUI}
)
JKQtPlottter_setDefaultLibOptions(${libsh_name})
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
target_link_libraries(${libsh_name} PUBLIC JKQTCommonSharedLib JKQTMathSharedLib JKQTMathTextSharedLib)
target_compile_definitions(${libsh_name} PUBLIC JKQTPLOTTER_LIB_IN_DLL)
target_compile_definitions(${libsh_name} PRIVATE JKQTPLOTTER_LIB_EXPORT_LIBRARY)
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}
COMPATIBILITY AnyNewerVersion )
endif()
if(JKQtPlotter_BUILD_STATIC_LIBS)
add_library(${lib_name} STATIC ${SOURCES_BASE} ${SOURCES_GRAPHS} ${SOURCES_GUI} ${RESOURCES} ${HEADERS_BASE} ${HEADERS_GRAPHS} ${HEADERS_GUI})
JKQtPlottter_setDefaultLibOptions(${lib_name})
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
target_link_libraries(${lib_name} PUBLIC JKQTCommonLib JKQTMathLib JKQTMathTextLib)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion )
endif()
add_subdirectory(graphs)
add_subdirectory(gui)
add_subdirectory(resources)
# add version info
target_include_directories(${lib_name} PRIVATE ${JKQTPLOTTER_VERSION_FILE_DIR})
# Installation
if(JKQtPlotter_BUILD_SHARED_LIBS)
jkqtplotter_installlibrary(${libsh_name} ${libIncludeSubdir} "Shared")
endif(JKQtPlotter_BUILD_SHARED_LIBS)
if(JKQtPlotter_BUILD_STATIC_LIBS)
jkqtplotter_installlibrary(${lib_name} ${libIncludeSubdir} "")
endif(JKQtPlotter_BUILD_STATIC_LIBS)
install(FILES ${HEADERS_BASE}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
COMPONENT Headers)
install(FILES ${HEADERS_GRAPHS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}/graphs
COMPONENT Headers)
install(FILES ${HEADERS_GUI}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}/gui
COMPONENT Headers)
install(FILES ${JKQTPLOTTER_VERSION_FILE} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir} COMPONENT Headers )
configure_file(${PROJECT_SOURCE_DIR}/readme.txt.in ${CMAKE_CURRENT_BINARY_DIR}/${libBasename}_Readme.txt @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libBasename}_Readme.txt" DESTINATION doc/JKQtPlotter )
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION doc/JKQtPlotter RENAME "${libBasename}_LICENSE.txt" )
jkqtplotter_installlibrary_new(${lib_name} ${libBaseName} ${CMAKE_CURRENT_LIST_DIR})
#get_target_property(printsupp_inc Qt${QT_VERSION_MAJOR}::PrintSupport INTERFACE_INCLUDE_DIRECTORIES)
#message("Qt${QT_VERSION_MAJOR}::PrintSupport::INTERFACE_INCLUDE_DIRECTORIES = ${printsupp_inc}")

View File

@ -7,9 +7,9 @@
# package requires Qt @QT_VERSION_MAJOR@
find_package(Qt@QT_VERSION_MAJOR@ COMPONENTS Core Gui Widgets Svg Xml OpenGL @JKQTPLOTTER_PRINTSUPPORT_LIBSTRING@ REQUIRED)
find_package(JKQTCommon@JKQTP_CURRENT_TARGET_SHAREDPART@Lib REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
find_package(JKQTMath@JKQTP_CURRENT_TARGET_SHAREDPART@Lib REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
find_package(JKQTMathText@JKQTP_CURRENT_TARGET_SHAREDPART@Lib REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
find_package(JKQTCommon@jkqtplotter_LIBNAME_VERSION_PART@ REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
find_package(JKQTMath@jkqtplotter_LIBNAME_VERSION_PART@ REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
find_package(JKQTMathText@jkqtplotter_LIBNAME_VERSION_PART@ REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
# include auto-generated targets.cmake file
include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@")

View File

@ -0,0 +1,67 @@
cmake_minimum_required(VERSION 3.23)
# add source files
target_sources(${lib_name} PRIVATE
jkqtpscatter.cpp
jkqtprange.cpp
jkqtpspecialline.cpp
jkqtpbarchartbase.cpp
jkqtpbarchart.cpp
jkqtpboxplot.cpp
jkqtpboxplotbase.cpp
jkqtpboxplotstylingmixins.cpp
jkqtpevaluatedfunctionbase.cpp
jkqtpevaluatedfunction.cpp
jkqtpfilledcurve.cpp
jkqtpgeometric.cpp
jkqtpgeoannotations.cpp
jkqtpgeobase.cpp
jkqtpgeolines.cpp
jkqtpgeoshapes.cpp
jkqtpimage.cpp
jkqtpimpulses.cpp
jkqtpparsedfunction.cpp
jkqtppeakstream.cpp
jkqtpsinglecolumnsymbols.cpp
jkqtpimageoverlays.cpp
jkqtpcontour.cpp
jkqtpimagergb.cpp
jkqtpviolinplot.cpp
jkqtpviolinplotstylingmixins.cpp
jkqtpstatisticsadaptors.cpp
jkqtpevaluatedparametriccurve.cpp
jkqtplines.cpp
)
# ... and add headers
target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS
FILES
jkqtpboxplot.h
jkqtpboxplotbase.h
jkqtpboxplotstylingmixins.h
jkqtpevaluatedfunctionbase.h
jkqtpevaluatedfunction.h
jkqtpfilledcurve.h
jkqtpgeometric.h
jkqtpgeoannotations.h
jkqtpgeobase.h
jkqtpgeolines.h
jkqtpgeoshapes.h
jkqtpimage.h
jkqtpimpulses.h
jkqtpparsedfunction.h
jkqtppeakstream.h
jkqtpsinglecolumnsymbols.h
jkqtpimageoverlays.h
jkqtpcontour.h
jkqtpimagergb.h
jkqtpviolinplot.h
jkqtpviolinplotstylingmixins.h
jkqtpstatisticsadaptors.h
jkqtpscatter.h
jkqtprange.h
jkqtpspecialline.h
jkqtpbarchartbase.h
jkqtpbarchart.h
jkqtpevaluatedparametriccurve.h
jkqtplines.h
)

View File

@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.23)
# add source files
target_sources(${lib_name} PRIVATE
jkqtpcomboboxes.cpp
jkqtpenhancedspinboxes.cpp
jkqtpenhancedtableview.cpp
jkqtpgraphsmodel.cpp
jkvanishqtoolbar.cpp
)
# ... and add headers
target_sources(${lib_name} PUBLIC FILE_SET HEADERS TYPE HEADERS
FILES
jkqtpcomboboxes.h
jkqtpenhancedspinboxes.h
jkqtpenhancedtableview.h
jkqtpgraphsmodel.h
jkvanishqtoolbar.h
)

View File

@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.23)
# add aressource
target_sources(${lib_name} PRIVATE
jkqtpbaseplotter.qrc
jkqtpstyles.qrc
)

View File

@ -1,6 +1,6 @@
=============================================================================
== JKQTPlotters is a library for scientific plotting using Qt5/6 ==
== sub-library: @libBasename@
== sub-library: @lib_name@
=============================================================================
Library Information:
@ -14,7 +14,11 @@ Library Information:
Build information:
used compiler: @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@
used Qt version: @QT_VERSION@
built static libs: @BUILD_STATIC_LIBS@
built shared libs: @BUILD_SHARED_LIBS@
built examples: @BUILD_EXAMPLES@
included XITS fonts: @BUILD_INCLUDE_XITS_FONTS@
witho print support: @JKQtPlotter_BUILD_WITH_PRINTER_SUPPORT@
C++20 support: @JKQtPlotter_ENABLED_CXX20@
timing debug output: @JKQtPlotter_BUILD_WITH_TIMING_INFO_OUTPUT@
built tools: @JKQtPlotter_BUILD_TOOLS@
included XITS fonts: @JKQtPlotter_BUILD_INCLUDE_XITS_FONTS@
included FIRA fonts: @JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS@
built examples: @JKQtPlotter_BUILD_EXAMPLES@

View File

@ -16,11 +16,7 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_include_directories(${EXENAME} PRIVATE ../../lib)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTMathTextLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTMathTextSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTMathText${jkqtplotter_LIBNAME_VERSION_PART})

View File

@ -18,11 +18,8 @@ set(UIS )
add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS})
target_include_directories(${EXENAME} PRIVATE ../../lib ${CMAKE_CURRENT_LIST_DIR}/../../examples/styling/)
if(JKQtPlotter_BUILD_STATIC_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterLib)
elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif()
target_link_libraries(${EXENAME} ${jkqtplotter_namespace}JKQTPlotter${jkqtplotter_LIBNAME_VERSION_PART})