mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-11-15 10:05:47 +08:00
+ added license/readme output to INSTALL-target in CMake
+ added example demonstrating how to link against a CMake-build of JKQTPlotter + improved documentation
This commit is contained in:
parent
34b31812ba
commit
933d374533
@ -3,7 +3,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
|
||||
|
||||
project(JKQTPlotter LANGUAGES CXX)
|
||||
project(JKQTPlotter LANGUAGES CXX VERSION 2019.06)
|
||||
|
||||
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
/*!
|
||||
|
||||
\page page_buildinstructions Build Instructions
|
||||
This page explains how to use JKQTPlotter in your own Projects
|
||||
|
||||
This page explains how to build JKQTPlotter and to use the results in your own Projects.
|
||||
|
||||
\tableofcontents
|
||||
|
||||
@ -9,7 +10,7 @@ This page explains how to use JKQTPlotter in your own Projects
|
||||
|
||||
\subsection page_buildinstructions_CMAKE_RUN Running a Build with CMake
|
||||
|
||||
The preferred way to build JKQTPlotter is using <a href="https://cmake.org/">CMake</a>. The CMake-build is defined in `CMakeLists.txt` files, found in many of the directories of the code repository.
|
||||
The preferred way to build JKQTPlotter is using <a href="https://cmake.org/">CMake</a>. You can find a detailed explanation of CMake at https://cliutils.gitlab.io/modern-cmake/. The CMake-build is defined in `CMakeLists.txt` files, found in many of the directories of the code repository. Especially in the root directory and the two subdirectories \c ./lib/ and \c ./examples/ .
|
||||
|
||||
You can build JKQTPlotter (and also the examples) by either opening the file <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/CMakeLists.txt">CMakeLists.txt</a> in QTCreator (which has CMake integration), or by calling \c CMake by hand. How to do this depends on your local system und build environment.
|
||||
|
||||
@ -23,6 +24,7 @@ You can use (MinGW) Makefiles by calling:
|
||||
$ cd build
|
||||
$ cmake .. -G "MinGW Makefiles" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources>"
|
||||
$ cmake --build . --config "Debug"
|
||||
$ cmake --build . --config "Debug" --target install
|
||||
\endcode
|
||||
|
||||
\subsubsection page_buildinstructions_CMAKE_VSTUDIO Building with Visual Studio
|
||||
@ -37,8 +39,10 @@ Where \c <path_to_your_qt_sources> could be e.g. \c C:/development/Qt5/5.12.0/ms
|
||||
\code{.sh}
|
||||
$ cmake --build . --config "Debug"
|
||||
\endcode
|
||||
|
||||
|
||||
Afterwards you can install the library by
|
||||
\code{.sh}
|
||||
$ cmake --build . --config "Debug" --target install
|
||||
\endcode
|
||||
|
||||
\subsection page_buildinstructions_CMAKE_CONFIG Configuring a Build with CMake
|
||||
|
||||
@ -52,18 +56,82 @@ The CMake build system offers several configuration variables that you may set/c
|
||||
- \c BUILD_EXAMPLES : Build examples (default: \c ON )
|
||||
- \c BUILD_HAS_OPENCV : OpenCV available? If yes, OpenCV examples are built when BUILD_EXAMPLES=ON (default: \c OFF )
|
||||
- \c LIB_INSTALL : Install library (default: \c ON )
|
||||
- \c CMAKE_INSTALL_PREFIX : Install directory (default: \c${CMAKE_CURRENT_SOURCE_DIR}/install )
|
||||
- \c CMAKE_INSTALL_PREFIX : Install directory for the library
|
||||
.
|
||||
|
||||
|
||||
|
||||
|
||||
\subsection page_buildinstructions_CMAKE_USAGE Using a built, generated with CMake
|
||||
|
||||
After building and installing JKQTPlotter you have all files that you need inside the instal directory:
|
||||
- \c <INSTALLDIR>/include contains all required header files
|
||||
- \c <INSTALLDIR>/bin contains the shared libraries
|
||||
- \c <INSTALLDIR>/lib contains the link libraries
|
||||
- \c <INSTALLDIR>/lib/cmake contains files necessary for CMake's \c find_package() to work
|
||||
.
|
||||
|
||||
You can find an example project that uses a complete cmake-build here: \ref JKQTCMakeLinkExample (online: <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/examples/cmake_link_example">https://github.com/jkriege2/JKQtPlotter/blob/master/examples/cmake_link_example</a>).
|
||||
|
||||
Here is the \c CMakeLists.txt from that directory:
|
||||
|
||||
\code
|
||||
# set minimum required CMake-Version
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
# set Project name
|
||||
set(EXAMPLE_NAME simpletest)
|
||||
set(EXENAME jkqtptest_${EXAMPLE_NAME})
|
||||
project(${EXAMPLE_NAME} LANGUAGES CXX)
|
||||
|
||||
# some basic configurations
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
# Configure project for usage of Qt5
|
||||
find_package(Qt5 5.12 REQUIRED Core Gui Widgets PrintSupport Svg Xml OpenGl)
|
||||
|
||||
# include JKQTPlotter
|
||||
find_package(JKQTCommonLib)
|
||||
find_package(JKQTMathTextLib)
|
||||
find_package(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()
|
||||
|
||||
# add the example executable
|
||||
add_executable(${EXENAME} WIN32 simpletest.cpp)
|
||||
# ... and link against 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} JKQTPlotterLib)
|
||||
\endcode
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
To build this example, you first need to make a subdirectory `build` and then call CMake form that subdirectory:
|
||||
\code.sh
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake .. -G "<GENERATOR>" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources> -DCMAKE_MODULE_PATH=<path_to_lib/cmake_dir_of_JKQTPLOTTER>"
|
||||
\endcode
|
||||
The you can use the generated makefiles (e.g. load them in an editor, or build them jsing \c make ). In the last line above, you need to specify two directories:
|
||||
- \c <path_to_your_qt_sources> points to you Qt installation
|
||||
- \c <path_to_lib/cmake_dir_of_JKQTPLOTTER> points to the directory containing the \c XYZ.cmake -files from the JKQTPlotter build. Typically this is \c <JKQTPLOTTER_INSTALL_DIR>/lib/cmake , where \c <JKQTPLOTTER_INSTALL_DIR> is the directory into which you installed JKQTPlotter.
|
||||
.
|
||||
|
||||
\section page_buildinstructions_QMAKE Build using QMake
|
||||
|
||||
|
@ -205,4 +205,13 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
|
||||
</table>
|
||||
|
||||
|
||||
\subsection jkqtp_extut_cmake_build CMake Build System
|
||||
|
||||
<table>
|
||||
<tr><th> Screenshot <th> Description <th> Notes
|
||||
<tr><td> \image html jkqtmathtext_simpletest_small.png
|
||||
<td> \subpage JKQTCMakeLinkExample
|
||||
<td> explains how to link against JKQTPlotter with CMake
|
||||
</table>
|
||||
|
||||
*/
|
@ -53,7 +53,7 @@
|
||||
- is optimized for fast plotting, but is not as feature-rich as JKQTPlotter
|
||||
- may be used independently of JKQTPlotter
|
||||
- for more details, see: \ref jkqtfastplotter
|
||||
- CMake-based build system
|
||||
- CMake-based build system, see: \ref page_buildinstructions_CMAKE
|
||||
- \ref exampleTutorialProjects "extensive set of Examples and Tutorials"
|
||||
- extensive doxygen-generated <a href="http://jkriege2.github.io/JKQtPlotter/index.html">Online-Documentation (http://jkriege2.github.io/JKQtPlotter/index.html)</a>
|
||||
- source code hosted&developed on GitHub <a href="https://github.com/jkriege2/JKQtPlotter">https://github.com/jkriege2/JKQtPlotter</a> (including continuous integration builds: <a href="https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master">https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master</a>)
|
||||
|
@ -87,3 +87,10 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
|
||||
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtmathtext_simpletest_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtmathtext_simpletest) | [JKQTMathText: Simple Demonstration](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtmathtext_simpletest) | |
|
||||
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtmathtext_testapp_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtmathtext_test) | [JKQTMathText: Full Testing Application](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtmathtext_test) | |
|
||||
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtfastplotter_test_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtfastplotter_test) | [JKQTFastPlotter: Example](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtfastplotter_test) | |
|
||||
|
||||
|
||||
## CMake Build System
|
||||
|
||||
| Screenshot | Description | Notes |
|
||||
|:-------------:| ------------- | ------------- |
|
||||
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest1_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest/README.md) | [CMake Example Linking Against JKQTPlotter](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/cmake_link_example) | explains how to link against JKQTPlotter with CMake |
|
||||
|
42
examples/cmake_link_example/CMakeLists.txt
Normal file
42
examples/cmake_link_example/CMakeLists.txt
Normal file
@ -0,0 +1,42 @@
|
||||
# set minimum required CMake-Version
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
# set Project name
|
||||
set(EXAMPLE_NAME simpletest)
|
||||
set(EXENAME jkqtptest_${EXAMPLE_NAME})
|
||||
project(${EXAMPLE_NAME} LANGUAGES CXX)
|
||||
|
||||
# some basic configurations
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
# Configure project for usage of Qt5
|
||||
find_package(Qt5 5.12 REQUIRED Core Gui Widgets PrintSupport Svg Xml OpenGl)
|
||||
|
||||
# include JKQTPlotter
|
||||
find_package(JKQTCommonLib)
|
||||
find_package(JKQTMathTextLib)
|
||||
find_package(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()
|
||||
|
||||
# add the example executable
|
||||
add_executable(${EXENAME} WIN32 simpletest.cpp)
|
||||
# ... and link against 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} JKQTPlotterLib)
|
59
examples/cmake_link_example/README.md
Normal file
59
examples/cmake_link_example/README.md
Normal file
@ -0,0 +1,59 @@
|
||||
# Example (JKQTPlotter): CMake Example {#JKQTCMakeLinkExample}
|
||||
|
||||
This project (see [`cmake_link_example`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/cmake_link_example) demonstrates how to link against JKQTPlotter using CMake. See http://jkriege2.github.io/JKQtPlotter/page_buildinstructions.html for details on how to build JKQTPlotter with CMake
|
||||
|
||||
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.0)
|
||||
|
||||
# set Project name
|
||||
set(EXAMPLE_NAME simpletest)
|
||||
set(EXENAME jkqtptest_${EXAMPLE_NAME})
|
||||
project(${EXAMPLE_NAME} LANGUAGES CXX)
|
||||
|
||||
# some basic configurations
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
# Configure project for usage of Qt5
|
||||
find_package(Qt5 5.12 REQUIRED Core Gui Widgets PrintSupport Svg Xml OpenGl)
|
||||
|
||||
# include JKQTPlotter
|
||||
find_package(JKQTCommonLib)
|
||||
find_package(JKQTMathTextLib)
|
||||
find_package(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()
|
||||
|
||||
# add the example executable
|
||||
add_executable(${EXENAME} WIN32 simpletest.cpp)
|
||||
# ... and link against 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} JKQTPlotterLib)
|
||||
```
|
||||
|
||||
To build this example, you first need to make a subdirectory `build` and then call CMake form that subdirectory:
|
||||
```.sh
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake .. -G "<GENERATOR>" "-DCMAKE_PREFIX_PATH=<path_to_your_qt_sources> -DCMAKE_MODULE_PATH=<path_to_lib/cmake_dir_of_JKQTPLOTTER>"
|
||||
```
|
||||
The you can use the generated makefiles (e.g. load them in an editor, or build them jsing `make`). In the last line above, you need to specify two directories:
|
||||
- `<path_to_your_qt_sources>` points to you Qt installation
|
||||
- `<path_to_lib/cmake_dir_of_JKQTPLOTTER>` points to the directory containing the `XYZ.cmake`-files from the JKQTPlotter build. Typically this is `<JKQTPLOTTER_INSTALL_DIR>/lib/cmake`, where `<JKQTPLOTTER_INSTALL_DIR>` is the directory into which you installed JKQTPlotter.
|
54
examples/cmake_link_example/simpletest.cpp
Normal file
54
examples/cmake_link_example/simpletest.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
/** \example jkqtplotter_simpletest.cpp
|
||||
* A very basic example for the usage of JKQTPlotter, using CMake
|
||||
*
|
||||
* \ref JKQTCMakeLinkExample
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
#include "jkqtplotter/jkqtplotter.h"
|
||||
#include "jkqtplotter/graphs/jkqtpscatter.h"
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
JKQTPlotter plot;
|
||||
JKQTPDatastore* ds=plot.getDatastore();
|
||||
|
||||
// 2. now we create data for a simple plot (a sine curve)
|
||||
QVector<double> X, Y;
|
||||
const int Ndata=100;
|
||||
for (int i=0; i<Ndata; i++) {
|
||||
const double x=double(i)/double(Ndata)*8.0*M_PI;
|
||||
X<<x;
|
||||
Y<<sin(x);
|
||||
}
|
||||
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal datastore.
|
||||
// Note: In this step the data is copied (of not specified otherwise), so you can
|
||||
// reuse X and Y afterwards!
|
||||
// the variables columnX and columnY will contain the internal column ID of the newly
|
||||
// created columns with names "x" and "y" and the (copied) data from X and Y.
|
||||
size_t columnX=ds->addCopiedColumn(X, "x");
|
||||
size_t columnY=ds->addCopiedColumn(Y, "y");
|
||||
|
||||
// 4. create a graph in the plot, which plots the dataset X/Y:
|
||||
JKQTPXYLineGraph* graph1=new JKQTPXYLineGraph(&plot);
|
||||
graph1->setXColumn(columnX);
|
||||
graph1->setYColumn(columnY);
|
||||
graph1->setTitle(QObject::tr("sine graph"));
|
||||
|
||||
// 5. add the graph to the plot, so it is actually displayed
|
||||
plot.addGraph(graph1);
|
||||
|
||||
// 6. autoscale the plot so the graph is contained
|
||||
plot.zoomToFit();
|
||||
|
||||
// show plotter and make it a decent size
|
||||
plot.show();
|
||||
plot.resize(600,400);
|
||||
|
||||
return app.exec();
|
||||
}
|
@ -20,6 +20,8 @@ message( STATUS "Installing to: ${CMAKE_INSTALL_PREFIX}" )
|
||||
message( STATUS "=============================================================================" )
|
||||
message( STATUS )
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/jkqtplotter_version.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/jkqtplotter_version.h)
|
||||
|
||||
|
||||
include_directories(.)
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
set(libBasename JKQTCommon)
|
||||
set(libIncludeSubdir jkqtcommon)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(libsh_name ${libBasename}SharedLib)
|
||||
@ -65,6 +66,8 @@ set(HEADERS
|
||||
jkqtpstatgrouped.h
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS})
|
||||
@ -74,8 +77,9 @@ if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(${libsh_name} PUBLIC JKQTCOMMON_LIB_IN_DLL)
|
||||
target_compile_definitions(${libsh_name} PRIVATE JKQTCOMMON_LIB_EXPORT_LIBRARY)
|
||||
set_property(TARGET ${libsh_name} PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS "ON")
|
||||
# include(GenerateExportHeader)
|
||||
# generate_export_header(${libsh_name})
|
||||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion )
|
||||
endif()
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
@ -83,6 +87,9 @@ if(BUILD_STATIC_LIBS)
|
||||
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
||||
target_link_libraries(${lib_name} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport)
|
||||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion )
|
||||
endif()
|
||||
|
||||
|
||||
@ -95,8 +102,13 @@ if(LIB_INSTALL)
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtcommon
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
|
||||
)
|
||||
install(EXPORT ${libsh_name}_TARGETS
|
||||
FILE ${libsh_name}Config.cmake
|
||||
DESTINATION lib/cmake
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" DESTINATION lib/cmake )
|
||||
endif(BUILD_SHARED_LIBS)
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
@ -104,12 +116,20 @@ if(LIB_INSTALL)
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtcommon
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
|
||||
)
|
||||
install(EXPORT ${lib_name}_TARGETS
|
||||
FILE ${lib_name}Config.cmake
|
||||
DESTINATION lib/cmake
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" DESTINATION lib/cmake )
|
||||
endif(BUILD_STATIC_LIBS)
|
||||
|
||||
install(FILES ${HEADERS}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtcommon
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
|
||||
COMPONENT Headers)
|
||||
|
||||
configure_file(${CMAKE_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 doc/ )
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/LICENSE" DESTINATION doc/ RENAME "${lib_name}_LICENSE.txt" )
|
||||
endif(LIB_INSTALL)
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
set(libBasename JKQTFastPlotter)
|
||||
set(libIncludeSubdir jkqtfastplotter)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(libsh_name ${libBasename}SharedLib)
|
||||
@ -28,6 +29,8 @@ set(HEADERS
|
||||
)
|
||||
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS} ${RESOURCES})
|
||||
@ -37,8 +40,9 @@ if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(${libsh_name} PUBLIC JKQTFASTPLOTTER_LIB_IN_DLL)
|
||||
target_compile_definitions(${libsh_name} PRIVATE JKQTFASTPLOTTER_LIB_EXPORT_LIBRARY)
|
||||
set_property(TARGET ${libsh_name} PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS "ON")
|
||||
# include(GenerateExportHeader)
|
||||
# generate_export_header(${libsh_name})
|
||||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion )
|
||||
endif()
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
@ -46,6 +50,9 @@ if(BUILD_STATIC_LIBS)
|
||||
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
||||
target_link_libraries(${lib_name} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL JKQTCommonLib)
|
||||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion )
|
||||
endif()
|
||||
|
||||
|
||||
@ -58,8 +65,13 @@ if(LIB_INSTALL)
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtfastplotter
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
|
||||
)
|
||||
install(EXPORT ${libsh_name}_TARGETS
|
||||
FILE ${libsh_name}Config.cmake
|
||||
DESTINATION lib/cmake
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" DESTINATION lib/cmake )
|
||||
endif(BUILD_SHARED_LIBS)
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
@ -67,12 +79,21 @@ if(LIB_INSTALL)
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtfastplotter
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
|
||||
)
|
||||
install(EXPORT ${lib_name}_TARGETS
|
||||
FILE ${lib_name}Config.cmake
|
||||
DESTINATION lib/cmake
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" DESTINATION lib/cmake )
|
||||
endif(BUILD_STATIC_LIBS)
|
||||
|
||||
install(FILES ${HEADERS}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtfastplotter
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
|
||||
COMPONENT Headers)
|
||||
|
||||
configure_file(${CMAKE_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 doc/ )
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/LICENSE" DESTINATION doc/ RENAME "${lib_name}_LICENSE.txt" )
|
||||
|
||||
endif(LIB_INSTALL)
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
set(libBasename JKQTMathText)
|
||||
set(libIncludeSubdir jkqtmathtext)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(libsh_name ${libBasename}SharedLib)
|
||||
@ -35,6 +36,8 @@ if(BUILD_INCLUDE_XITS_FONTS)
|
||||
endif(BUILD_INCLUDE_XITS_FONTS)
|
||||
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS} ${RESOURCES})
|
||||
set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||
@ -43,8 +46,9 @@ if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(${libsh_name} PUBLIC JKQTMATHTEXT_LIB_IN_DLL)
|
||||
target_compile_definitions(${libsh_name} PRIVATE JKQTMATHTEXT_LIB_EXPORT_LIBRARY)
|
||||
set_property(TARGET ${libsh_name} PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS "ON")
|
||||
# include(GenerateExportHeader)
|
||||
# generate_export_header(${libsh_name})
|
||||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion )
|
||||
endif()
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
@ -52,6 +56,9 @@ if(BUILD_STATIC_LIBS)
|
||||
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
||||
target_link_libraries(${lib_name} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport JKQTCommonLib)
|
||||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion )
|
||||
endif()
|
||||
|
||||
|
||||
@ -64,8 +71,13 @@ if(LIB_INSTALL)
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtmathtext
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
|
||||
)
|
||||
install(EXPORT ${libsh_name}_TARGETS
|
||||
FILE ${libsh_name}Config.cmake
|
||||
DESTINATION lib/cmake
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" DESTINATION lib/cmake )
|
||||
endif(BUILD_SHARED_LIBS)
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
@ -73,12 +85,21 @@ if(LIB_INSTALL)
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtmathtext
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
|
||||
)
|
||||
install(EXPORT ${lib_name}_TARGETS
|
||||
FILE ${lib_name}Config.cmake
|
||||
DESTINATION lib/cmake
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" DESTINATION lib/cmake )
|
||||
endif(BUILD_STATIC_LIBS)
|
||||
|
||||
install(FILES ${HEADERS}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtmathtext
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
|
||||
COMPONENT Headers)
|
||||
|
||||
configure_file(${CMAKE_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 doc/ )
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/LICENSE" DESTINATION doc/ RENAME "${lib_name}_LICENSE.txt" )
|
||||
|
||||
endif(LIB_INSTALL)
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
set(libBasename JKQTPlotter)
|
||||
set(libIncludeSubdir jkqtplotter)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(libsh_name ${libBasename}SharedLib)
|
||||
@ -124,6 +125,8 @@ set(RESOURCES
|
||||
resources/jkqtpstyles.qrc
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(${libsh_name} SHARED ${SOURCES} ${SOURCES_GRAPHS} ${SOURCES_GUI} ${SOURCES_OVERLAYS} ${HEADERS} ${HEADERS_GRAPHS} ${HEADERS_GUI} ${HEADERS_OVERLAYS} ${RESOURCES})
|
||||
@ -133,8 +136,9 @@ if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(${libsh_name} PUBLIC JKQTPLOTTER_LIB_IN_DLL)
|
||||
target_compile_definitions(${libsh_name} PRIVATE JKQTPLOTTER_LIB_EXPORT_LIBRARY)
|
||||
set_property(TARGET ${libsh_name} PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS "ON")
|
||||
# include(GenerateExportHeader)
|
||||
# generate_export_header(${libsh_name})
|
||||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion )
|
||||
endif()
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
@ -142,6 +146,9 @@ if(BUILD_STATIC_LIBS)
|
||||
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
||||
target_link_libraries(${lib_name} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::Svg Qt5::Xml JKQTCommonLib JKQTMathTextLib)
|
||||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion )
|
||||
endif()
|
||||
|
||||
|
||||
@ -156,6 +163,11 @@ if(LIB_INSTALL)
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
install(EXPORT ${libsh_name}_TARGETS
|
||||
FILE ${libsh_name}Config.cmake
|
||||
DESTINATION lib/cmake
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" DESTINATION lib/cmake )
|
||||
endif(BUILD_SHARED_LIBS)
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
@ -165,22 +177,31 @@ if(LIB_INSTALL)
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
install(EXPORT ${lib_name}_TARGETS
|
||||
FILE ${lib_name}Config.cmake
|
||||
DESTINATION lib/cmake
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" DESTINATION lib/cmake )
|
||||
endif(BUILD_STATIC_LIBS)
|
||||
|
||||
install(FILES ${HEADERS}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtplotter
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}
|
||||
COMPONENT Headers)
|
||||
|
||||
install(FILES ${HEADERS_GRAPHS}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtplotter/graphs
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}/graphs
|
||||
COMPONENT Headers)
|
||||
|
||||
install(FILES ${HEADERS_GUI}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtplotter/gui
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}/gui
|
||||
COMPONENT Headers)
|
||||
|
||||
install(FILES ${SOURCES_OVERLAYS}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jkqtplotter/overlays
|
||||
install(FILES ${HEADERS_OVERLAY}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir}/overlays
|
||||
COMPONENT Headers)
|
||||
|
||||
configure_file(${CMAKE_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 doc/ )
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/LICENSE" DESTINATION doc/ RENAME "${lib_name}_LICENSE.txt" )
|
||||
|
||||
endif(LIB_INSTALL)
|
||||
|
30
lib/jkqtplotter_version.h.in
Normal file
30
lib/jkqtplotter_version.h.in
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>)
|
||||
|
||||
|
||||
|
||||
This software is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License (LGPL) as published by
|
||||
the Free Software Foundation, either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License (LGPL) for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License (LGPL)
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef JKQTPLOTTER_VERSION_DEFINES_H
|
||||
#define JKQTPLOTTER_VERSION_DEFINES_H
|
||||
|
||||
namespace JKQTPLOTTER_VERSION {
|
||||
const char* PROJECT_LONGNAME = "@PROJECT_LONGNAME@";
|
||||
const char* PROJECT_VERSION = "@PROJECT_VERSION@";
|
||||
const char* PROJECT_BITNESS = "@PROJECT_BITNESS@";
|
||||
}
|
||||
|
||||
#JKQTPLOTTER_VERSION_DEFINES_H
|
||||
// vim: ft=cpp
|
20
readme.txt.in
Normal file
20
readme.txt.in
Normal file
@ -0,0 +1,20 @@
|
||||
=============================================================================
|
||||
== JKQTPlotters is a library for scientific plotting using Qt5 ==
|
||||
== sub-library: @libBasename@
|
||||
=============================================================================
|
||||
|
||||
Library Information:
|
||||
version: @PROJECT_VERSION@
|
||||
main author/maintainer: Jan Krieger <jan@jkrieger.de>
|
||||
copyright: (c) 2008-2019 by Jan Krieger
|
||||
license: GNU LESSER GENERAL PUBLIC LICENSE >= v2.1
|
||||
repository: https://github.com/jkriege2/JKQtPlotter
|
||||
documentation: http://jkriege2.github.io/JKQtPlotter/index.html
|
||||
|
||||
Build information:
|
||||
used compiler: @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@
|
||||
used Qt version: @Qt5_VERSION@
|
||||
built static libs: @BUILD_STATIC_LIBS@
|
||||
built shared libs: @BUILD_SHARED_LIBS@
|
||||
built examples: @BUILD_EXAMPLES@
|
||||
included XITS fonts: @BUILD_INCLUDE_XITS_FONTS@
|
Loading…
Reference in New Issue
Block a user