Skip to content

Commit 7311948

Browse files
committed
using CMake now to build examples
restructuring/massive renaming to make this possible
1 parent fae6b28 commit 7311948

File tree

486 files changed

+2704
-1580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

486 files changed

+2704
-1580
lines changed

CMakeLists.txt

+21-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ endif()
1919
if(NOT DEFINED BUILD_EXAMPLES)
2020
option(BUILD_EXAMPLES "Build examples" ON)
2121
endif()
22+
if(NOT DEFINED BUILD_HAS_OPENCV)
23+
option(BUILD_HAS_OPENCV "OpenCV available?" OFF)
24+
endif()
2225
if(NOT DEFINED LIB_INSTALL)
2326
option(LIB_INSTALL "Install library" ON)
2427
endif()
28+
2529
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
26-
option(CMAKE_INSTALL_PREFIX "Install directory" ${CMAKE_CURRENT_SOURCE_DIR}/instal)
30+
option(CMAKE_INSTALL_PREFIX "Install directory" ${CMAKE_CURRENT_SOURCE_DIR}/install)
2731
endif()
2832

2933

@@ -36,9 +40,13 @@ if (NOT WIN32)
3640
include(GNUInstallDirs)
3741
endif(NOT WIN32)
3842

39-
# Instruct CMake to run moc+rcc automatically when needed.
43+
# Instruct CMake to run moc+rcc+uic automatically when needed.
4044
set(CMAKE_AUTOMOC ON)
4145
set(CMAKE_AUTORCC ON)
46+
set(CMAKE_AUTOUIC ON)
47+
48+
# Find includes in the build directories
49+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
4250

4351
# Set a default build type if none was specified
4452
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
@@ -61,7 +69,8 @@ if (NOT CMAKE_INSTALL_INCLUDEDIR)
6169
endif()
6270

6371

64-
find_package(Qt5 5.0 REQUIRED Core Gui Widgets PrintSupport)
72+
find_package(Qt5 5.0 REQUIRED Core Gui Widgets PrintSupport Svg Xml OpenGl)
73+
6574

6675

6776
set (CMAKE_CXX_STANDARD 11)
@@ -93,8 +102,16 @@ endif()
93102

94103

95104

105+
# place all DLLs and EXEs in the subdirectory output of the top level directory of the build tree
106+
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
107+
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
108+
109+
110+
96111
add_subdirectory(lib)
97112
if(BUILD_EXAMPLES)
98-
#add_subdirectory(examples)
113+
add_subdirectory(examples)
99114
endif()
100115

116+
117+

JKQtPlotterBuildAllExamples.pro

+14-14
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ SUBDIRS += jkqtplotterlib \
1515
jkqtfastplotter_test
1616

1717

18-
jkqtplotterlib.file = staticlib/jkqtplotterlib/jkqtplotterlib.pro
19-
jkqtplotterlib_sharedlib.file = sharedlib/jkqtplotterlib/jkqtplotterlib.pro
18+
jkqtplotterlib.file = qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro
19+
jkqtplotterlib_sharedlib.file = qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pro
2020

21-
jkqtmathtextlib.file = staticlib/jkqtmathtextlib/jkqtmathtextlib.pro
22-
jkqtmathtextlib_sharedlib.file = sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro
21+
jkqtmathtextlib.file = qmake/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro
22+
jkqtmathtextlib_sharedlib.file = qmake/sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro
2323

24-
jkqtpcommonlib.file = staticlib/jkqtpcommonlib/jkqtpcommonlib.pro
25-
jkqtpcommonlib_sharedlib.file = sharedlib/jkqtpcommonlib/jkqtpcommonlib.pro
24+
jkqtpcommonlib.file = qmake/staticlib/jkqtpcommonlib/jkqtpcommonlib.pro
25+
jkqtpcommonlib_sharedlib.file = qmake/sharedlib/jkqtpcommonlib/jkqtpcommonlib.pro
2626

27-
jkqtfastplotterlib.file = staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro
28-
jkqtfastplotterlib_sharedlib.file = sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro
27+
jkqtfastplotterlib.file = qmake/staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro
28+
jkqtfastplotterlib_sharedlib.file = qmake/sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro
2929

3030
jkqtmathtext_simpletest.subdir = examples/jkqtmathtext_simpletest
3131
jkqtmathtext_simpletest.depends = jkqtmathtextlib
@@ -44,13 +44,13 @@ jkqtfastplotter_test.depends = jkqtfastplotterlib
4444

4545
defineTest(addSimpleTest) {
4646
test_name = $$1
47-
SUBDIRS += jkqtplotter_simpletest_$${test_name}
47+
SUBDIRS += jkqtptst_$${test_name}
4848

49-
jkqtplotter_simpletest_$${test_name}.file = examples/simpletest_$${test_name}/jkqtplotter_simpletest_$${test_name}.pro
50-
jkqtplotter_simpletest_$${test_name}.depends = jkqtplotterlib
49+
jkqtptst_$${test_name}.file = examples/$${test_name}/$${test_name}.pro
50+
jkqtptst_$${test_name}.depends = jkqtplotterlib
5151

52-
export (jkqtplotter_simpletest_$${test_name}.file)
53-
export (jkqtplotter_simpletest_$${test_name}.depends)
52+
export (jkqtptst_$${test_name}.file)
53+
export (jkqtptst_$${test_name}.depends)
5454

5555
export (SUBDIRS)
5656
}
@@ -96,7 +96,7 @@ defineTest(addTest) {
9696
test_name = $$1
9797
SUBDIRS += test_$${test_name}
9898

99-
test_$${test_name}.file = examples/test_$${test_name}/test_$${test_name}.pro
99+
test_$${test_name}.file = examples/$${test_name}/test_$${test_name}.pro
100100
test_$${test_name}.depends = jkqtplotterlib
101101

102102
export (test_$${test_name}.file)

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ The [Screenshots-page](./screenshots/) contains several screenshots, partly take
6161
## Building
6262
Building instructions can be found here:
6363
- include necessary files into QMake project: [`./lib/*.pri`](./lib/README.md)
64-
- [build a static library](./staticlib): [`./staticlib/*.pro`](./staticlib/README.md)
65-
- [build a shared library (DLL, SO, ...)](./sharedlib): [`./sharedlib/*.pro`](./sharedlib/README.md)
64+
- [build a static library](./staticlib): [`./qmake/staticlib/*.pro`](./qmake/staticlib/README.md)
65+
- [build a shared library (DLL, SO, ...)](./sharedlib): [`./qmake/sharedlib/*.pro`](./qmake/sharedlib/README.md)
6666

6767

6868
## Continuous Integration Status

doc/dox/buildinstructions.dox

+20-20
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ include(<PATHTOJKQTPLOTTERDIR>/lib/jkqtplotter.pri)
2121
\subsection page_buildinstructions_QMAKESTATIC QMake Static Library
2222

2323
There are several `.PRO`-files, that can be used to build the full library, or a limited subsets of it as static link library:
24-
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/staticlib/jkqtplotterlib/jkqtplotterlib.pro">staticlib/jkqtplotterlib/jkqtplotterlib.pro</a> builds the complete library (JKQTPlotter, JKQTFastPlotter, JKQTMathText) as static link library
25-
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro">staticlib/jkqtmathtextlib/jkqtmathtextlib.pro</a> builds only JKQTMathText as static link library
26-
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro">staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro</a> builds only JKQTFastPlotter as static link library
24+
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro">qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro</a> builds the complete library (JKQTPlotter, JKQTFastPlotter, JKQTMathText) as static link library
25+
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/qmake/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro">qmake/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro</a> builds only JKQTMathText as static link library
26+
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/qmake/staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro">qmake/staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro</a> builds only JKQTFastPlotter as static link library
2727
.
2828
They will produce a static link library that you can include into your projects, e.g. with the following QMake-snippet:
2929

3030
\code{.qmake}
3131
# include JKQTPlotter library
3232
DEPENDPATH += \
3333
<PATHTOJKQTPLOTTERDIR>/lib \
34-
<PATHTOJKQTPLOTTERDIR>/staticlib/jkqtplotterlib
34+
<PATHTOJKQTPLOTTERDIR>/qmake/staticlib/jkqtplotterlib
3535
INCLUDEPATH += <PATHTOJKQTPLOTTERDIR>/lib
3636
CONFIG (debug, debug|release) {
37-
DEPENDPATH += <PATHTOJKQTPLOTTERDIR>/staticlib/jkqtplotterlib/debug
38-
LIBS += -L<PATHTOJKQTPLOTTERDIR>/staticlib/jkqtplotterlib/debug -ljkqtplotterlib_debug
37+
DEPENDPATH += <PATHTOJKQTPLOTTERDIR>/qmake/staticlib/jkqtplotterlib/debug
38+
LIBS += -L<PATHTOJKQTPLOTTERDIR>/qmake/staticlib/jkqtplotterlib/debug -ljkqtplotterlib_debug
3939
} else {
40-
DEPENDPATH += <PATHTOJKQTPLOTTERDIR>/staticlib/jkqtplotterlib/release
41-
LIBS += -L<PATHTOJKQTPLOTTERDIR>/staticlib/jkqtplotterlib/release -ljkqtplotterlib
40+
DEPENDPATH += <PATHTOJKQTPLOTTERDIR>/qmake/staticlib/jkqtplotterlib/release
41+
LIBS += -L<PATHTOJKQTPLOTTERDIR>/qmake/staticlib/jkqtplotterlib/release -ljkqtplotterlib
4242
}
4343
\endcode
4444

@@ -47,7 +47,7 @@ This snippet assumes that you built the libraries with the provided `.PRO`-files
4747
TEMPLATE = subdirs
4848

4949
# the (static library version) of JKQTPlotter
50-
jkqtplotterlib_static.file = ../../staticlib/jkqtplotterlib/jkqtplotterlib.pro
50+
jkqtplotterlib_static.file = ../../qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro
5151

5252
# your project file, with declared dependencies on jkqtplotterlib_static
5353
test_styling.file=$$PWD/test_styling.pro
@@ -62,34 +62,34 @@ SUBDIRS += jkqtplotterlib_static test_styling
6262
\subsection page_buildinstructions_QMAKEDYNAMIC QMake Dynamic Library
6363

6464
There are several `.PRO`-files, that can be used to build the full library, or a limited subsets of it as shred library:
65-
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/sharedlib/jkqtplotterlib/jkqtplotterlib.pro">sharedlib/jkqtplotterlib/jkqtplotterlib.pro</a> builds the complete library (JKQTPlotter, JKQTFastPlotter, JKQTMathText) as shared library
66-
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro">sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro</a> builds only JKQTMathText as shared library
67-
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro">sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro</a> builds only JKQTFastPlotter as shared library
65+
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pro">qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pro</a> builds the complete library (JKQTPlotter, JKQTFastPlotter, JKQTMathText) as shared library
66+
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/qmake/sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro">qmake/sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro</a> builds only JKQTMathText as shared library
67+
- <a href="https://github.com/jkriege2/JKQtPlotter/blob/master/qmake/sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro">qmake/sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro</a> builds only JKQTFastPlotter as shared library
6868
.
6969
They will produce a dynamic link library that you can include into your projects, e.g. with the following QMake-snippet:
7070

7171
\code{.qmake}
7272
# include JKQTPlotter library
7373
DEPENDPATH += \
7474
<PATHTOJKQTPLOTTERDIR>/lib \
75-
<PATHTOJKQTPLOTTERDIR>/sharedlib/jkqtplotterlib
75+
<PATHTOJKQTPLOTTERDIR>/qmake/sharedlib/jkqtplotterlib
7676
INCLUDEPATH += <PATHTOJKQTPLOTTERDIR>/lib
7777
CONFIG (debug, debug|release) {
7878
# ensure that DLLs are copied to the output directory
79-
install_jkqtplotter_dll.files = <PATHTOJKQTPLOTTERDIR>/sharedlib/jkqtplotterlib/debug/jkqtplotterlib_debug.*
79+
install_jkqtplotter_dll.files = <PATHTOJKQTPLOTTERDIR>/qmake/sharedlib/jkqtplotterlib/debug/jkqtplotterlib_debug.*
8080
install_jkqtplotter_dll.path = $$OUT_PWD
8181
INSTALLS += install_jkqtplotter_dll
8282
# link agains DLLs
83-
DEPENDPATH += <PATHTOJKQTPLOTTERDIR>/sharedlib/jkqtplotterlib/debug
84-
LIBS += -L<PATHTOJKQTPLOTTERDIR>/sharedlib/jkqtplotterlib/debug -ljkqtplotterlib_debug
83+
DEPENDPATH += <PATHTOJKQTPLOTTERDIR>/qmake/sharedlib/jkqtplotterlib/debug
84+
LIBS += -L<PATHTOJKQTPLOTTERDIR>/qmake/sharedlib/jkqtplotterlib/debug -ljkqtplotterlib_debug
8585
} else {
8686
# ensure that DLLs are copied to the output directory
87-
install_jkqtplotter_dll.files = <PATHTOJKQTPLOTTERDIR>/sharedlib/jkqtplotterlib/release/jkqtplotterlib.*
87+
install_jkqtplotter_dll.files = <PATHTOJKQTPLOTTERDIR>/qmake/sharedlib/jkqtplotterlib/release/jkqtplotterlib.*
8888
install_jkqtplotter_dll.path = $$OUT_PWD
8989
INSTALLS += install_jkqtplotter_dll
9090
# link agains DLLs
91-
DEPENDPATH += <PATHTOJKQTPLOTTERDIR>/sharedlib/jkqtplotterlib/release
92-
LIBS += -L<PATHTOJKQTPLOTTERDIR>/sharedlib/jkqtplotterlib/release -ljkqtplotterlib
91+
DEPENDPATH += <PATHTOJKQTPLOTTERDIR>/qmake/sharedlib/jkqtplotterlib/release
92+
LIBS += -L<PATHTOJKQTPLOTTERDIR>/qmake/sharedlib/jkqtplotterlib/release -ljkqtplotterlib
9393
}
9494
\endcode
9595

@@ -98,7 +98,7 @@ This snippet assumes that you built the libraries with the provided `.PRO`-files
9898
TEMPLATE = subdirs
9999

100100
# the (shared library version) of JKQTPlotter
101-
jkqtplotterlib_shared.file = ../../sharedlib/jkqtplotterlib.pro
101+
jkqtplotterlib_shared.file = ../../qmake/sharedlib/jkqtplotterlib.pro
102102

103103
# your project file, with declared dependencies on jkqtplotterlib_shared
104104
test_styling.file=$$PWD/test_styling.pro

0 commit comments

Comments
 (0)