From f3fa587541bdd5a0cee0558a5d2ecfef8b0d1a4e Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Mon, 18 Nov 2019 15:59:06 +0100 Subject: [PATCH] reworked CMake build system ... now JKQT...Config.cmake-files are written into the correct directory --- .gitignore | 1 + CMakeLists.txt | 109 +++--------------- cmake/jkqtplotter_cmake_options.cmake | 43 +++++++ .../jkqtplotter_common_compilersettings.cmake | 36 +++--- cmake/jkqtplotter_common_include.cmake | 4 + cmake/jkqtplotter_common_qtsettings.cmake | 7 ++ cmake/jkqtplotter_deployqt.cmake | 2 +- cmake/jkqtplotter_dumpallvariables.cmake | 14 +++ cmake/jkqtplotter_lib_properties.cmake | 2 + common_include.cmake | 1 - doc/dox/buildinstructions.dox | 86 +++++++------- examples/advplotstyling/CMakeLists.txt | 9 +- examples/barchart/CMakeLists.txt | 9 +- examples/boxplot/CMakeLists.txt | 9 +- examples/cmake_link_example/CMakeLists.txt | 25 ++-- examples/cmake_link_example/README.md | 78 +++++++------ examples/contourplot/CMakeLists.txt | 9 +- examples/datastore/CMakeLists.txt | 9 +- examples/datastore_groupedstat/CMakeLists.txt | 8 +- examples/datastore_iterators/CMakeLists.txt | 9 +- examples/datastore_regression/CMakeLists.txt | 9 +- examples/datastore_statistics/CMakeLists.txt | 9 +- .../datastore_statistics_2d/CMakeLists.txt | 8 +- examples/dateaxes/CMakeLists.txt | 8 +- examples/distributionplot/CMakeLists.txt | 9 +- examples/errorbarstyles/CMakeLists.txt | 9 +- examples/filledgraphs/CMakeLists.txt | 9 +- examples/functionplot/CMakeLists.txt | 9 +- examples/geometric/CMakeLists.txt | 9 +- examples/imageplot/CMakeLists.txt | 9 +- examples/imageplot_cimg/CMakeLists.txt | 8 +- examples/imageplot_modifier/CMakeLists.txt | 9 +- examples/imageplot_nodatastore/CMakeLists.txt | 9 +- examples/imageplot_opencv/CMakeLists.txt | 9 +- examples/imageplot_userpal/CMakeLists.txt | 9 +- examples/impulsesplot/CMakeLists.txt | 9 +- examples/jkqtfastplotter_test/CMakeLists.txt | 9 +- .../jkqtmathtext_simpletest/CMakeLists.txt | 9 +- examples/jkqtmathtext_test/CMakeLists.txt | 9 +- examples/jkqtplot_test/CMakeLists.txt | 9 +- examples/logaxes/CMakeLists.txt | 9 +- examples/multiplot/CMakeLists.txt | 9 +- examples/parametriccurve/CMakeLists.txt | 9 +- examples/paramscatterplot/CMakeLists.txt | 9 +- .../paramscatterplot_image/CMakeLists.txt | 9 +- examples/parsedfunctionplot/CMakeLists.txt | 9 +- examples/rgbimageplot/CMakeLists.txt | 9 +- examples/rgbimageplot_cimg/CMakeLists.txt | 10 +- examples/rgbimageplot_opencv/CMakeLists.txt | 8 +- examples/rgbimageplot_qt/CMakeLists.txt | 9 +- examples/simpletest/CMakeLists.txt | 9 +- examples/speed/CMakeLists.txt | 8 +- examples/stackedbars/CMakeLists.txt | 9 +- examples/stepplots/CMakeLists.txt | 9 +- examples/styledboxplot/CMakeLists.txt | 9 +- examples/styling/CMakeLists.txt | 9 +- examples/symbols_and_errors/CMakeLists.txt | 9 +- examples/symbols_and_styles/CMakeLists.txt | 9 +- examples/ui/CMakeLists.txt | 9 +- examples/user_interaction/CMakeLists.txt | 9 +- examples/violinplot/CMakeLists.txt | 9 +- lib/CMakeLists.txt | 9 +- lib/jkqtcommon/CMakeLists.txt | 54 +++++---- lib/jkqtfastplotter/CMakeLists.txt | 100 ++++++++-------- lib/jkqtmathtext/CMakeLists.txt | 109 ++++++++++-------- lib/jkqtplotter/CMakeLists.txt | 60 ++++++---- 66 files changed, 578 insertions(+), 589 deletions(-) create mode 100644 cmake/jkqtplotter_cmake_options.cmake rename common_compilersettings.cmake => cmake/jkqtplotter_common_compilersettings.cmake (96%) create mode 100644 cmake/jkqtplotter_common_include.cmake create mode 100644 cmake/jkqtplotter_common_qtsettings.cmake create mode 100644 cmake/jkqtplotter_dumpallvariables.cmake create mode 100644 cmake/jkqtplotter_lib_properties.cmake delete mode 100644 common_include.cmake diff --git a/.gitignore b/.gitignore index 77b28d73be..f6f3274a5c 100644 --- a/.gitignore +++ b/.gitignore @@ -95,3 +95,4 @@ Sicherungskopie_* /examples/simpletest_rgbimageplot_opencv/opencv /build /*.10-pre1 +/install diff --git a/CMakeLists.txt b/CMakeLists.txt index 0879e72b4a..9b169acd10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,111 +1,32 @@ cmake_minimum_required(VERSION 3.0) + +# set search path for CMake files list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) - - - -project(JKQTPlotter LANGUAGES CXX VERSION 2019.06) - - - -if(NOT DEFINED BUILD_SHARED_LIBS) - option(BUILD_SHARED_LIBS "Build as shared library" ON) -endif() -if(NOT DEFINED BUILD_STATIC_LIBS) - option(BUILD_STATIC_LIBS "Build as static library" ON) -endif() -if(NOT DEFINED BUILD_INCLUDE_XITS_FONTS) - option(BUILD_INCLUDE_XITS_FONTS "Include XITS fonts as resources in library" ON) -endif() -if(NOT DEFINED BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE) - option(BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE "If set, the build-type is appended to the library name" ON) -endif() -if(NOT DEFINED BUILD_HIGH_COMPILE_WARNING_LEVEL) - option(BUILD_HIGH_COMPILE_WARNING_LEVEL "Set Compiler Warning level to high" OFF) -endif() -if(NOT DEFINED BUILD_EXAMPLES) - option(BUILD_EXAMPLES "Build examples" ON) -endif() -if(NOT DEFINED LIB_INSTALL) - option(LIB_INSTALL "Install library" ON) -endif() - -if(NOT DEFINED CMAKE_INSTALL_PREFIX) - option(CMAKE_INSTALL_PREFIX "Install directory" ${CMAKE_CURRENT_SOURCE_DIR}/install) -endif() - - list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) - -include(jkqtplotter_deployqt) -include(jkqtplotter_deployopencv) -include(CheckCXXCompilerFlag) -if (NOT WIN32) - include(GNUInstallDirs) -endif(NOT WIN32) - -# Instruct CMake to run moc+rcc+uic automatically when needed. -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) - # Find includes in the build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) +# Common Includes for JKQtPlotter +include(jkqtplotter_common_include) +# Project Name and Version +include(JKQtPlotter_LIB_properties) -if (NOT CMAKE_INSTALL_LIBDIR) - set(CMAKE_INSTALL_LIBDIR "lib") -endif() +# CMake options with default values and description texts +include(jkqtplotter_cmake_options) -if (NOT CMAKE_INSTALL_BINDIR) - set(CMAKE_INSTALL_BINDIR "bin") -endif() +# compiler settings for this lib +include(jkqtplotter_common_compilersettings) -if (NOT CMAKE_INSTALL_INCLUDEDIR) - set(CMAKE_INSTALL_INCLUDEDIR "include") -endif() - - -find_package(Qt5 5.0 REQUIRED Core Gui Widgets PrintSupport Svg Xml OpenGL) - - - -set (CMAKE_CXX_STANDARD 11) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -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) - set(CMAKE_MSVCIDE_RUN_PATH ${CMAKE_PREFIX_PATH};${Qt5_DIR}/bin) -else() - add_compile_options(-fexceptions) - if(BUILD_HIGH_COMPILE_WARNING_LEVEL) - add_compile_options(-Wall -Wextra) # -Wimplicit-fallthrough -Wuninitialized -Wmaybe-uninitialized) # -Wmisleading-indentation -Weffc++) - endif(BUILD_HIGH_COMPILE_WARNING_LEVEL) -endif() - -if(BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE) - set(LIBNAME_ADDITION "_$") #"_${CMAKE_BUILD_TYPE}") -else() - set(LIBNAME_ADDITION ) -endif() - - - -# place all DLLs and EXEs in the subdirectory output of the top level directory of the build tree -set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output) -set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output) +# include Qt with appropriate options to build this lib +include(jkqtplotter_common_qtsettings) +# now add subdirectories with the library code ... add_subdirectory(lib) -if(BUILD_EXAMPLES) +# ... and optionally the examples +if(JKQtPlotter_BUILD_EXAMPLES) add_subdirectory(examples) endif() diff --git a/cmake/jkqtplotter_cmake_options.cmake b/cmake/jkqtplotter_cmake_options.cmake new file mode 100644 index 0000000000..bf757bd6fe --- /dev/null +++ b/cmake/jkqtplotter_cmake_options.cmake @@ -0,0 +1,43 @@ +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) +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) +endif() +if(NOT DEFINED JKQtPlotter_BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE) + option(JKQtPlotter_BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE "If set, the build-type (debug/release/...) is appended to the library name" ON) +endif() +if(NOT DEFINED JKQtPlotter_BUILD_EXAMPLES) + option(JKQtPlotter_BUILD_EXAMPLES "Build the examples examples" ON) +endif() +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + option(CMAKE_INSTALL_PREFIX "Install directory" ${CMAKE_CURRENT_SOURCE_DIR}/install) +endif() + + +#evaluate the settings above +if (NOT CMAKE_INSTALL_LIBDIR) + set(CMAKE_INSTALL_LIBDIR "lib") +endif() + +if (NOT CMAKE_INSTALL_BINDIR) + set(CMAKE_INSTALL_BINDIR "bin") +endif() + +if (NOT CMAKE_INSTALL_INCLUDEDIR) + set(CMAKE_INSTALL_INCLUDEDIR "include") +endif() + +# place all DLLs and EXEs in the subdirectory output of the top level directory of the build tree +set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output) +set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output) + + +if(JKQtPlotter_BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE) + set(JKQtPlotter_LIBNAME_ADDITION "_$") #"_${CMAKE_BUILD_TYPE}") +else() + set(JKQtPlotter_LIBNAME_ADDITION ) +endif() diff --git a/common_compilersettings.cmake b/cmake/jkqtplotter_common_compilersettings.cmake similarity index 96% rename from common_compilersettings.cmake rename to cmake/jkqtplotter_common_compilersettings.cmake index 4af239c83f..26227dbda4 100644 --- a/common_compilersettings.cmake +++ b/cmake/jkqtplotter_common_compilersettings.cmake @@ -1,18 +1,18 @@ -cmake_minimum_required(VERSION 3.1) - -# configure compiler -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED on) - -if(MINGW) - # COMPILER-SETTINGS FOR MINGW - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") -elseif(MSVC) - # COMPILER-SETTINGS FOR MS VISUAL C++ - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") - # To enable M_PI, M_E,... - add_definitions(/D_USE_MATH_DEFINES) - # 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() +cmake_minimum_required(VERSION 3.1) + +# configure compiler +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED on) + +if(MINGW) + # COMPILER-SETTINGS FOR MINGW + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") +elseif(MSVC) + # COMPILER-SETTINGS FOR MS VISUAL C++ + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + # To enable M_PI, M_E,... + add_definitions(/D_USE_MATH_DEFINES) + # 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() diff --git a/cmake/jkqtplotter_common_include.cmake b/cmake/jkqtplotter_common_include.cmake new file mode 100644 index 0000000000..8fa600e54d --- /dev/null +++ b/cmake/jkqtplotter_common_include.cmake @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.1) + +include(jkqtplotter_deployqt) +include(jkqtplotter_deployopencv) \ No newline at end of file diff --git a/cmake/jkqtplotter_common_qtsettings.cmake b/cmake/jkqtplotter_common_qtsettings.cmake new file mode 100644 index 0000000000..991cb69af3 --- /dev/null +++ b/cmake/jkqtplotter_common_qtsettings.cmake @@ -0,0 +1,7 @@ + +# Instruct CMake to run moc+rcc+uic automatically when needed. +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +find_package(Qt5 5.0 REQUIRED Core Gui Widgets PrintSupport Svg Xml OpenGL) diff --git a/cmake/jkqtplotter_deployqt.cmake b/cmake/jkqtplotter_deployqt.cmake index e2162e0ab9..7235cd51e2 100644 --- a/cmake/jkqtplotter_deployqt.cmake +++ b/cmake/jkqtplotter_deployqt.cmake @@ -27,4 +27,4 @@ function(jkqtplotter_deployqt TARGET_NAME) COMMENT "Running windeployqt ... " ) endif(WIN32) -endfunction(jkqtplotter_deployqt) \ No newline at end of file +endfunction(jkqtplotter_deployqt) diff --git a/cmake/jkqtplotter_dumpallvariables.cmake b/cmake/jkqtplotter_dumpallvariables.cmake new file mode 100644 index 0000000000..20937d1b2d --- /dev/null +++ b/cmake/jkqtplotter_dumpallvariables.cmake @@ -0,0 +1,14 @@ +function(jkqtplotter_dumpallvariables) + get_cmake_property(_variableNames VARIABLES) + list (SORT _variableNames) + foreach (_variableName ${_variableNames}) + if (ARGV0) + unset(MATCHED) + string(REGEX MATCH ${ARGV0} MATCHED ${_variableName}) + if (NOT MATCHED) + continue() + endif() + endif() + message(STATUS "${_variableName}=${${_variableName}}") + endforeach() +endfunction(jkqtplotter_dumpallvariables) \ No newline at end of file diff --git a/cmake/jkqtplotter_lib_properties.cmake b/cmake/jkqtplotter_lib_properties.cmake new file mode 100644 index 0000000000..3b5d2f307b --- /dev/null +++ b/cmake/jkqtplotter_lib_properties.cmake @@ -0,0 +1,2 @@ +# Project Name and Version +project(JKQTPlotter LANGUAGES CXX VERSION 2019.11) \ No newline at end of file diff --git a/common_include.cmake b/common_include.cmake deleted file mode 100644 index 10af59f27e..0000000000 --- a/common_include.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_minimum_required(VERSION 3.1) diff --git a/doc/dox/buildinstructions.dox b/doc/dox/buildinstructions.dox index a34b50bbbd..e4138e01b7 100644 --- a/doc/dox/buildinstructions.dox +++ b/doc/dox/buildinstructions.dox @@ -48,14 +48,11 @@ Afterwards you can install the library by The CMake build system offers several configuration variables that you may set/change to modify the outcome of the build: - \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 BUILD_SHARED_LIBS : Build as shared library (default: \c ON ) - - \c BUILD_STATIC_LIBS : Build as static library (default: \c ON ) - - \c BUILD_INCLUDE_XITS_FONTS : Include XITS fonts as resources in library (default: \c ON ) - - \c BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE : If set, the build-type is appended to the library name (default: \c ON ) - - \c BUILD_HIGH_COMPILE_WARNING_LEVEL : Set Compiler Warning level to high (default: \c OFF ) - - \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 JKQtPlotter_BUILD_SHARED_LIBS : Build as shared library (default: \c ON ) + - \c JKQtPlotter_BUILD_STATIC_LIBS : Build as static library (default: \c ON ) + - \c JKQtPlotter_BUILD_INCLUDE_XITS_FONTS : Include XITS fonts as resources in library (default: \c ON ) + - \c JKQtPlotter_BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE : If set, the build-type is appended to the library name (default: \c ON ) + - \c JKQtPlotter_BUILD_EXAMPLES : Build examples (default: \c ON ) - \c CMAKE_INSTALL_PREFIX : Install directory for the library . @@ -76,48 +73,49 @@ You can find an example project that uses a complete cmake-build here: \ref JKQT Here is the \c CMakeLists.txt from that directory: \code - # set minimum required CMake-Version - cmake_minimum_required(VERSION 3.0) + # set minimum required CMake-Version + cmake_minimum_required(VERSION 3.10) - # set Project name - set(EXAMPLE_NAME simpletest) - set(EXENAME jkqtptest_${EXAMPLE_NAME}) - project(${EXAMPLE_NAME} LANGUAGES CXX) + # 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) + # some basic configurations + set(CMAKE_AUTOMOC ON) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_CXX_STANDARD 11) + #set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - # Configure project for usage of Qt5 - find_package(Qt5 5.12 REQUIRED Core Gui Widgets PrintSupport Svg Xml OpenGl) + # Configure project for usage of Qt5 + find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGl REQUIRED) - # include JKQTPlotter - find_package(JKQTCommonLib) - find_package(JKQTMathTextLib) - find_package(JKQTPlotterLib) + # 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() + # 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) + # 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) + + # Installation + install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) \endcode diff --git a/examples/advplotstyling/CMakeLists.txt b/examples/advplotstyling/CMakeLists.txt index 7a8c897c66..ffef92be0e 100644 --- a/examples/advplotstyling/CMakeLists.txt +++ b/examples/advplotstyling/CMakeLists.txt @@ -14,15 +14,14 @@ set(UIS advplotstyling.qrc ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/barchart/CMakeLists.txt b/examples/barchart/CMakeLists.txt index c0ca90ecbe..af38451f54 100644 --- a/examples/barchart/CMakeLists.txt +++ b/examples/barchart/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/boxplot/CMakeLists.txt b/examples/boxplot/CMakeLists.txt index d0b2324133..f85a4dcee2 100644 --- a/examples/boxplot/CMakeLists.txt +++ b/examples/boxplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/cmake_link_example/CMakeLists.txt b/examples/cmake_link_example/CMakeLists.txt index c238e2e5df..9c692e7e52 100644 --- a/examples/cmake_link_example/CMakeLists.txt +++ b/examples/cmake_link_example/CMakeLists.txt @@ -1,5 +1,5 @@ # set minimum required CMake-Version -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.10) # set Project name set(EXAMPLE_NAME simpletest) @@ -8,19 +8,17 @@ 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) +#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) +find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGl REQUIRED) # include JKQTPlotter -find_package(JKQTCommonLib) -find_package(JKQTMathTextLib) -find_package(JKQTPlotterLib) +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) @@ -36,7 +34,14 @@ endif() # add the example executable add_executable(${EXENAME} WIN32 simpletest.cpp) -# ... and link against JKQTPlotterLib +# ... 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} JKQTPlotterLib) \ No newline at end of file +target_link_libraries(${EXENAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::PrintSupport Qt5::Svg Qt5::Xml JKQTPlotterLib) + +# Installation +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +#Installation of Qt DLLs on Windows +include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/jkqtplotter_deployqt.cmake) +jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/cmake_link_example/README.md b/examples/cmake_link_example/README.md index 420d6a3ce2..8446ea3017 100644 --- a/examples/cmake_link_example/README.md +++ b/examples/cmake_link_example/README.md @@ -4,48 +4,54 @@ 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.0) + # set minimum required CMake-Version + cmake_minimum_required(VERSION 3.10) - # set Project name - set(EXAMPLE_NAME simpletest) - set(EXENAME jkqtptest_${EXAMPLE_NAME}) - project(${EXAMPLE_NAME} LANGUAGES CXX) + # 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) + # some basic configurations + set(CMAKE_AUTOMOC ON) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_CXX_STANDARD 11) + #set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - # Configure project for usage of Qt5 - find_package(Qt5 5.12 REQUIRED Core Gui Widgets PrintSupport Svg Xml OpenGl) + # Configure project for usage of Qt5 + find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGl REQUIRED) - # include JKQTPlotter - find_package(JKQTCommonLib) - find_package(JKQTMathTextLib) - find_package(JKQTPlotterLib) + # 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() + # 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) + # ... 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) + + # Installation + install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + #Installation of Qt DLLs on Windows + include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/jkqtplotter_deployqt.cmake) + jkqtplotter_deployqt(${EXENAME}) - # 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: diff --git a/examples/contourplot/CMakeLists.txt b/examples/contourplot/CMakeLists.txt index 9d74e1ddb2..ade0e7c867 100644 --- a/examples/contourplot/CMakeLists.txt +++ b/examples/contourplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/datastore/CMakeLists.txt b/examples/datastore/CMakeLists.txt index 84cc148b20..e658bc3bd6 100644 --- a/examples/datastore/CMakeLists.txt +++ b/examples/datastore/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/datastore_groupedstat/CMakeLists.txt b/examples/datastore_groupedstat/CMakeLists.txt index 16336337f3..ba2277eff4 100644 --- a/examples/datastore_groupedstat/CMakeLists.txt +++ b/examples/datastore_groupedstat/CMakeLists.txt @@ -14,17 +14,15 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/datastore_iterators/CMakeLists.txt b/examples/datastore_iterators/CMakeLists.txt index 11c2fc8dae..1fb61c5d90 100644 --- a/examples/datastore_iterators/CMakeLists.txt +++ b/examples/datastore_iterators/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/datastore_regression/CMakeLists.txt b/examples/datastore_regression/CMakeLists.txt index bacc0852fd..f9cf4e9af2 100644 --- a/examples/datastore_regression/CMakeLists.txt +++ b/examples/datastore_regression/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/datastore_statistics/CMakeLists.txt b/examples/datastore_statistics/CMakeLists.txt index 068f4e4e51..0269f132c3 100644 --- a/examples/datastore_statistics/CMakeLists.txt +++ b/examples/datastore_statistics/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/datastore_statistics_2d/CMakeLists.txt b/examples/datastore_statistics_2d/CMakeLists.txt index 77412c4c2c..4a753c1d81 100644 --- a/examples/datastore_statistics_2d/CMakeLists.txt +++ b/examples/datastore_statistics_2d/CMakeLists.txt @@ -14,17 +14,15 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/dateaxes/CMakeLists.txt b/examples/dateaxes/CMakeLists.txt index f107daab58..47463bd4b0 100644 --- a/examples/dateaxes/CMakeLists.txt +++ b/examples/dateaxes/CMakeLists.txt @@ -14,17 +14,15 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/distributionplot/CMakeLists.txt b/examples/distributionplot/CMakeLists.txt index e59c013ff4..b893ca7196 100644 --- a/examples/distributionplot/CMakeLists.txt +++ b/examples/distributionplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/errorbarstyles/CMakeLists.txt b/examples/errorbarstyles/CMakeLists.txt index 9d8505e78a..88a4762404 100644 --- a/examples/errorbarstyles/CMakeLists.txt +++ b/examples/errorbarstyles/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/filledgraphs/CMakeLists.txt b/examples/filledgraphs/CMakeLists.txt index 6db61aec15..0ac89f4215 100644 --- a/examples/filledgraphs/CMakeLists.txt +++ b/examples/filledgraphs/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/functionplot/CMakeLists.txt b/examples/functionplot/CMakeLists.txt index 9582dd2eca..baf355bebb 100644 --- a/examples/functionplot/CMakeLists.txt +++ b/examples/functionplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/geometric/CMakeLists.txt b/examples/geometric/CMakeLists.txt index 438850028c..192d30b4dc 100644 --- a/examples/geometric/CMakeLists.txt +++ b/examples/geometric/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/imageplot/CMakeLists.txt b/examples/imageplot/CMakeLists.txt index 39aad8eb5b..ab3d3754a1 100644 --- a/examples/imageplot/CMakeLists.txt +++ b/examples/imageplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/imageplot_cimg/CMakeLists.txt b/examples/imageplot_cimg/CMakeLists.txt index c972fa728e..b07d885022 100644 --- a/examples/imageplot_cimg/CMakeLists.txt +++ b/examples/imageplot_cimg/CMakeLists.txt @@ -15,17 +15,15 @@ if(CImg_FOUND) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) - if(BUILD_STATIC_LIBS) + if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - elseif(BUILD_SHARED_LIBS) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() include_directories(${EXENAME} ${CIMG_INCLUDE_DIR} ) # Installation - if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif(LIB_INSTALL) + install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/imageplot_modifier/CMakeLists.txt b/examples/imageplot_modifier/CMakeLists.txt index 0b0280a325..3b5fd65466 100644 --- a/examples/imageplot_modifier/CMakeLists.txt +++ b/examples/imageplot_modifier/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/imageplot_nodatastore/CMakeLists.txt b/examples/imageplot_nodatastore/CMakeLists.txt index 9687958777..7128c6b250 100644 --- a/examples/imageplot_nodatastore/CMakeLists.txt +++ b/examples/imageplot_nodatastore/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/imageplot_opencv/CMakeLists.txt b/examples/imageplot_opencv/CMakeLists.txt index d534048896..784c88a643 100644 --- a/examples/imageplot_opencv/CMakeLists.txt +++ b/examples/imageplot_opencv/CMakeLists.txt @@ -15,18 +15,17 @@ if(OpenCV_FOUND) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) - if(BUILD_STATIC_LIBS) + if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - elseif(BUILD_SHARED_LIBS) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() include_directories(${EXENAME} ${OpenCV_INCLUDE_DIRS} ) target_link_libraries(${EXENAME} ${OpenCV_LIBS} ) # Installation - if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif(LIB_INSTALL) + install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/imageplot_userpal/CMakeLists.txt b/examples/imageplot_userpal/CMakeLists.txt index b06bb48ed7..a8d36a1de0 100644 --- a/examples/imageplot_userpal/CMakeLists.txt +++ b/examples/imageplot_userpal/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/impulsesplot/CMakeLists.txt b/examples/impulsesplot/CMakeLists.txt index 01f383e62f..f0b46e5cf7 100644 --- a/examples/impulsesplot/CMakeLists.txt +++ b/examples/impulsesplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/jkqtfastplotter_test/CMakeLists.txt b/examples/jkqtfastplotter_test/CMakeLists.txt index d610c7e00d..3db18c9f7d 100644 --- a/examples/jkqtfastplotter_test/CMakeLists.txt +++ b/examples/jkqtfastplotter_test/CMakeLists.txt @@ -17,17 +17,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTFastPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTFastPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/jkqtmathtext_simpletest/CMakeLists.txt b/examples/jkqtmathtext_simpletest/CMakeLists.txt index d68647c52c..2c9507346e 100644 --- a/examples/jkqtmathtext_simpletest/CMakeLists.txt +++ b/examples/jkqtmathtext_simpletest/CMakeLists.txt @@ -16,17 +16,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTMathTextLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTMathTextSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/jkqtmathtext_test/CMakeLists.txt b/examples/jkqtmathtext_test/CMakeLists.txt index 899bd874fd..2be3a1054a 100644 --- a/examples/jkqtmathtext_test/CMakeLists.txt +++ b/examples/jkqtmathtext_test/CMakeLists.txt @@ -17,17 +17,16 @@ set(UIS testform.ui ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTMathTextLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTMathTextSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/jkqtplot_test/CMakeLists.txt b/examples/jkqtplot_test/CMakeLists.txt index 38e8638121..0e8c331ca3 100644 --- a/examples/jkqtplot_test/CMakeLists.txt +++ b/examples/jkqtplot_test/CMakeLists.txt @@ -24,17 +24,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/logaxes/CMakeLists.txt b/examples/logaxes/CMakeLists.txt index e78580e4f4..ad7b305769 100644 --- a/examples/logaxes/CMakeLists.txt +++ b/examples/logaxes/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/multiplot/CMakeLists.txt b/examples/multiplot/CMakeLists.txt index 66fa2d83fa..209ec35eeb 100644 --- a/examples/multiplot/CMakeLists.txt +++ b/examples/multiplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS test_multiplot_ui.ui ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/parametriccurve/CMakeLists.txt b/examples/parametriccurve/CMakeLists.txt index af3a9e7896..04f5c5c110 100644 --- a/examples/parametriccurve/CMakeLists.txt +++ b/examples/parametriccurve/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/paramscatterplot/CMakeLists.txt b/examples/paramscatterplot/CMakeLists.txt index 52b7f1cb1a..a1c987b2e7 100644 --- a/examples/paramscatterplot/CMakeLists.txt +++ b/examples/paramscatterplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/paramscatterplot_image/CMakeLists.txt b/examples/paramscatterplot_image/CMakeLists.txt index 2394867744..89a429df5a 100644 --- a/examples/paramscatterplot_image/CMakeLists.txt +++ b/examples/paramscatterplot_image/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/parsedfunctionplot/CMakeLists.txt b/examples/parsedfunctionplot/CMakeLists.txt index 9489d46779..1029ca88ff 100644 --- a/examples/parsedfunctionplot/CMakeLists.txt +++ b/examples/parsedfunctionplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/rgbimageplot/CMakeLists.txt b/examples/rgbimageplot/CMakeLists.txt index e0b2d9dbf1..32d7ebc8ff 100644 --- a/examples/rgbimageplot/CMakeLists.txt +++ b/examples/rgbimageplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/rgbimageplot_cimg/CMakeLists.txt b/examples/rgbimageplot_cimg/CMakeLists.txt index 92d4db9edb..89932e59d5 100644 --- a/examples/rgbimageplot_cimg/CMakeLists.txt +++ b/examples/rgbimageplot_cimg/CMakeLists.txt @@ -15,18 +15,16 @@ if(CImg_FOUND) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) - if(BUILD_STATIC_LIBS) + if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - elseif(BUILD_SHARED_LIBS) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() include_directories(${EXENAME} ${CIMG_INCLUDE_DIR} ) # Installation - if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif(LIB_INSTALL) - + install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) add_custom_command(TARGET ${EXENAME} POST_BUILD diff --git a/examples/rgbimageplot_opencv/CMakeLists.txt b/examples/rgbimageplot_opencv/CMakeLists.txt index 38d3d5c095..8462b69c8a 100644 --- a/examples/rgbimageplot_opencv/CMakeLists.txt +++ b/examples/rgbimageplot_opencv/CMakeLists.txt @@ -15,9 +15,9 @@ if (OpenCV_FOUND) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) - if(BUILD_STATIC_LIBS) + if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - elseif(BUILD_SHARED_LIBS) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() include_directories(${EXENAME} ${OpenCV_INCLUDE_DIRS} ) @@ -25,9 +25,7 @@ if (OpenCV_FOUND) # Installation - if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif(LIB_INSTALL) + install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) #Installation of OpenCV DLLs on Windows diff --git a/examples/rgbimageplot_qt/CMakeLists.txt b/examples/rgbimageplot_qt/CMakeLists.txt index df4c94fabb..693c666f35 100644 --- a/examples/rgbimageplot_qt/CMakeLists.txt +++ b/examples/rgbimageplot_qt/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/simpletest/CMakeLists.txt b/examples/simpletest/CMakeLists.txt index 8a391b8ff8..a0130d5616 100644 --- a/examples/simpletest/CMakeLists.txt +++ b/examples/simpletest/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/speed/CMakeLists.txt b/examples/speed/CMakeLists.txt index 3f5345458b..1184f01dea 100644 --- a/examples/speed/CMakeLists.txt +++ b/examples/speed/CMakeLists.txt @@ -14,17 +14,15 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/stackedbars/CMakeLists.txt b/examples/stackedbars/CMakeLists.txt index 01250738bc..14aa6dd009 100644 --- a/examples/stackedbars/CMakeLists.txt +++ b/examples/stackedbars/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/stepplots/CMakeLists.txt b/examples/stepplots/CMakeLists.txt index 79fffa7798..fe96f01f27 100644 --- a/examples/stepplots/CMakeLists.txt +++ b/examples/stepplots/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/styledboxplot/CMakeLists.txt b/examples/styledboxplot/CMakeLists.txt index 6cf20b8c88..18e5ec84e7 100644 --- a/examples/styledboxplot/CMakeLists.txt +++ b/examples/styledboxplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/styling/CMakeLists.txt b/examples/styling/CMakeLists.txt index f65ad07432..99c2833910 100644 --- a/examples/styling/CMakeLists.txt +++ b/examples/styling/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS test_styling.ui ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/symbols_and_errors/CMakeLists.txt b/examples/symbols_and_errors/CMakeLists.txt index 7bfc3f504f..bf0af2d53c 100644 --- a/examples/symbols_and_errors/CMakeLists.txt +++ b/examples/symbols_and_errors/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/symbols_and_styles/CMakeLists.txt b/examples/symbols_and_styles/CMakeLists.txt index f0b47a510a..36b2e23801 100644 --- a/examples/symbols_and_styles/CMakeLists.txt +++ b/examples/symbols_and_styles/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/ui/CMakeLists.txt b/examples/ui/CMakeLists.txt index 7f8a7bd9c0..face897a37 100644 --- a/examples/ui/CMakeLists.txt +++ b/examples/ui/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS formwithjkqtplotter.ui ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/user_interaction/CMakeLists.txt b/examples/user_interaction/CMakeLists.txt index 1d8d1c798f..9135d32dc8 100644 --- a/examples/user_interaction/CMakeLists.txt +++ b/examples/user_interaction/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/examples/violinplot/CMakeLists.txt b/examples/violinplot/CMakeLists.txt index 3934649e1f..ad65930905 100644 --- a/examples/violinplot/CMakeLists.txt +++ b/examples/violinplot/CMakeLists.txt @@ -14,17 +14,16 @@ set(UIS ) add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) -elseif(BUILD_SHARED_LIBS) +elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) endif() # Installation -if(LIB_INSTALL) - install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif(LIB_INSTALL) +install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows jkqtplotter_deployqt(${EXENAME}) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 9c6d533047..cca138f548 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -8,14 +8,17 @@ message( STATUS "== JKQTPlotterLib Build Information message( STATUS "=============================================================================" ) message( STATUS "Version: ${PROJECT_VERSION}") if (CMAKE_BUILD_TYPE) - message( STATUS "Build type: ${CMAKE_BUILD_TYPE}") + message( STATUS "Build type: ${CMAKE_BUILD_TYPE}") endif(CMAKE_BUILD_TYPE) message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) +message( STATUS "Architecture: ${CMAKE_CXX_LIBRARY_ARCHITECTURE} / ${CMAKE_LIBRARY_ARCHITECTURE}" ) +message( STATUS "System Name: ${CMAKE_SYSTEM_NAME}" ) +message( STATUS "Processor Name: ${CMAKE_SYSTEM_PROCESSOR}" ) message( STATUS "Using Qt: ${Qt5_VERSION}" ) message( STATUS " [at ${Qt5_DIR}]" ) -if(BUILD_INCLUDE_XITS_FONTS) +if(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) message( STATUS "Using XITS fonts" ) -endif(BUILD_INCLUDE_XITS_FONTS) +endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) message( STATUS "Installing to: ${CMAKE_INSTALL_PREFIX}" ) message( STATUS "=============================================================================" ) message( STATUS ) diff --git a/lib/jkqtcommon/CMakeLists.txt b/lib/jkqtcommon/CMakeLists.txt index af14ab1a20..d8c1d6cc63 100644 --- a/lib/jkqtcommon/CMakeLists.txt +++ b/lib/jkqtcommon/CMakeLists.txt @@ -3,21 +3,21 @@ cmake_minimum_required(VERSION 3.0) set(libBasename JKQTCommon) set(libIncludeSubdir jkqtcommon) -if(BUILD_SHARED_LIBS) +if(JKQtPlotter_BUILD_SHARED_LIBS) set(libsh_name ${libBasename}SharedLib) - set(libsh_name_decorated ${libsh_name}${LIBNAME_ADDITION}) + 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(BUILD_SHARED_LIBS) +endif(JKQtPlotter_BUILD_SHARED_LIBS) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) set(lib_name ${libBasename}Lib) - set(lib_name_decorated ${lib_name}${LIBNAME_ADDITION}) + 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(BUILD_STATIC_LIBS) - +endif(JKQtPlotter_BUILD_STATIC_LIBS) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # Set up source files set(SOURCES @@ -69,24 +69,34 @@ set(HEADERS include(CMakePackageConfigHelpers) -if(BUILD_SHARED_LIBS) +if(JKQtPlotter_BUILD_SHARED_LIBS) add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS}) + target_compile_features(${libsh_name} PUBLIC cxx_std_11) set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}") set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}") - target_link_libraries(${libsh_name} Qt5::Core Qt5::Gui Qt5::Xml Qt5::Widgets Qt5::PrintSupport) + target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Xml Qt5::Widgets Qt5::PrintSupport) target_compile_definitions(${libsh_name} PUBLIC JKQTCOMMON_LIB_IN_DLL) target_compile_definitions(${libsh_name} PRIVATE JKQTCOMMON_LIB_EXPORT_LIBRARY) + target_include_directories(${libsh_name} PUBLIC + $ + $ + ) set_property(TARGET ${libsh_name} PROPERTY 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(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) add_library(${lib_name} STATIC ${SOURCES} ${HEADERS}) + target_compile_features(${lib_name} PUBLIC cxx_std_11) 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::Xml Qt5::Widgets Qt5::PrintSupport) + target_include_directories(${lib_name} PUBLIC + $ + $ + ) + target_link_libraries(${lib_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Xml Qt5::Widgets Qt5::PrintSupport) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) @@ -95,9 +105,7 @@ endif() # Installation -if(LIB_INSTALL) - - if(BUILD_SHARED_LIBS) +if(JKQtPlotter_BUILD_SHARED_LIBS) install(TARGETS ${libsh_name} EXPORT ${libsh_name}_TARGETS RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -106,12 +114,13 @@ if(LIB_INSTALL) ) install(EXPORT ${libsh_name}_TARGETS FILE ${libsh_name}Config.cmake - DESTINATION lib/cmake + DESTINATION lib/cmake/${libsh_name} ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" DESTINATION lib/cmake ) - endif(BUILD_SHARED_LIBS) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" + DESTINATION lib/cmake/${libsh_name} ) + endif(JKQtPlotter_BUILD_SHARED_LIBS) - if(BUILD_STATIC_LIBS) + if(JKQtPlotter_BUILD_STATIC_LIBS) install(TARGETS ${lib_name} EXPORT ${lib_name}_TARGETS RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -120,10 +129,11 @@ if(LIB_INSTALL) ) install(EXPORT ${lib_name}_TARGETS FILE ${lib_name}Config.cmake - DESTINATION lib/cmake + DESTINATION lib/cmake/${lib_name} ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" DESTINATION lib/cmake ) - endif(BUILD_STATIC_LIBS) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" + DESTINATION lib/cmake/${lib_name} ) + endif(JKQtPlotter_BUILD_STATIC_LIBS) install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir} @@ -132,4 +142,4 @@ if(LIB_INSTALL) 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) + diff --git a/lib/jkqtfastplotter/CMakeLists.txt b/lib/jkqtfastplotter/CMakeLists.txt index 37bd238aba..246d80572a 100644 --- a/lib/jkqtfastplotter/CMakeLists.txt +++ b/lib/jkqtfastplotter/CMakeLists.txt @@ -3,20 +3,21 @@ cmake_minimum_required(VERSION 3.0) set(libBasename JKQTFastPlotter) set(libIncludeSubdir jkqtfastplotter) -if(BUILD_SHARED_LIBS) +if(JKQtPlotter_BUILD_SHARED_LIBS) set(libsh_name ${libBasename}SharedLib) - set(libsh_name_decorated ${libsh_name}${LIBNAME_ADDITION}) + 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(BUILD_SHARED_LIBS) +endif(JKQtPlotter_BUILD_SHARED_LIBS) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) set(lib_name ${libBasename}Lib) - set(lib_name_decorated ${lib_name}${LIBNAME_ADDITION}) + 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(BUILD_STATIC_LIBS) +endif(JKQtPlotter_BUILD_STATIC_LIBS) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # Set up source files set(SOURCES @@ -32,24 +33,34 @@ set(HEADERS include(CMakePackageConfigHelpers) -if(BUILD_SHARED_LIBS) +if(JKQtPlotter_BUILD_SHARED_LIBS) add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS} ${RESOURCES}) + target_compile_features(${libsh_name} PUBLIC cxx_std_11) set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}") set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}") - target_link_libraries(${libsh_name} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL JKQTCommonSharedLib) + target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL JKQTCommonSharedLib) target_compile_definitions(${libsh_name} PUBLIC JKQTFASTPLOTTER_LIB_IN_DLL) target_compile_definitions(${libsh_name} PRIVATE JKQTFASTPLOTTER_LIB_EXPORT_LIBRARY) + target_include_directories(${libsh_name} PUBLIC + $ + $ + ) set_property(TARGET ${libsh_name} PROPERTY 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(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) add_library(${lib_name} STATIC ${SOURCES} ${HEADERS} ${RESOURCES}) + target_compile_features(${lib_name} PUBLIC cxx_std_11) 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) + target_link_libraries(${lib_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL JKQTCommonLib) + target_include_directories(${lib_name} PUBLIC + $ + $ + ) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) @@ -58,42 +69,41 @@ endif() # Installation -if(LIB_INSTALL) +if(JKQtPlotter_BUILD_SHARED_LIBS) + install(TARGETS ${libsh_name} EXPORT ${libsh_name}_TARGETS + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir} + ) + install(EXPORT ${libsh_name}_TARGETS + FILE ${libsh_name}Config.cmake + DESTINATION lib/cmake/${libsh_name} + ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" + DESTINATION lib/cmake/${libsh_name} ) +endif(JKQtPlotter_BUILD_SHARED_LIBS) - if(BUILD_SHARED_LIBS) - install(TARGETS ${libsh_name} EXPORT ${libsh_name}_TARGETS - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - 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(JKQtPlotter_BUILD_STATIC_LIBS) + 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} + ) + install(EXPORT ${lib_name}_TARGETS + FILE ${lib_name}Config.cmake + DESTINATION lib/cmake/${lib_name} + ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" + DESTINATION lib/cmake/${lib_name} ) +endif(JKQtPlotter_BUILD_STATIC_LIBS) - if(BUILD_STATIC_LIBS) - 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} - ) - 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}/${libIncludeSubdir} + COMPONENT Headers) - install(FILES ${HEADERS} - 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" ) - 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) diff --git a/lib/jkqtmathtext/CMakeLists.txt b/lib/jkqtmathtext/CMakeLists.txt index 8993131456..90b006dd8c 100644 --- a/lib/jkqtmathtext/CMakeLists.txt +++ b/lib/jkqtmathtext/CMakeLists.txt @@ -3,21 +3,21 @@ cmake_minimum_required(VERSION 3.0) set(libBasename JKQTMathText) set(libIncludeSubdir jkqtmathtext) -if(BUILD_SHARED_LIBS) +if(JKQtPlotter_BUILD_SHARED_LIBS) set(libsh_name ${libBasename}SharedLib) - set(libsh_name_decorated ${libsh_name}${LIBNAME_ADDITION}) + 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(BUILD_SHARED_LIBS) +endif(JKQtPlotter_BUILD_SHARED_LIBS) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) set(lib_name ${libBasename}Lib) - set(lib_name_decorated ${lib_name}${LIBNAME_ADDITION}) + 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(BUILD_STATIC_LIBS) - +endif(JKQtPlotter_BUILD_STATIC_LIBS) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # Set up source files set(SOURCES @@ -29,33 +29,43 @@ set(HEADERS jkqtmathtext_imexport.h ) -if(BUILD_INCLUDE_XITS_FONTS) +if(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) set(RESOURCES resources/xits.qrc ) -endif(BUILD_INCLUDE_XITS_FONTS) +endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) include(CMakePackageConfigHelpers) -if(BUILD_SHARED_LIBS) +if(JKQtPlotter_BUILD_SHARED_LIBS) add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS} ${RESOURCES}) + target_compile_features(${libsh_name} PUBLIC cxx_std_11) set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}") set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}") - target_link_libraries(${libsh_name} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport JKQTCommonSharedLib) + target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport JKQTCommonSharedLib) target_compile_definitions(${libsh_name} PUBLIC JKQTMATHTEXT_LIB_IN_DLL) target_compile_definitions(${libsh_name} PRIVATE JKQTMATHTEXT_LIB_EXPORT_LIBRARY) + target_include_directories(${libsh_name} PUBLIC + $ + $ + ) set_property(TARGET ${libsh_name} PROPERTY 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(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) add_library(${lib_name} STATIC ${SOURCES} ${HEADERS} ${RESOURCES}) + target_compile_features(${lib_name} PUBLIC cxx_std_11) 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) + target_link_libraries(${lib_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport JKQTCommonLib) + target_include_directories(${lib_name} PUBLIC + $ + $ + ) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) @@ -64,44 +74,43 @@ endif() # Installation -if(LIB_INSTALL) +if(JKQtPlotter_BUILD_SHARED_LIBS) + install(TARGETS ${libsh_name} EXPORT ${libsh_name}_TARGETS + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir} + ) + install(EXPORT ${libsh_name}_TARGETS + FILE ${libsh_name}Config.cmake + DESTINATION lib/cmake/${libsh_name} + ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" + DESTINATION lib/cmake/${libsh_name} ) +endif(JKQtPlotter_BUILD_SHARED_LIBS) - if(BUILD_SHARED_LIBS) - install(TARGETS ${libsh_name} EXPORT ${libsh_name}_TARGETS - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - 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(JKQtPlotter_BUILD_STATIC_LIBS) + 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} + ) + install(EXPORT ${lib_name}_TARGETS + FILE ${lib_name}Config.cmake + DESTINATION lib/cmake/${lib_name} + ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" + DESTINATION lib/cmake/${lib_name} ) +endif(JKQtPlotter_BUILD_STATIC_LIBS) - if(BUILD_STATIC_LIBS) - 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} - ) - 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}/${libIncludeSubdir} + COMPONENT Headers) - install(FILES ${HEADERS} - 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" ) +install(FILES "${CMAKE_SOURCE_DIR}/lib/jkqtmathtext/resources/xits/OFL.txt" DESTINATION doc/ RENAME "${lib_name}_XITS_LICENSE.txt" ) +install(FILES "${CMAKE_SOURCE_DIR}/lib/jkqtmathtext/resources/xits/README.md" DESTINATION doc/ RENAME "${lib_name}_XITS_README.md" ) - 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" ) - install(FILES "${CMAKE_SOURCE_DIR}/lib/jkqtmathtext/resources/xits/OFL.txt" DESTINATION doc/ RENAME "${lib_name}_XITS_LICENSE.txt" ) - install(FILES "${CMAKE_SOURCE_DIR}/lib/jkqtmathtext/resources/xits/README.md" DESTINATION doc/ RENAME "${lib_name}_XITS_README.md" ) - -endif(LIB_INSTALL) diff --git a/lib/jkqtplotter/CMakeLists.txt b/lib/jkqtplotter/CMakeLists.txt index cbc1bc81eb..86b08e3496 100644 --- a/lib/jkqtplotter/CMakeLists.txt +++ b/lib/jkqtplotter/CMakeLists.txt @@ -3,19 +3,21 @@ cmake_minimum_required(VERSION 3.0) set(libBasename JKQTPlotter) set(libIncludeSubdir jkqtplotter) -if(BUILD_SHARED_LIBS) +if(JKQtPlotter_BUILD_SHARED_LIBS) set(libsh_name ${libBasename}SharedLib) - set(libsh_name_decorated ${libsh_name}${LIBNAME_ADDITION}) + 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(BUILD_SHARED_LIBS) +endif(JKQtPlotter_BUILD_SHARED_LIBS) -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) set(lib_name ${libBasename}Lib) - set(lib_name_decorated ${lib_name}${LIBNAME_ADDITION}) + 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(BUILD_STATIC_LIBS) +endif(JKQtPlotter_BUILD_STATIC_LIBS) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # Set up source files set(SOURCES @@ -128,24 +130,34 @@ set(RESOURCES include(CMakePackageConfigHelpers) -if(BUILD_SHARED_LIBS) +if(JKQtPlotter_BUILD_SHARED_LIBS) add_library(${libsh_name} SHARED ${SOURCES} ${SOURCES_GRAPHS} ${SOURCES_GUI} ${SOURCES_OVERLAYS} ${HEADERS} ${HEADERS_GRAPHS} ${HEADERS_GUI} ${HEADERS_OVERLAYS} ${RESOURCES}) + target_compile_features(${libsh_name} PUBLIC cxx_std_11) set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}") set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}") - target_link_libraries(${libsh_name} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::Svg Qt5::Xml JKQTCommonSharedLib JKQTMathTextSharedLib) - target_compile_definitions(${libsh_name} PUBLIC JKQTPLOTTER_LIB_IN_DLL) - target_compile_definitions(${libsh_name} PRIVATE JKQTPLOTTER_LIB_EXPORT_LIBRARY) + target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::Svg Qt5::Xml JKQTCommonSharedLib JKQTMathTextSharedLib) + target_compile_definitions(${libsh_name} PUBLIC JKQtPlotter_LIB_IN_DLL) + target_compile_definitions(${libsh_name} PRIVATE JKQtPlotter_LIB_EXPORT_LIBRARY) + target_include_directories(${libsh_name} PUBLIC + $ + $ + ) set_property(TARGET ${libsh_name} PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS "ON") - write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake + write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) endif() -if(BUILD_STATIC_LIBS) +if(JKQtPlotter_BUILD_STATIC_LIBS) add_library(${lib_name} STATIC ${SOURCES} ${SOURCES_GRAPHS} ${SOURCES_GUI} ${SOURCES_OVERLAYS} ${HEADERS} ${HEADERS_GRAPHS} ${HEADERS_GUI} ${HEADERS_OVERLAYS} ${RESOURCES}) + target_compile_features(${lib_name} PUBLIC cxx_std_11) 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) + target_include_directories(${lib_name} PUBLIC + $ + $ + ) + target_link_libraries(${lib_name} PUBLIC 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 ) @@ -154,9 +166,7 @@ endif() # Installation -if(LIB_INSTALL) - - if(BUILD_SHARED_LIBS) +if(JKQtPlotter_BUILD_SHARED_LIBS) install(TARGETS ${libsh_name} EXPORT ${libsh_name}_TARGETS RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -165,12 +175,13 @@ if(LIB_INSTALL) ) install(EXPORT ${libsh_name}_TARGETS FILE ${libsh_name}Config.cmake - DESTINATION lib/cmake + DESTINATION lib/cmake/${libsh_name} ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" DESTINATION lib/cmake ) - endif(BUILD_SHARED_LIBS) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" + DESTINATION lib/cmake/${libsh_name} ) + endif(JKQtPlotter_BUILD_SHARED_LIBS) - if(BUILD_STATIC_LIBS) + if(JKQtPlotter_BUILD_STATIC_LIBS) install(TARGETS ${lib_name} EXPORT ${lib_name}_TARGETS RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -179,10 +190,11 @@ if(LIB_INSTALL) ) install(EXPORT ${lib_name}_TARGETS FILE ${lib_name}Config.cmake - DESTINATION lib/cmake + DESTINATION lib/cmake/${lib_name} ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" DESTINATION lib/cmake ) - endif(BUILD_STATIC_LIBS) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" + DESTINATION lib/cmake/${lib_name} ) + endif(JKQtPlotter_BUILD_STATIC_LIBS) install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir} @@ -204,4 +216,4 @@ if(LIB_INSTALL) 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) +