2024-01-15 20:36:36 +08:00
|
|
|
cmake_minimum_required(VERSION 3.23)
|
2019-06-20 21:18:58 +08:00
|
|
|
|
2019-11-24 17:42:23 +08:00
|
|
|
# Project Name and Version
|
2020-06-28 21:53:26 +08:00
|
|
|
# starting from 2020: using semantic version number <major>.<minor>.<patch>
|
|
|
|
# - bugfixes which do not change the API/ABI lead to an increase in <patch>
|
|
|
|
# - backward-compatible API/ABI-changes mean an increasing <minor> version
|
|
|
|
# - NON backward-compatible API/ABI-changes mean an increasing <major> version
|
|
|
|
# relation to older versioning scheme:
|
|
|
|
# - v2015.10 <--> 1.0.0
|
|
|
|
# - v2018.08 <--> 2.0.0
|
|
|
|
# - v2019.11 <--> 3.x.y
|
|
|
|
# ==> sematic versioning starts with 4.0.0
|
2022-07-19 20:36:48 +08:00
|
|
|
project(JKQTPlotter
|
|
|
|
LANGUAGES CXX
|
|
|
|
VERSION 5.0.0
|
|
|
|
HOMEPAGE_URL https://github.com/jkriege2/JKQtPlotter
|
|
|
|
DESCRIPTION "an extensive Qt5 & Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies"
|
|
|
|
)
|
2019-11-24 17:42:23 +08:00
|
|
|
|
|
|
|
|
2019-11-18 22:59:06 +08:00
|
|
|
# set search path for CMake files
|
2022-04-18 20:24:39 +08:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
|
2019-11-10 22:35:07 +08:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
2019-06-21 04:24:47 +08:00
|
|
|
# Find includes in the build directories
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2019-06-20 21:18:58 +08:00
|
|
|
|
2024-01-14 23:55:06 +08:00
|
|
|
# error message when user tries to make in-source build!
|
|
|
|
include(jkqtplotter_noInsourceBuilds)
|
|
|
|
|
2019-11-18 22:59:06 +08:00
|
|
|
# Common Includes for JKQtPlotter
|
|
|
|
include(jkqtplotter_common_include)
|
2019-06-22 20:21:32 +08:00
|
|
|
|
2019-11-18 22:59:06 +08:00
|
|
|
# Project Name and Version
|
2019-11-19 01:46:08 +08:00
|
|
|
include(jkqtplotter_lib_properties)
|
2019-06-20 21:18:58 +08:00
|
|
|
|
2019-11-18 22:59:06 +08:00
|
|
|
# CMake options with default values and description texts
|
|
|
|
include(jkqtplotter_cmake_options)
|
2019-06-20 21:18:58 +08:00
|
|
|
|
2019-11-18 22:59:06 +08:00
|
|
|
# compiler settings for this lib
|
|
|
|
include(jkqtplotter_common_compilersettings)
|
2019-06-20 21:18:58 +08:00
|
|
|
|
2019-11-18 22:59:06 +08:00
|
|
|
# include Qt with appropriate options to build this lib
|
|
|
|
include(jkqtplotter_common_qtsettings)
|
2019-06-21 04:24:47 +08:00
|
|
|
|
2022-10-06 03:52:19 +08:00
|
|
|
# additionnal common macros
|
|
|
|
include(jkqtplotter_macros)
|
|
|
|
|
NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)
NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
2024-01-16 20:05:52 +08:00
|
|
|
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})
|
|
|
|
|
2019-06-21 04:24:47 +08:00
|
|
|
|
|
|
|
|
2019-11-18 22:59:06 +08:00
|
|
|
# now add subdirectories with the library code ...
|
2019-06-20 21:18:58 +08:00
|
|
|
add_subdirectory(lib)
|
|
|
|
|
NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)
NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
2024-01-16 20:05:52 +08:00
|
|
|
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
|
2022-08-08 00:00:05 +08:00
|
|
|
|
NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)
NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
2024-01-16 20:05:52 +08:00
|
|
|
# ... and optionally the examples
|
|
|
|
if(JKQtPlotter_BUILD_EXAMPLES)
|
|
|
|
add_subdirectory(examples)
|
|
|
|
endif()
|
2022-08-08 00:00:05 +08:00
|
|
|
|
NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)
NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
2024-01-16 20:05:52 +08:00
|
|
|
if(JKQtPlotter_BUILD_TOOLS)
|
|
|
|
add_subdirectory(tools)
|
|
|
|
endif()
|
2019-06-21 04:24:47 +08:00
|
|
|
|
NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)
NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
2024-01-16 20:05:52 +08:00
|
|
|
add_subdirectory(doc)
|
2024-01-22 04:58:56 +08:00
|
|
|
|
|
|
|
if (JKQtPlotter_BUILD_TESTS)
|
2024-01-23 18:51:50 +08:00
|
|
|
include(CTest)
|
2024-01-22 04:58:56 +08:00
|
|
|
add_subdirectory(tests)
|
|
|
|
endif()
|
NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)
NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
2024-01-16 20:05:52 +08:00
|
|
|
|
|
|
|
endif()
|
2019-06-21 04:24:47 +08:00
|
|
|
|