diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..51e9a02 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.5) +project(qcustomplot) +include(GNUInstallDirs) + +set(LIB_VER "" CACHE STRING "Library version") +set(QT_VER "6" CACHE STRING "Target Qt version") + +set(QCUSTOMPLOT_LIB_VERSION ${LIB_VER}) +string(REPLACE "." ";" VERSION_LIST ${LIB_VER}) +list(GET VERSION_LIST 0 QCUSTOMPLOT_SO_VERSION) + +FIND_PACKAGE(Qt${QT_VER}Core REQUIRED) +FIND_PACKAGE(Qt${QT_VER}Gui REQUIRED) +FIND_PACKAGE(Qt${QT_VER}Widgets REQUIRED) +FIND_PACKAGE(Qt${QT_VER}PrintSupport REQUIRED) +SET(CMAKE_AUTOMOC ON) + +# Library +add_library(qcustomplot SHARED qcustomplot.cpp qcustomplot.h) +set_target_properties(qcustomplot PROPERTIES VERSION ${QCUSTOMPLOT_LIB_VERSION} SOVERSION ${QCUSTOMPLOT_SO_VERSION}) +if (${QT_VER} GREATER "4") +set_target_properties(qcustomplot PROPERTIES OUTPUT_NAME qcustomplot-qt${QT_VER}) +endif() +target_link_libraries(qcustomplot Qt${QT_VER}::Core Qt${QT_VER}::Gui Qt${QT_VER}::Widgets Qt${QT_VER}::PrintSupport) + +install(TARGETS qcustomplot + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +# Headers +install(FILES qcustomplot.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) diff --git a/qcustomplot.pro b/qcustomplot.pro deleted file mode 100644 index e0c1054..0000000 --- a/qcustomplot.pro +++ /dev/null @@ -1,14 +0,0 @@ -TEMPLATE = lib -VERSION = $$SOVERSION -TARGET = qcustomplot$$QTSUFFIX -QT = core gui widgets printsupport - -SOURCES = qcustomplot.cpp -HEADERS = qcustomplot.h - -target.path = $$LIBDIR -INSTALLS += target - -header.path = /usr/include -header.files = qcustomplot.h -INSTALLS += header \ No newline at end of file diff --git a/qcustomplot.spec b/qcustomplot.spec index 8a65287..87b1b81 100644 --- a/qcustomplot.spec +++ b/qcustomplot.spec @@ -1,23 +1,32 @@ # Bump this as appropriate when doing release updates, check i.e. with abi_compliance_checker # First digit: major, bump when incompatible changes were performed # Second digit: minor, bump when interface was extended -%global so_ver 2.0.0 +%global lib_ver 2.0.0 #global pre beta +%if 0%{?rhel} +%bcond_with qt6 +%else +%bcond_without qt6 +%endif + Name: qcustomplot -Version: 2.0.1 -Release: 2%{?pre:.%pre}%{?dist} +Version: 2.1.1 +Release: 14%{?dist} Summary: Qt widget for plotting and data visualization -License: GPLv3+ +License: GPL-3.0-or-later URL: http://www.qcustomplot.com/ Source0: http://www.qcustomplot.com/release/%{version}%{?pre:-%pre}/QCustomPlot.tar.gz -Source1: %{name}.pro +Source1: CMakeLists.txt +BuildRequires: cmake +BuildRequires: ninja-build BuildRequires: gcc-c++ -BuildRequires: make -BuildRequires: qt4-devel BuildRequires: qt5-qtbase-devel +%if %{with qt6} +BuildRequires: qt6-qtbase-devel +%endif %description @@ -29,18 +38,8 @@ visualization applications. This package contains the Qt4 version. -%package devel -Summary: Development files for %{name} (Qt4) -Requires: %{name}%{?_isa} = %{version}-%{release} - -%description devel -The %{name}-devel package contains libraries and header files for -developing applications that use %{name} (Qt4). - - %package qt5 Summary: Qt widget for plotting and data visualization -Requires: %{name}-qt5%{?_isa} = %{version}-%{release} %description qt5 QCustomPlot is a Qt C++ widget for plotting and data visualization. @@ -57,7 +56,30 @@ Requires: %{name}-qt5%{?_isa} = %{version}-%{release} %description qt5-devel The %{name}-devel package contains libraries and header files for -developing applications that use %{name} (Qt5). +developing applications that use %{name} (Qt5). + + +%if %{with qt6} +%package qt6 +Summary: Qt widget for plotting and data visualization + +%description qt6 +QCustomPlot is a Qt C++ widget for plotting and data visualization. +This plotting library focuses on making good looking, publication quality 2D +plots, graphs and charts, as well as offering high performance for realtime +visualization applications. + +This package contains the Qt6 version. + + +%package qt6-devel +Summary: Development files for %{name} (Qt6) +Requires: %{name}-qt6%{?_isa} = %{version}-%{release} + +%description qt6-devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name} (Qt6). +%endif %package doc @@ -75,28 +97,24 @@ cp -a %{SOURCE1} . %build -mkdir qt4 -( -cd qt4 -LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %qmake_qt4 SOVERSION=%{so_ver} LIBDIR=%{_libdir} .. -%make_build -) +%define _vpath_builddir %{_target_platform}-qt5 +%cmake -DQT_VER=5 -DLIB_VER=%{lib_ver} +%cmake_build -mkdir qt5 -( -cd qt5 -LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %qmake_qt5 SOVERSION=%{so_ver} QTSUFFIX=-qt5 LIBDIR=%{_libdir} .. -%make_build -) +%if %{with qt6} +%define _vpath_builddir %{_target_platform}-qt6 +%cmake -DQT_VER=6 -DLIB_VER=%{lib_ver} +%cmake_build +%endif %install -make -C qt4 INSTALL_ROOT=%{buildroot} install -make -C qt5 INSTALL_ROOT=%{buildroot} install +%define _vpath_builddir %{_target_platform}-qt5 +%cmake_install -# pkg-config file install -d %{buildroot}%{_libdir}/pkgconfig/ -cat > %{buildroot}%{_libdir}/pkgconfig/%{name}.pc < %{buildroot}%{_libdir}/pkgconfig/%{name}-qt5.pc < %{buildroot}%{_libdir}/pkgconfig/%{name}-qt5.pc < %{buildroot}%{_libdir}/pkgconfig/%{name}-qt6.pc < - 2.1.1-14 +- Fix dependencies + +* Fri Jul 25 2025 Fedora Release Engineering - 2.1.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Thu Jul 17 2025 Sandro Mani - 2.1.1-12 +- Raise minimum CMake version, use GNUInstallDirs + +* Sat Jan 18 2025 Fedora Release Engineering - 2.1.1-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Fri Jul 19 2024 Fedora Release Engineering - 2.1.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Fri Jan 26 2024 Fedora Release Engineering - 2.1.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 2.1.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Oct 05 2023 Sandro Mani - 2.1.1-7 +- Conditionalize qt6 build + +* Fri Jul 21 2023 Fedora Release Engineering - 2.1.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jan 20 2023 Fedora Release Engineering - 2.1.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Nov 29 2022 Sandro Mani - 2.1.1-4 +- Set CMAKE_AUTOMOC to ON +- Fix lib version take two + +* Mon Nov 28 2022 Sandro Mani - 2.1.1-3 +- Fix lib version + +* Mon Nov 28 2022 Sandro Mani - 2.1.1-2 +- Add Qt6 build, drop Qt4 build + +* Wed Nov 09 2022 Sandro Mani - 2.1.1-1 +- Update to 2.1.1 + +* Fri Jul 22 2022 Fedora Release Engineering - 2.1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Jan 21 2022 Fedora Release Engineering - 2.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 2.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon Mar 29 2021 Sandro Mani - 2.1.0-1 +- Update to 2.1.0 + +* Wed Jan 27 2021 Fedora Release Engineering - 2.0.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 2.0.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jan 30 2020 Fedora Release Engineering - 2.0.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 2.0.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 2.0.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Sat Jul 14 2018 Fedora Release Engineering - 2.0.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild diff --git a/sources b/sources index 31cb647..25b6ede 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (QCustomPlot.tar.gz) = a15598718146ed3c6b5d38530a56661c16269e530fe0dedb71b4cb2722b5733a3b57689d668a75994b79c19c6e61dcc133dbcb9ed77b93a165f4ac826a5685b9 +SHA512 (QCustomPlot.tar.gz) = 2e49a9b3f7ab03bcd580e5f3c3ae0d5e8c57d3ccce0ceed9862cde7ea23e2f3672a963af988be60e504cb5aa50bc462e4b28acf577eae41cc6fea2802642dc19