diff --git a/CMakeLists.txt b/CMakeLists.txt index ae5cd1a49d..2637d4af49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,20 +45,31 @@ 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) -# ... and optionally the examples -if(JKQtPlotter_BUILD_EXAMPLES) - add_subdirectory(examples) + +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) + endif() + + if(JKQtPlotter_BUILD_TOOLS) + add_subdirectory(tools) + endif() + + add_subdirectory(doc) + endif() -if(JKQtPlotter_BUILD_TOOLS) - add_subdirectory(tools) -endif() - -add_subdirectory(doc) - - - diff --git a/README.md b/README.md index 14a1521ccd..cdf359c68e 100644 --- a/README.md +++ b/README.md @@ -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 "" "-DCMAKE_PREFIX_PATH=" + $ cmake .. -G "" "-DCMAKE_PREFIX_PATH=" "-DCMAKE_INSTALL_PREFIX=" $ 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 diff --git a/appveyor.yml b/appveyor.yml index 0ecc983271..6166177b63 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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) diff --git a/cmake/jkqtplotter_cmake_options.cmake b/cmake/jkqtplotter_cmake_options.cmake index 2ab96a0d4c..5306feb6f8 100644 --- a/cmake/jkqtplotter_cmake_options.cmake +++ b/cmake/jkqtplotter_cmake_options.cmake @@ -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 "_$") #"_${CMAKE_BUILD_TYPE}") + set(JKQtPlotter_LIBNAME_ADDITION "_$") 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() diff --git a/cmake/jkqtplotter_macros.cmake b/cmake/jkqtplotter_macros.cmake index 1c22ab2423..e8ba3ee9b7 100644 --- a/cmake/jkqtplotter_macros.cmake +++ b/cmake/jkqtplotter_macros.cmake @@ -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 + $ + $ + ) + + # 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 $ 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 $ 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) diff --git a/doc/dox/buildinstructions_cmake.dox b/doc/dox/buildinstructions_cmake.dox index 491c6cfc43..fd906c27b1 100644 --- a/doc/dox/buildinstructions_cmake.dox +++ b/doc/dox/buildinstructions_cmake.dox @@ -7,135 +7,176 @@ \section page_buildinstructions_CMAKE_RUN Running a Build with CMake -The preferred way to build JKQTPlotter is using CMake. 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 ./lib/ and ./examples/ . +The preferred way to build JKQTPlotter is using CMake (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 ./lib/ and ./examples/ . You can build JKQTPlotter (and also the examples) by either opening the file CMakeLists.txt 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=" - $ cmake --build . --config "Debug" - $ cmake --build . --config "Debug" --target install + $ cmake .. -G "" "-DCMAKE_PREFIX_PATH=" \endcode +This configures the CMake build. The Parameter \c tells CMake, which build-file generator to use (e.g. use MinGW Makefiles for MinGW Makefiles on Windows or Unix Makefiles on Unix, see https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html for a list of available generators). The parameter \c 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. CImg or OpenCV. 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 CMake GUI or ccmake. -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 Visula Studio ... generators, e.g. : \code{.sh} $ mkdir build $ cd build - $ cmake .. -G "Visual Studio 15 2017 Win64" "-DCMAKE_PREFIX_PATH=" + $ cmake .. -G "Visual Studio 16 2019 Win64" "-DCMAKE_PREFIX_PATH=" \endcode -Where \c \ 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 \ 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 \/include contains all required header files - - \c \/bin contains the shared libraries - - \c \/lib contains the link libraries - - \c \/lib/cmake contains files necessary for CMake's \c find_package() to work + - \c \/include contains all required header files + - \c \/bin contains the shared libraries, examples, tools + - \c \/lib contains the link libraries + - \c \/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: https://github.com/jkriege2/JKQtPlotter/blob/master/examples/cmake_link_example). +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: examples/cmake_link_example). Here is the \c CMakeLists.txt from that directory: \code{.cmake} - # set minimum required CMake-Version - cmake_minimum_required(VERSION 3.10) +# set minimum required CMake-Version +cmake_minimum_required(VERSION 3.23) - # set Project name - set(EXAMPLE_NAME simpletest) - set(EXENAME jkqtptest_${EXAMPLE_NAME}) - project(${EXAMPLE_NAME} LANGUAGES CXX) +# set Project name +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) +# some basic configurations +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR 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) - # For Visual Studio, we need to set some additional compiler options - if(MSVC) - add_compile_options(/EHsc) - # To enable M_PI, M_E,... - add_definitions(/D_USE_MATH_DEFINES) - # To Prevent Errors with min() and max() - add_definitions(/DNOMINMAX) - # To fix error: C2338: va_start argument must not - # have reference type and must not be parenthesized - add_definitions(/D_CRT_NO_VA_START_VALIDATION) - endif() +# include JKQTPlotter +find_package(JKQTPlotter${QT_VERSION_MAJOR} REQUIRED) - # add the example executable - add_executable(${EXENAME} WIN32 simpletest.cpp) - # ... link against Qt5 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) +# For Visual Studio, we need to set some additional compiler options +if(MSVC) + add_compile_options(/EHsc) + # To enable M_PI, M_E,... + add_definitions(/D_USE_MATH_DEFINES) + # To Prevent Errors with min() and max() + add_definitions(/DNOMINMAX) + # To fix error: C2338: va_start argument must not + # have reference type and must not be parenthesized + add_definitions(/D_CRT_NO_VA_START_VALIDATION) +endif() - # Installation - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +# add the example executable +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(${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 ${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 examples/cmake_link_example and then call CMake form that subdirectory: \code{.sh} $ mkdir build $ cd build - $ cmake .. -G "" "-DCMAKE_PREFIX_PATH= -DCMAKE_MODULE_PATH=" + $ cmake .. -G "" "-DCMAKE_PREFIX_PATH=;" \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 \ points to you Qt installation - - \c \ points to the directory containing the \c XYZ.cmake -files from the JKQTPlotter build. Typically this is \c \/lib/cmake , where \c \ is the directory into which you installed JKQTPlotter. -. +Again choose any CMake \c that is appropriate for your use-case. Replace \c by the path of your Qt installation and \c 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 */ \ No newline at end of file diff --git a/doc/dox/buildinstructions_qmake.dox b/doc/dox/buildinstructions_qmake.dox index 9708dac22d..b3036ceb8a 100644 --- a/doc/dox/buildinstructions_qmake.dox +++ b/doc/dox/buildinstructions_qmake.dox @@ -1,14 +1,14 @@ /*! -\page page_buildinstructions_QMAKE Build using QMake +\page page_buildinstructions_QMAKE DEPRECATED: Build using QMake \warning The QMake 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: - lib/jkqtplotter.pri includes the complete library (JKQTPlotter, JKQTFastPlotter, JKQTMathText) @@ -21,7 +21,7 @@ In your QMake-projects it include(/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: - qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro 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: - qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pro 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. diff --git a/doc/dox/todo.dox b/doc/dox/todo.dox index c31bf1a0d7..76afc74618 100644 --- a/doc/dox/todo.dox +++ b/doc/dox/todo.dox @@ -6,9 +6,6 @@ This page lists several todos and wishes for future version of JKQTPlotter
  • General:
      -
    • build system: provide general targets JKQTPlotter::JKQTPlotter, JKQTPlotter::JKQTMathText, instead of targets which differ by linking option
    • -
    • build system: refactor CMake-Code, so static/dynamic switch is done on compile and only one variant is built
    • -
    • build system: maybe prepare for CMake's FetchContent-API (+ possibly providing a reduced source-package for each release)
    • Lib Utilities: General and portable way to mark functions and classes as deprecated for different compilers
  • JKQTPlotter:
      diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 94fd5fe752..09bd8ffe75 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -29,79 +29,83 @@ 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() -# examples for JKQtFastPlotter -message( STATUS ".. BUILDING EXAMPLES FOR JKQTFASTPLOTTER:" ) -add_subdirectory(jkqtfastplotter_test) +if (JKQtPlotter_BUILD_LIB_JKQTMATHTEXT) + # examples specific to JKQtMathText + message( STATUS ".. BUILDING EXAMPLES FOR JKQTMATHTEXT:" ) + add_subdirectory(jkqtmathtext_simpletest) + add_subdirectory(jkqtmathtext_test) +endif() -# examples specific to JKQtMathText -message( STATUS ".. BUILDING EXAMPLES FOR JKQTMATHTEXT:" ) -add_subdirectory(jkqtmathtext_simpletest) -add_subdirectory(jkqtmathtext_test) - -# examples for JKQtPlotter -message( STATUS ".. BUILDING EXAMPLES FOR JKQTPLOTTER:" ) -# needs to be first for Precompiled Headers to work -add_subdirectory(simpletest) - -add_subdirectory(jkqtplot_test) -add_subdirectory(advplotstyling) -add_subdirectory(barchart) -add_subdirectory(boxplot) -add_subdirectory(barchart_errorbars) -add_subdirectory(barchart_functorfill) -add_subdirectory(barchart_twocolor) -add_subdirectory(barchart_customdrawfunctor) -add_subdirectory(contourplot) -add_subdirectory(datastore) -add_subdirectory(datastore_groupedstat) -add_subdirectory(datastore_iterators) -add_subdirectory(datastore_regression) -add_subdirectory(datastore_statistics) -add_subdirectory(datastore_statistics_2d) -add_subdirectory(dateaxes) -add_subdirectory(distributionplot) -add_subdirectory(errorbarstyles) -add_subdirectory(evalcurve) -add_subdirectory(filledgraphs) -add_subdirectory(filledgraphs_errors) -add_subdirectory(functionplot) -add_subdirectory(geo_arrows) -add_subdirectory(geo_simple) -add_subdirectory(geo_coordinateaxis0) -add_subdirectory(geometric) -add_subdirectory(imageplot) -add_subdirectory(imageplot_cimg) -add_subdirectory(imageplot_modifier) -add_subdirectory(imageplot_nodatastore) -add_subdirectory(imageplot_opencv) -add_subdirectory(imageplot_userpal) -add_subdirectory(impulsesplot) -add_subdirectory(logaxes) -add_subdirectory(mandelbrot) -add_subdirectory(multiplot) -add_subdirectory(multithreaded) -add_subdirectory(parametriccurve) -add_subdirectory(paramscatterplot) -add_subdirectory(paramscatterplot_image) -add_subdirectory(paramscatterplot_customsymbol) -add_subdirectory(parsedfunctionplot) -add_subdirectory(rgbimageplot) -add_subdirectory(rgbimageplot_cimg) -add_subdirectory(rgbimageplot_opencv) -add_subdirectory(rgbimageplot_qt) -add_subdirectory(scatter) -add_subdirectory(scatter_customsymbol) -add_subdirectory(second_axis) -add_subdirectory(speed) -add_subdirectory(stackedbars) -add_subdirectory(stepplots) -add_subdirectory(styledboxplot) -add_subdirectory(styling) -add_subdirectory(symbols_and_errors) -add_subdirectory(symbols_and_styles) -add_subdirectory(ui) -add_subdirectory(user_interaction) -add_subdirectory(violinplot) -add_subdirectory(wiggleplots) +if (JKQtPlotter_BUILD_LIB_JKQTPLOTTER) + # examples for JKQtPlotter + message( STATUS ".. BUILDING EXAMPLES FOR JKQTPLOTTER:" ) + # needs to be first for Precompiled Headers to work + add_subdirectory(simpletest) + add_subdirectory(jkqtplot_test) + add_subdirectory(advplotstyling) + add_subdirectory(barchart) + add_subdirectory(boxplot) + add_subdirectory(barchart_errorbars) + add_subdirectory(barchart_functorfill) + add_subdirectory(barchart_twocolor) + add_subdirectory(barchart_customdrawfunctor) + add_subdirectory(contourplot) + add_subdirectory(datastore) + add_subdirectory(datastore_groupedstat) + add_subdirectory(datastore_iterators) + add_subdirectory(datastore_regression) + add_subdirectory(datastore_statistics) + add_subdirectory(datastore_statistics_2d) + add_subdirectory(dateaxes) + add_subdirectory(distributionplot) + add_subdirectory(errorbarstyles) + add_subdirectory(evalcurve) + add_subdirectory(filledgraphs) + add_subdirectory(filledgraphs_errors) + add_subdirectory(functionplot) + add_subdirectory(geo_arrows) + add_subdirectory(geo_simple) + add_subdirectory(geo_coordinateaxis0) + add_subdirectory(geometric) + add_subdirectory(imageplot) + add_subdirectory(imageplot_cimg) + add_subdirectory(imageplot_modifier) + add_subdirectory(imageplot_nodatastore) + add_subdirectory(imageplot_opencv) + add_subdirectory(imageplot_userpal) + add_subdirectory(impulsesplot) + add_subdirectory(logaxes) + add_subdirectory(mandelbrot) + add_subdirectory(multiplot) + add_subdirectory(multithreaded) + add_subdirectory(parametriccurve) + add_subdirectory(paramscatterplot) + add_subdirectory(paramscatterplot_image) + add_subdirectory(paramscatterplot_customsymbol) + add_subdirectory(parsedfunctionplot) + add_subdirectory(rgbimageplot) + add_subdirectory(rgbimageplot_cimg) + add_subdirectory(rgbimageplot_opencv) + add_subdirectory(rgbimageplot_qt) + add_subdirectory(scatter) + add_subdirectory(scatter_customsymbol) + add_subdirectory(second_axis) + add_subdirectory(speed) + add_subdirectory(stackedbars) + add_subdirectory(stepplots) + add_subdirectory(styledboxplot) + add_subdirectory(styling) + add_subdirectory(symbols_and_errors) + add_subdirectory(symbols_and_styles) + add_subdirectory(ui) + add_subdirectory(user_interaction) + add_subdirectory(violinplot) + add_subdirectory(wiggleplots) +endif() diff --git a/examples/advplotstyling/CMakeLists.txt b/examples/advplotstyling/CMakeLists.txt index 77c7af7336..fceb0f6eb7 100644 --- a/examples/advplotstyling/CMakeLists.txt +++ b/examples/advplotstyling/CMakeLists.txt @@ -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) diff --git a/examples/barchart/CMakeLists.txt b/examples/barchart/CMakeLists.txt index 8033498f45..713d26bc07 100644 --- a/examples/barchart/CMakeLists.txt +++ b/examples/barchart/CMakeLists.txt @@ -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) diff --git a/examples/barchart_customdrawfunctor/CMakeLists.txt b/examples/barchart_customdrawfunctor/CMakeLists.txt index b88c973c54..573b165ea9 100644 --- a/examples/barchart_customdrawfunctor/CMakeLists.txt +++ b/examples/barchart_customdrawfunctor/CMakeLists.txt @@ -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) diff --git a/examples/barchart_errorbars/CMakeLists.txt b/examples/barchart_errorbars/CMakeLists.txt index 6bdf933979..d53c48b34a 100644 --- a/examples/barchart_errorbars/CMakeLists.txt +++ b/examples/barchart_errorbars/CMakeLists.txt @@ -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) diff --git a/examples/barchart_functorfill/CMakeLists.txt b/examples/barchart_functorfill/CMakeLists.txt index f48c24d0d1..1cd61f3629 100644 --- a/examples/barchart_functorfill/CMakeLists.txt +++ b/examples/barchart_functorfill/CMakeLists.txt @@ -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) diff --git a/examples/barchart_twocolor/CMakeLists.txt b/examples/barchart_twocolor/CMakeLists.txt index 8687c842a5..1cf3223853 100644 --- a/examples/barchart_twocolor/CMakeLists.txt +++ b/examples/barchart_twocolor/CMakeLists.txt @@ -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) diff --git a/examples/boxplot/CMakeLists.txt b/examples/boxplot/CMakeLists.txt index b9aca085c5..1f6d174fa1 100644 --- a/examples/boxplot/CMakeLists.txt +++ b/examples/boxplot/CMakeLists.txt @@ -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) diff --git a/examples/cmake_link_example/CMakeLists.txt b/examples/cmake_link_example/CMakeLists.txt index 1c47515ebb..c6195e94f5 100644 --- a/examples/cmake_link_example/CMakeLists.txt +++ b/examples/cmake_link_example/CMakeLists.txt @@ -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} +) diff --git a/examples/cmake_link_example/README.md b/examples/cmake_link_example/README.md index eb10ec3a5f..47e7869c8d 100644 --- a/examples/cmake_link_example/README.md +++ b/examples/cmake_link_example/README.md @@ -4,64 +4,80 @@ 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) +# set minimum required CMake-Version +cmake_minimum_required(VERSION 3.23) - # set Project name - set(EXAMPLE_NAME simpletest) - set(EXENAME jkqtptest_${EXAMPLE_NAME}) - project(${EXAMPLE_NAME} LANGUAGES CXX) +# set Project name +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) +# some basic configurations +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR 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) +# 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) - # For Visual Studio, we need to set some additional compiler options - if(MSVC) - add_compile_options(/EHsc) - # To enable M_PI, M_E,... - add_definitions(/D_USE_MATH_DEFINES) - # To Prevent Errors with min() and max() - add_definitions(/DNOMINMAX) - # To fix error: C2338: va_start argument must not - # have reference type and must not be parenthesized - add_definitions(/D_CRT_NO_VA_START_VALIDATION) - endif() +# include JKQTPlotter +find_package(JKQTPlotter${QT_VERSION_MAJOR} REQUIRED) - # add the example executable - add_executable(${EXENAME} WIN32 simpletest.cpp) - # ... link against Qt5 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) +# For Visual Studio, we need to set some additional compiler options +if(MSVC) + add_compile_options(/EHsc) + # To enable M_PI, M_E,... + add_definitions(/D_USE_MATH_DEFINES) + # To Prevent Errors with min() and max() + add_definitions(/DNOMINMAX) + # To fix error: C2338: va_start argument must not + # have reference type and must not be parenthesized + add_definitions(/D_CRT_NO_VA_START_VALIDATION) +endif() - # Installation - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +# add the example executable +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(${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 of Qt DLLs on Windows - include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/jkqtplotter_deployqt.cmake) - jkqtplotter_deployqt(${EXENAME}) + +# Installation +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 "" "-DCMAKE_PREFIX_PATH= -DCMAKE_MODULE_PATH=" + $ cmake .. -G "" "-DCMAKE_PREFIX_PATH=;" ``` 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: - `` points to you Qt installation - - `` points to the directory containing the `XYZ.cmake`-files from the JKQTPlotter build. Typically this is `/lib/cmake`, where `` is the directory into which you installed JKQTPlotter. \ No newline at end of file + - `` points to the directory containing the JKQTPlotter build. Typically this is will conatin a subdirectory`/lib/cmake/JKQtPlottr6` with all necessary CMake-scripts. Here `` is the directory into which you installed JKQTPlotter. + diff --git a/examples/cmake_link_example/simpletest.cpp b/examples/cmake_link_example/simpletest.cpp index dd37f07930..5e0646a35f 100644 --- a/examples/cmake_link_example/simpletest.cpp +++ b/examples/cmake_link_example/simpletest.cpp @@ -4,7 +4,6 @@ * \ref JKQTCMakeLinkExample */ -#include "jkqtpexampleapplication.h" #include #include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/graphs/jkqtpscatter.h" diff --git a/examples/contourplot/CMakeLists.txt b/examples/contourplot/CMakeLists.txt index 9765896cfc..e32791da00 100644 --- a/examples/contourplot/CMakeLists.txt +++ b/examples/contourplot/CMakeLists.txt @@ -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) diff --git a/examples/datastore/CMakeLists.txt b/examples/datastore/CMakeLists.txt index 97e4b3b142..37d1aa857a 100644 --- a/examples/datastore/CMakeLists.txt +++ b/examples/datastore/CMakeLists.txt @@ -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) diff --git a/examples/datastore_groupedstat/CMakeLists.txt b/examples/datastore_groupedstat/CMakeLists.txt index 9ecb95cc22..d577d66996 100644 --- a/examples/datastore_groupedstat/CMakeLists.txt +++ b/examples/datastore_groupedstat/CMakeLists.txt @@ -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) diff --git a/examples/datastore_iterators/CMakeLists.txt b/examples/datastore_iterators/CMakeLists.txt index 9695fdd94f..54c77ffac2 100644 --- a/examples/datastore_iterators/CMakeLists.txt +++ b/examples/datastore_iterators/CMakeLists.txt @@ -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) diff --git a/examples/datastore_regression/CMakeLists.txt b/examples/datastore_regression/CMakeLists.txt index 91c6999c8d..df9be0a854 100644 --- a/examples/datastore_regression/CMakeLists.txt +++ b/examples/datastore_regression/CMakeLists.txt @@ -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) diff --git a/examples/datastore_statistics/CMakeLists.txt b/examples/datastore_statistics/CMakeLists.txt index 0c8599feaf..31cbf9819c 100644 --- a/examples/datastore_statistics/CMakeLists.txt +++ b/examples/datastore_statistics/CMakeLists.txt @@ -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) diff --git a/examples/datastore_statistics_2d/CMakeLists.txt b/examples/datastore_statistics_2d/CMakeLists.txt index ab2ed453a4..ef4351666a 100644 --- a/examples/datastore_statistics_2d/CMakeLists.txt +++ b/examples/datastore_statistics_2d/CMakeLists.txt @@ -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) diff --git a/examples/dateaxes/CMakeLists.txt b/examples/dateaxes/CMakeLists.txt index ded0a485ce..a955bc5362 100644 --- a/examples/dateaxes/CMakeLists.txt +++ b/examples/dateaxes/CMakeLists.txt @@ -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) diff --git a/examples/distributionplot/CMakeLists.txt b/examples/distributionplot/CMakeLists.txt index d2f712031a..f935f74d42 100644 --- a/examples/distributionplot/CMakeLists.txt +++ b/examples/distributionplot/CMakeLists.txt @@ -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) diff --git a/examples/errorbarstyles/CMakeLists.txt b/examples/errorbarstyles/CMakeLists.txt index 0d04ee71ba..287d8879cb 100644 --- a/examples/errorbarstyles/CMakeLists.txt +++ b/examples/errorbarstyles/CMakeLists.txt @@ -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) diff --git a/examples/evalcurve/CMakeLists.txt b/examples/evalcurve/CMakeLists.txt index 448a8b3cc6..5c33307b97 100644 --- a/examples/evalcurve/CMakeLists.txt +++ b/examples/evalcurve/CMakeLists.txt @@ -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) diff --git a/examples/filledgraphs/CMakeLists.txt b/examples/filledgraphs/CMakeLists.txt index ddce78abe5..f2f40128c8 100644 --- a/examples/filledgraphs/CMakeLists.txt +++ b/examples/filledgraphs/CMakeLists.txt @@ -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) diff --git a/examples/filledgraphs_errors/CMakeLists.txt b/examples/filledgraphs_errors/CMakeLists.txt index f36fed11cd..67502b930c 100644 --- a/examples/filledgraphs_errors/CMakeLists.txt +++ b/examples/filledgraphs_errors/CMakeLists.txt @@ -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) diff --git a/examples/functionplot/CMakeLists.txt b/examples/functionplot/CMakeLists.txt index 529ad98332..aa63441311 100644 --- a/examples/functionplot/CMakeLists.txt +++ b/examples/functionplot/CMakeLists.txt @@ -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) diff --git a/examples/geo_arrows/CMakeLists.txt b/examples/geo_arrows/CMakeLists.txt index 09e8443e1e..25c4f21961 100644 --- a/examples/geo_arrows/CMakeLists.txt +++ b/examples/geo_arrows/CMakeLists.txt @@ -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) diff --git a/examples/geo_coordinateaxis0/CMakeLists.txt b/examples/geo_coordinateaxis0/CMakeLists.txt index 28946e8109..a1ac9b9a16 100644 --- a/examples/geo_coordinateaxis0/CMakeLists.txt +++ b/examples/geo_coordinateaxis0/CMakeLists.txt @@ -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) diff --git a/examples/geo_simple/CMakeLists.txt b/examples/geo_simple/CMakeLists.txt index 1d8d544ff7..91a59c5060 100644 --- a/examples/geo_simple/CMakeLists.txt +++ b/examples/geo_simple/CMakeLists.txt @@ -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) diff --git a/examples/geometric/CMakeLists.txt b/examples/geometric/CMakeLists.txt index a10de06182..5d1eaeb930 100644 --- a/examples/geometric/CMakeLists.txt +++ b/examples/geometric/CMakeLists.txt @@ -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) diff --git a/examples/imageplot/CMakeLists.txt b/examples/imageplot/CMakeLists.txt index 4eaf9ad5ed..358aedf879 100644 --- a/examples/imageplot/CMakeLists.txt +++ b/examples/imageplot/CMakeLists.txt @@ -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) diff --git a/examples/imageplot_cimg/CMakeLists.txt b/examples/imageplot_cimg/CMakeLists.txt index 4a2ce52f16..549f46579e 100644 --- a/examples/imageplot_cimg/CMakeLists.txt +++ b/examples/imageplot_cimg/CMakeLists.txt @@ -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 diff --git a/examples/imageplot_modifier/CMakeLists.txt b/examples/imageplot_modifier/CMakeLists.txt index bef7bdf8d4..94357d1a62 100644 --- a/examples/imageplot_modifier/CMakeLists.txt +++ b/examples/imageplot_modifier/CMakeLists.txt @@ -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) diff --git a/examples/imageplot_nodatastore/CMakeLists.txt b/examples/imageplot_nodatastore/CMakeLists.txt index b28a349bb0..3ee28a3e10 100644 --- a/examples/imageplot_nodatastore/CMakeLists.txt +++ b/examples/imageplot_nodatastore/CMakeLists.txt @@ -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) diff --git a/examples/imageplot_opencv/CMakeLists.txt b/examples/imageplot_opencv/CMakeLists.txt index 2b80d5891f..034200d365 100644 --- a/examples/imageplot_opencv/CMakeLists.txt +++ b/examples/imageplot_opencv/CMakeLists.txt @@ -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} ) diff --git a/examples/imageplot_userpal/CMakeLists.txt b/examples/imageplot_userpal/CMakeLists.txt index 301186d185..435942cb6b 100644 --- a/examples/imageplot_userpal/CMakeLists.txt +++ b/examples/imageplot_userpal/CMakeLists.txt @@ -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) diff --git a/examples/impulsesplot/CMakeLists.txt b/examples/impulsesplot/CMakeLists.txt index 221d21b5c2..0bcf5a98f5 100644 --- a/examples/impulsesplot/CMakeLists.txt +++ b/examples/impulsesplot/CMakeLists.txt @@ -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) diff --git a/examples/jkqtfastplotter_test/CMakeLists.txt b/examples/jkqtfastplotter_test/CMakeLists.txt index cc3aabe382..065d490997 100644 --- a/examples/jkqtfastplotter_test/CMakeLists.txt +++ b/examples/jkqtfastplotter_test/CMakeLists.txt @@ -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}) + diff --git a/examples/jkqtmathtext_simpletest/CMakeLists.txt b/examples/jkqtmathtext_simpletest/CMakeLists.txt index f27f36a512..c11685b2be 100644 --- a/examples/jkqtmathtext_simpletest/CMakeLists.txt +++ b/examples/jkqtmathtext_simpletest/CMakeLists.txt @@ -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}) + diff --git a/examples/jkqtmathtext_simpletest/README.md b/examples/jkqtmathtext_simpletest/README.md index 3c238256f3..0eb3ad1ec3 100644 --- a/examples/jkqtmathtext_simpletest/README.md +++ b/examples/jkqtmathtext_simpletest/README.md @@ -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 #include diff --git a/examples/jkqtmathtext_test/CMakeLists.txt b/examples/jkqtmathtext_test/CMakeLists.txt index af95dffdfe..93b1d6aaae 100644 --- a/examples/jkqtmathtext_test/CMakeLists.txt +++ b/examples/jkqtmathtext_test/CMakeLists.txt @@ -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}) diff --git a/examples/jkqtplot_test/CMakeLists.txt b/examples/jkqtplot_test/CMakeLists.txt index 61557e33f2..091da589db 100644 --- a/examples/jkqtplot_test/CMakeLists.txt +++ b/examples/jkqtplot_test/CMakeLists.txt @@ -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 diff --git a/examples/libexampletools/CMakeLists.txt b/examples/libexampletools/CMakeLists.txt index efb2947228..16644a2a30 100644 --- a/examples/libexampletools/CMakeLists.txt +++ b/examples/libexampletools/CMakeLists.txt @@ -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 +) diff --git a/examples/logaxes/CMakeLists.txt b/examples/logaxes/CMakeLists.txt index ec57a1ac05..355306c64e 100644 --- a/examples/logaxes/CMakeLists.txt +++ b/examples/logaxes/CMakeLists.txt @@ -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) diff --git a/examples/mandelbrot/CMakeLists.txt b/examples/mandelbrot/CMakeLists.txt index b41e70d35c..80bce6ad6e 100644 --- a/examples/mandelbrot/CMakeLists.txt +++ b/examples/mandelbrot/CMakeLists.txt @@ -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 diff --git a/examples/multiplot/CMakeLists.txt b/examples/multiplot/CMakeLists.txt index efb39b1ac3..1290507f0b 100644 --- a/examples/multiplot/CMakeLists.txt +++ b/examples/multiplot/CMakeLists.txt @@ -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) diff --git a/examples/multithreaded/CMakeLists.txt b/examples/multithreaded/CMakeLists.txt index a6f96c4acb..d652cc8b57 100644 --- a/examples/multithreaded/CMakeLists.txt +++ b/examples/multithreaded/CMakeLists.txt @@ -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) diff --git a/examples/parametriccurve/CMakeLists.txt b/examples/parametriccurve/CMakeLists.txt index 258248c91d..8f7ba5c709 100644 --- a/examples/parametriccurve/CMakeLists.txt +++ b/examples/parametriccurve/CMakeLists.txt @@ -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) diff --git a/examples/paramscatterplot/CMakeLists.txt b/examples/paramscatterplot/CMakeLists.txt index 443bfe026e..12e3f9b167 100644 --- a/examples/paramscatterplot/CMakeLists.txt +++ b/examples/paramscatterplot/CMakeLists.txt @@ -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) diff --git a/examples/paramscatterplot_customsymbol/CMakeLists.txt b/examples/paramscatterplot_customsymbol/CMakeLists.txt index 4de91ab5a9..737c8ed2f4 100644 --- a/examples/paramscatterplot_customsymbol/CMakeLists.txt +++ b/examples/paramscatterplot_customsymbol/CMakeLists.txt @@ -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) diff --git a/examples/paramscatterplot_image/CMakeLists.txt b/examples/paramscatterplot_image/CMakeLists.txt index f2d4138be6..b51fac75e3 100644 --- a/examples/paramscatterplot_image/CMakeLists.txt +++ b/examples/paramscatterplot_image/CMakeLists.txt @@ -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) diff --git a/examples/parsedfunctionplot/CMakeLists.txt b/examples/parsedfunctionplot/CMakeLists.txt index 7373b2f4d8..38aae30b7a 100644 --- a/examples/parsedfunctionplot/CMakeLists.txt +++ b/examples/parsedfunctionplot/CMakeLists.txt @@ -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) diff --git a/examples/rgbimageplot/CMakeLists.txt b/examples/rgbimageplot/CMakeLists.txt index f83c384de9..6a7eb73360 100644 --- a/examples/rgbimageplot/CMakeLists.txt +++ b/examples/rgbimageplot/CMakeLists.txt @@ -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) diff --git a/examples/rgbimageplot_cimg/CMakeLists.txt b/examples/rgbimageplot_cimg/CMakeLists.txt index 690c8301f8..e61d48dff1 100644 --- a/examples/rgbimageplot_cimg/CMakeLists.txt +++ b/examples/rgbimageplot_cimg/CMakeLists.txt @@ -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 diff --git a/examples/rgbimageplot_opencv/CMakeLists.txt b/examples/rgbimageplot_opencv/CMakeLists.txt index 9f7274bbf9..94f09b278d 100644 --- a/examples/rgbimageplot_opencv/CMakeLists.txt +++ b/examples/rgbimageplot_opencv/CMakeLists.txt @@ -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} ) diff --git a/examples/rgbimageplot_qt/CMakeLists.txt b/examples/rgbimageplot_qt/CMakeLists.txt index a4d6bb39b8..33b306fe10 100644 --- a/examples/rgbimageplot_qt/CMakeLists.txt +++ b/examples/rgbimageplot_qt/CMakeLists.txt @@ -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) diff --git a/examples/scatter/CMakeLists.txt b/examples/scatter/CMakeLists.txt index beea3e6637..19d5820284 100644 --- a/examples/scatter/CMakeLists.txt +++ b/examples/scatter/CMakeLists.txt @@ -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) diff --git a/examples/scatter_customsymbol/CMakeLists.txt b/examples/scatter_customsymbol/CMakeLists.txt index 8deeae170b..6e1062684b 100644 --- a/examples/scatter_customsymbol/CMakeLists.txt +++ b/examples/scatter_customsymbol/CMakeLists.txt @@ -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) diff --git a/examples/second_axis/CMakeLists.txt b/examples/second_axis/CMakeLists.txt index 86eeeeb913..9a68042954 100644 --- a/examples/second_axis/CMakeLists.txt +++ b/examples/second_axis/CMakeLists.txt @@ -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) diff --git a/examples/simpletest/CMakeLists.txt b/examples/simpletest/CMakeLists.txt index 71fc29dcf9..f2fe6b08aa 100644 --- a/examples/simpletest/CMakeLists.txt +++ b/examples/simpletest/CMakeLists.txt @@ -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) diff --git a/examples/simpletest/README.md b/examples/simpletest/README.md index 833f220ac6..fdc9868af4 100644 --- a/examples/simpletest/README.md +++ b/examples/simpletest/README.md @@ -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 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 diff --git a/examples/speed/CMakeLists.txt b/examples/speed/CMakeLists.txt index 44778474bc..ee975115fa 100644 --- a/examples/speed/CMakeLists.txt +++ b/examples/speed/CMakeLists.txt @@ -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) diff --git a/examples/stackedbars/CMakeLists.txt b/examples/stackedbars/CMakeLists.txt index 79056a42b8..d6acedf18e 100644 --- a/examples/stackedbars/CMakeLists.txt +++ b/examples/stackedbars/CMakeLists.txt @@ -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) diff --git a/examples/stepplots/CMakeLists.txt b/examples/stepplots/CMakeLists.txt index 825f063227..bb3d7068a8 100644 --- a/examples/stepplots/CMakeLists.txt +++ b/examples/stepplots/CMakeLists.txt @@ -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) diff --git a/examples/styledboxplot/CMakeLists.txt b/examples/styledboxplot/CMakeLists.txt index 9b8a4c36a0..09587eac18 100644 --- a/examples/styledboxplot/CMakeLists.txt +++ b/examples/styledboxplot/CMakeLists.txt @@ -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) diff --git a/examples/styling/CMakeLists.txt b/examples/styling/CMakeLists.txt index 7b4240c721..a41ca09a4e 100644 --- a/examples/styling/CMakeLists.txt +++ b/examples/styling/CMakeLists.txt @@ -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) diff --git a/examples/symbols_and_errors/CMakeLists.txt b/examples/symbols_and_errors/CMakeLists.txt index 2b184e9480..9522340a87 100644 --- a/examples/symbols_and_errors/CMakeLists.txt +++ b/examples/symbols_and_errors/CMakeLists.txt @@ -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) diff --git a/examples/symbols_and_styles/CMakeLists.txt b/examples/symbols_and_styles/CMakeLists.txt index 8924e45326..f28a8f6456 100644 --- a/examples/symbols_and_styles/CMakeLists.txt +++ b/examples/symbols_and_styles/CMakeLists.txt @@ -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) diff --git a/examples/ui/CMakeLists.txt b/examples/ui/CMakeLists.txt index 69bef6e0a4..c0cf72e879 100644 --- a/examples/ui/CMakeLists.txt +++ b/examples/ui/CMakeLists.txt @@ -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) diff --git a/examples/ui/README.md b/examples/ui/README.md index 98a3111c3a..ac0be9e89c 100644 --- a/examples/ui/README.md +++ b/examples/ui/README.md @@ -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 diff --git a/examples/user_interaction/CMakeLists.txt b/examples/user_interaction/CMakeLists.txt index 3a60648e9d..81786f9013 100644 --- a/examples/user_interaction/CMakeLists.txt +++ b/examples/user_interaction/CMakeLists.txt @@ -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) diff --git a/examples/violinplot/CMakeLists.txt b/examples/violinplot/CMakeLists.txt index 6996fbdaf6..7eedad7b27 100644 --- a/examples/violinplot/CMakeLists.txt +++ b/examples/violinplot/CMakeLists.txt @@ -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) diff --git a/examples/wiggleplots/CMakeLists.txt b/examples/wiggleplots/CMakeLists.txt index a943900d02..a69deeb6f8 100644 --- a/examples/wiggleplots/CMakeLists.txt +++ b/examples/wiggleplots/CMakeLists.txt @@ -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) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 09b8ed7238..ab466cc7bb 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.23) @@ -6,45 +6,66 @@ message( STATUS ) message( STATUS "=============================================================================" ) message( STATUS "== JKQTPlotterLib Build Information ==" ) message( STATUS "=============================================================================" ) -message( STATUS "Version: ${PROJECT_VERSION}") -message( STATUS "Build type: ${CMAKE_BUILD_TYPE}") -message( STATUS "Build types: ${CMAKE_CONFIGURATION_TYPES}") -message( STATUS "Using CMake: ${CMAKE_VERSION}") -message( STATUS " 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}" ) -message( STATUS "bit depth: ${JKQtPlotter_BIT_DEPTH} bit" ) -message( STATUS "System Name: ${CMAKE_SYSTEM_NAME}" ) -message( STATUS "Processor Name: ${CMAKE_SYSTEM_PROCESSOR}" ) -message( STATUS "Using Qt: ${QT_VERSION}" ) +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 "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}" ) +message( STATUS "bit depth: ${JKQtPlotter_BIT_DEPTH} bit" ) +message( STATUS "System Name: ${CMAKE_SYSTEM_NAME}" ) +message( STATUS "Processor Name: ${CMAKE_SYSTEM_PROCESSOR}" ) +message( STATUS "Using Qt: ${QT_VERSION}" ) message( STATUS " [at ${QT_DIR}]" ) if(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) - message( STATUS "XITS fonts: LINKED IN" ) + message( STATUS "XITS fonts: LINKED IN" ) else() - message( STATUS "XITS fonts: NOT AVAILABLE IN LIB" ) + message( STATUS "XITS fonts: NOT AVAILABLE IN LIB" ) endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) if(JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS) - message( STATUS "FIRA fonts: LINKED IN" ) + message( STATUS "FIRA fonts: LINKED IN" ) else() - message( STATUS "FIRA fonts: NOT AVAILABLE IN LIB" ) + message( STATUS "FIRA fonts: NOT AVAILABLE IN LIB" ) endif(JKQtPlotter_BUILD_INCLUDE_FIRAMATH_FONTS) if(${JKQtPlotter_HAS_NO_PRINTER_SUPPORT}) - message( STATUS "Print support: OFF" ) + message( STATUS "Print support: OFF" ) else() - message( STATUS "Print support: ON" ) + message( STATUS "Print support: ON" ) endif() if(${JKQtPlotter_BUILD_WITH_TIMING_INFO_OUTPUT}) - message( STATUS "Timing Info output: OFF" ) + message( STATUS "Timing Info output: OFF" ) else() - message( STATUS "Timing Info output: ON" ) + message( STATUS "Timing Info output: ON" ) endif() if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) - message( STATUS "Precompiled Header: ON" ) + message( STATUS "Precompiled Header: ON" ) else() - message( STATUS "Precompiled Header: OFF") + message( STATUS "Precompiled Header: OFF") endif() -message( STATUS "Installing to: ${CMAKE_INSTALL_PREFIX}" ) +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) -add_subdirectory(jkqtmath) -add_subdirectory(jkqtmathtext) -add_subdirectory(jkqtfastplotter) -add_subdirectory(jkqtplotter) + +# 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() diff --git a/lib/jkqtcommon/CMakeLists.txt b/lib/jkqtcommon/CMakeLists.txt index db4249765f..7e561ccad2 100644 --- a/lib/jkqtcommon/CMakeLists.txt +++ b/lib/jkqtcommon/CMakeLists.txt @@ -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) +message( STATUS "-- Building ${lib_name}" ) -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) +# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS +jkqtplotter_add_library(${lib_name} ) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +# set all default library options +jkqtplotter_setDefaultLibOptions(${lib_name} ${libBaseName} "${CMAKE_CURRENT_LIST_DIR}/private/jkqtcommon_precomp.h") -# 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 +# 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 - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ +# ... 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 - $ - $ - ) - # 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" ) - diff --git a/lib/jkqtfastplotter/CMakeLists.txt b/lib/jkqtfastplotter/CMakeLists.txt index fe58929ed5..ed11774ab4 100644 --- a/lib/jkqtfastplotter/CMakeLists.txt +++ b/lib/jkqtfastplotter/CMakeLists.txt @@ -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) +message( STATUS "-- Building ${lib_name}" ) +message(WARNING "-- You are building the sub-library JKQTFastPlotter, which is DEPRECTAED and may be removed in future!") -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) +# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS +jkqtplotter_add_library(${lib_name} ) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +# set all default library options +jkqtplotter_setDefaultLibOptions(${lib_name} ${libBaseName} "") -# Set up source files -set(SOURCES - ${CMAKE_CURRENT_LIST_DIR}/jkqtfastplotter.cpp -) - -set(HEADERS - $ - $ - $ - $ -) - - -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}) - if(${QT_VERSION_MAJOR} VERSION_GREATER_EQUAL "6") - target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets) - 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 - $ - $ - ) -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 ) +# 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(${lib_name} PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets) endif() +target_link_libraries(${lib_name} PUBLIC ${jkqtplotter_namespace}JKQTCommon${jkqtplotter_LIBNAME_VERSION_PART}) -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() +# 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 +) # 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}) diff --git a/lib/jkqtfastplotter/LibTarget.cmake.in b/lib/jkqtfastplotter/LibTarget.cmake.in index c3ff8fb7fe..7125b3820f 100644 --- a/lib/jkqtfastplotter/LibTarget.cmake.in +++ b/lib/jkqtfastplotter/LibTarget.cmake.in @@ -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@") diff --git a/lib/jkqtmath/CMakeLists.txt b/lib/jkqtmath/CMakeLists.txt index c2e2bb51b5..6c97dc3991 100644 --- a/lib/jkqtmath/CMakeLists.txt +++ b/lib/jkqtmath/CMakeLists.txt @@ -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) +message( STATUS "-- Building ${lib_name}" ) -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) +# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS +jkqtplotter_add_library(${lib_name} ) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +# set all default library options +jkqtplotter_setDefaultLibOptions(${lib_name} ${libBaseName} "${CMAKE_CURRENT_LIST_DIR}/private/jkqtmath_precomp.h") -# 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 +# 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 - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ ) -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 - $ - $ - ) - # 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" ) diff --git a/lib/jkqtmath/LibTarget.cmake.in b/lib/jkqtmath/LibTarget.cmake.in index 5dbcee9667..2531cda087 100644 --- a/lib/jkqtmath/LibTarget.cmake.in +++ b/lib/jkqtmath/LibTarget.cmake.in @@ -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@") \ No newline at end of file diff --git a/lib/jkqtmathtext/CMakeLists.txt b/lib/jkqtmathtext/CMakeLists.txt index 68a683e3b3..d2294bbabe 100644 --- a/lib/jkqtmathtext/CMakeLists.txt +++ b/lib/jkqtmathtext/CMakeLists.txt @@ -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) +message( STATUS "-- Building ${lib_name}" ) -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) +# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS +jkqtplotter_add_library(${lib_name} ) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +# set all default library options +jkqtplotter_setDefaultLibOptions(${lib_name} ${libBaseName} "${CMAKE_CURRENT_LIST_DIR}/private/jkqtmathtext_precomp.h") -# Set up source files -set(SOURCES - ${CMAKE_CURRENT_LIST_DIR}/jkqtmathtext.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtmathtexttools.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtmathtextlabel.cpp +# 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 - $ - $ - $ - $ - $ - $ - $ - $ -) - -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 - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ -) - - -set(SOURCES_PARSERS - ${CMAKE_CURRENT_LIST_DIR}/parsers/jkqtmathtextparser.cpp - ${CMAKE_CURRENT_LIST_DIR}/parsers/jkqtmathtextlatexparser.cpp -) - -set(HEADERS_PARSERS - $ - $ - $ - $ -) - -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 - $ - $ - ) - 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" ) diff --git a/lib/jkqtmathtext/LibTarget.cmake.in b/lib/jkqtmathtext/LibTarget.cmake.in index 3b02accdec..fb5d1ff90c 100644 --- a/lib/jkqtmathtext/LibTarget.cmake.in +++ b/lib/jkqtmathtext/LibTarget.cmake.in @@ -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@") \ No newline at end of file diff --git a/lib/jkqtmathtext/nodes/CMakeLists.txt b/lib/jkqtmathtext/nodes/CMakeLists.txt new file mode 100644 index 0000000000..8fea9475c0 --- /dev/null +++ b/lib/jkqtmathtext/nodes/CMakeLists.txt @@ -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 +) \ No newline at end of file diff --git a/lib/jkqtmathtext/parsers/CMakeLists.txt b/lib/jkqtmathtext/parsers/CMakeLists.txt new file mode 100644 index 0000000000..574c162f3a --- /dev/null +++ b/lib/jkqtmathtext/parsers/CMakeLists.txt @@ -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 +) \ No newline at end of file diff --git a/lib/jkqtmathtext/resources/CMakeLists.txt b/lib/jkqtmathtext/resources/CMakeLists.txt new file mode 100644 index 0000000000..0423016925 --- /dev/null +++ b/lib/jkqtmathtext/resources/CMakeLists.txt @@ -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) + diff --git a/lib/jkqtplotter/CMakeLists.txt b/lib/jkqtplotter/CMakeLists.txt index 67d755d71f..50ad03df57 100644 --- a/lib/jkqtplotter/CMakeLists.txt +++ b/lib/jkqtplotter/CMakeLists.txt @@ -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) +message( STATUS "-- Building ${lib_name}" ) -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) +# create the library (SHARED/STATIC is controlled by the CMake option BUILD_SHARED_LIBS +jkqtplotter_add_library(${lib_name} ) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +# set all default library options +jkqtplotter_setDefaultLibOptions(${lib_name} ${libBaseName} "${CMAKE_CURRENT_LIST_DIR}/private/jkqtplotter_precomp.h") -# 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(HEADERS_BASE - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ -) -set(HEADERS_GRAPHS - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ -) -set(HEADERS_GUI - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ -) - -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) - if(JKQtPlotter_HAS_NO_PRINTER_SUPPORT) - target_compile_definitions(${TARGETNAME} 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) - 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 - $ - $ - ) - target_include_directories(${TARGETNAME} PUBLIC - $ - $ - ) - - # 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 ) +# 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(${lib_name} PUBLIC JKQTPLOTTER_HAS_NO_PRINTSUPPORT) +else() + target_link_libraries(${lib_name} PUBLIC Qt${QT_VERSION_MAJOR}::PrintSupport) + target_compile_definitions(${lib_name} PUBLIC JKQTPLOTTER_HAS_PRINTSUPPORT) 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 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 +) +# ... 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 +) + +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}") diff --git a/lib/jkqtplotter/LibTarget.cmake.in b/lib/jkqtplotter/LibTarget.cmake.in index d662339cfb..293861b80e 100644 --- a/lib/jkqtplotter/LibTarget.cmake.in +++ b/lib/jkqtplotter/LibTarget.cmake.in @@ -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@") \ No newline at end of file +include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@") diff --git a/lib/jkqtplotter/graphs/CMakeLists.txt b/lib/jkqtplotter/graphs/CMakeLists.txt new file mode 100644 index 0000000000..d44e3ba13f --- /dev/null +++ b/lib/jkqtplotter/graphs/CMakeLists.txt @@ -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 +) \ No newline at end of file diff --git a/lib/jkqtplotter/gui/CMakeLists.txt b/lib/jkqtplotter/gui/CMakeLists.txt new file mode 100644 index 0000000000..0770ebb14c --- /dev/null +++ b/lib/jkqtplotter/gui/CMakeLists.txt @@ -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 +) \ No newline at end of file diff --git a/lib/jkqtplotter/resources/CMakeLists.txt b/lib/jkqtplotter/resources/CMakeLists.txt new file mode 100644 index 0000000000..170fff5eb2 --- /dev/null +++ b/lib/jkqtplotter/resources/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.23) + + +# add aressource +target_sources(${lib_name} PRIVATE + jkqtpbaseplotter.qrc + jkqtpstyles.qrc +) diff --git a/readme.txt.in b/readme.txt.in index 1fcee203e7..f81785d74d 100644 --- a/readme.txt.in +++ b/readme.txt.in @@ -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@ \ No newline at end of file + 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@ diff --git a/tools/jkqtmathtext_render/CMakeLists.txt b/tools/jkqtmathtext_render/CMakeLists.txt index 84d35d0926..2f720f7417 100644 --- a/tools/jkqtmathtext_render/CMakeLists.txt +++ b/tools/jkqtmathtext_render/CMakeLists.txt @@ -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}) diff --git a/tools/jkqtplotter_doc_imagegenerator/CMakeLists.txt b/tools/jkqtplotter_doc_imagegenerator/CMakeLists.txt index 727ee29a08..ff7c679066 100644 --- a/tools/jkqtplotter_doc_imagegenerator/CMakeLists.txt +++ b/tools/jkqtplotter_doc_imagegenerator/CMakeLists.txt @@ -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}) +