Skip to content

Commit

Permalink
Removed Qt5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
tsujan committed Feb 15, 2024
1 parent 0541e5b commit d65d517
Show file tree
Hide file tree
Showing 49 changed files with 5,277 additions and 5,480 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
endif()
endif()

option(ENABLE_QT5 "Building Qt5 plugin." ON)
option(WITH_HUNSPELL "Compiling with Hunspell..." ON)
option(WITHOUT_X11 "Compiling without X11..." OFF)
# OS/2 never has X11
Expand Down
3 changes: 2 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
V1.1.2
V1.2.0
---------
* Removed Qt5 support.
* Also remove the block format on clearing formats.
* Added an icon for macOS (thanks to Iván Ávalos — ivan-avalos at GitHub).

Expand Down
30 changes: 13 additions & 17 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
To compile FeatherNotes from its source, first install build dependencies. In Debian-based systems, they are:

* g++ >= 5
* g++ >= 12
* libx11-dev and libxext-dev (for X11)
* qtbase5-dev and libqt5x11extras5-dev (for Qt5)
* libqt5svg5-dev (for hard-coded SVG icons)
* qttools5-dev-tools (for localization)
* qt6-base-dev (for Qt6)
* qt6-svg-dev (for hard-coded SVG icons)
* qt6-base-dev-tools (for localization)
* libhunspell-dev (for spell checking)

In Arch-based systems, the required package are:

* gcc (or gcc-multilib for multilib systems)
* libx11 and libxext (for X11)
* qt5-base and qt5-x11extras (for Qt5)
* qt5-svg (for hard-coded SVG icons)
* qt5-tools (for localization)
* qt6-base (for Qt6)
* qt6-svg (for hard-coded SVG icons)
* qt6-tools (for localization)
* hunspell (for spell checking)

In Red Hat based systems like Fedora:

* gcc-c++
* libX11-devel
* libXext-devel
* qt5-qtx11extras-devel
* qt5-qtbase-devel
* qt5-qtsvg-devel
* qt5-qttools-devel
* qt6-qtbase-devel
* qt6-qtsvg-devel
* qt6-qttools-devel
* hunspell-devel (for spell checking)

And, finally, in OpenSUSE:

* gcc-c++
* libX11-devel
* libXext-devel
* libqt5-qtx11extras-devel
* libqt5-qtbase-devel
* libqt5-qtsvg-devel
* libqt5-qttools-devel
* libqt6-qtbase-devel
* libqt6-qtsvg-devel
* libqt6-qttools-devel
* hunspell-devel (for spell checking)

NOTE: `pkgconfig` is required for finding Hunspell's version with cmake. Since it may be provided by more that one package in some distros, it is not listed above.
Expand All @@ -49,8 +47,6 @@ Then, open a terminal inside this folder and issue the following commands:

In some distros, you may need to be more explicit and use `cmake .. -DCMAKE_INSTALL_PREFIX=/usr` for installing FeatherNotes under `/usr`, in contrast to `/usr/local`. The latter place may not be good in Linux distros and could cause troubles later.

NOTE: Experimental compilation against Qt6 can be done with `cmake .. -DENABLE_QT5=OFF`. When Qt6 becomes the default version of Qt in some distros, that compilation option will be set to `OFF` by default.

************************************
* Compilation without Hunspell *
************************************
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Latest version:

25 Oct 2023, V1.1.2
15 Feb 2024, V1.2.0

See "ChangeLog" for changes.
136 changes: 35 additions & 101 deletions feathernotes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set(QT5_MINIMUM_VERSION "5.15.0")
set(QT6_MINIMUM_VERSION "6.3.0")
set(HUNSPELL_MINIMUM_VERSION "1.6")

Expand All @@ -11,13 +10,7 @@ elseif(OS2)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lcx")
endif()

if(NOT ENABLE_QT5)
set(QT_VERSION_MAJOR 6)
find_package(Qt6 "${QT6_MINIMUM_VERSION}" REQUIRED COMPONENTS Core Gui Widgets Svg Xml Network PrintSupport DBus)
else()
set(QT_VERSION_MAJOR 5)
find_package(Qt5 "${QT5_MINIMUM_VERSION}" REQUIRED COMPONENTS Core Gui Widgets Svg Xml Network PrintSupport DBus)
endif()
find_package(Qt6 "${QT6_MINIMUM_VERSION}" REQUIRED COMPONENTS Core Gui Widgets Svg Xml Network PrintSupport DBus)

if(WITH_HUNSPELL)
# for spell checking (see FindHUNSPELL.cmake)
Expand All @@ -26,56 +19,35 @@ endif()

# X11 for Linux/Unix
if(NOT WITHOUT_X11 AND UNIX AND NOT APPLE AND NOT HAIKU)
if(QT_VERSION_MAJOR EQUAL 5)
find_package(Qt5 "${QT5_MINIMUM_VERSION}" REQUIRED COMPONENTS X11Extras)
endif()
find_package(X11 REQUIRED)
endif()

# optional localization
find_package(Qt${QT_VERSION_MAJOR} QUIET COMPONENTS LinguistTools)
find_package(Qt6 QUIET COMPONENTS LinguistTools)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

if(QT_VERSION_MAJOR EQUAL 6)
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${Qt6Core_INCLUDE_DIRS}
${Qt6Gui_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
${Qt6Svg_INCLUDE_DIRS}
${Qt6Xml_INCLUDE_DIRS}
${Qt6Network_INCLUDE_DIRS}
${Qt6PrintSupport_INCLUDE_DIRS}
${Qt6DBus_INCLUDE_DIRS})
else()
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Svg_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Qt5PrintSupport_INCLUDE_DIRS}
${Qt5DBus_INCLUDE_DIRS})
endif()
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${Qt6Core_INCLUDE_DIRS}
${Qt6Gui_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
${Qt6Svg_INCLUDE_DIRS}
${Qt6Xml_INCLUDE_DIRS}
${Qt6Network_INCLUDE_DIRS}
${Qt6PrintSupport_INCLUDE_DIRS}
${Qt6DBus_INCLUDE_DIRS})

if(WITH_HUNSPELL)
include_directories(${include_directories} ${HUNSPELL_INCLUDE_DIRS})
add_definitions(-DHAS_HUNSPELL)
endif()

if(NOT WITHOUT_X11 AND UNIX AND NOT APPLE AND NOT HAIKU)
if(QT_VERSION_MAJOR EQUAL 6)
include_directories(${include_directories}
${X11_INCLUDE_DIR})
else()
include_directories(${include_directories}
${Qt5X11Extras_INCLUDE_DIRS}
${X11_INCLUDE_DIR})
endif()
include_directories(${include_directories}
${X11_INCLUDE_DIR})
add_definitions(-DHAS_X11)
endif()

Expand Down Expand Up @@ -110,23 +82,13 @@ if(NOT WITHOUT_X11 AND UNIX AND NOT APPLE AND NOT HAIKU)
set(feathernotes_SRCS ${feathernotes_SRCS} x11.cpp)
endif()

if(QT_VERSION_MAJOR EQUAL 6)
qt6_add_dbus_adaptor(feathernotes_DBUS_SRCS
org.feathernotes.Application.xml
singleton.h
FeatherNotes::FNSingleton
feathernotesadaptor
FeatherNotesAdaptor
)
else()
qt5_add_dbus_adaptor(feathernotes_DBUS_SRCS
org.feathernotes.Application.xml
singleton.h
FeatherNotes::FNSingleton
feathernotesadaptor
FeatherNotesAdaptor
)
endif()
qt6_add_dbus_adaptor(feathernotes_DBUS_SRCS
org.feathernotes.Application.xml
singleton.h
FeatherNotes::FNSingleton
feathernotesadaptor
FeatherNotesAdaptor
)

set(feathernotes_RESOURCES data/fn.qrc)
set(DESKTOP_FILE data/feathernotes.desktop)
Expand All @@ -146,24 +108,12 @@ else()
set(feathernotes_SRCS ${feathernotes_SRCS} data/feathernotes_os2.rc)
endif()

if(QT_VERSION_MAJOR EQUAL 6)
set(EXTRA_HEADERS warningbar.h spinbox.h messagebox.h filedialog.h help.h settings.h treeview.h treedelegate.h)
else()
if(CMAKE_VERSION VERSION_LESS "3.10.0") # CMP0071 in 3.10: Let AUTOMOC and AUTOUIC process GENERATED files
qt5_wrap_cpp(EXTRA_HEADERS warningbar.h spinbox.h messagebox.h filedialog.h help.h settings.h treeview.h treedelegate.h)
else()
set(EXTRA_HEADERS warningbar.h spinbox.h messagebox.h filedialog.h help.h settings.h treeview.h treedelegate.h)
endif()
endif()
set(EXTRA_HEADERS warningbar.h spinbox.h messagebox.h filedialog.h help.h settings.h treeview.h treedelegate.h)

# translations
if(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
if(Qt6LinguistTools_FOUND)
file(GLOB TS_FILES data/translations/feathernotes_*.ts)
if(QT_VERSION_MAJOR EQUAL 6)
qt6_add_translation(QM_FILES ${TS_FILES})
else()
qt5_add_translation(QM_FILES ${TS_FILES})
endif()
qt6_add_translation(QM_FILES ${TS_FILES})
add_executable(feathernotes ${feathernotes_SRCS} ${feathernotes_DBUS_SRCS} ${feathernotes_RESOURCES} ${EXTRA_HEADERS} ${DESKTOP_FILE} ${QM_FILES})
if(HAIKU)
install(FILES ${QM_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/translations")
Expand All @@ -172,41 +122,25 @@ if(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
elseif(UNIX OR OS2)
install(FILES ${QM_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/feathernotes/translations")
endif()
else(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
else(Qt6LinguistTools_FOUND)
add_executable(feathernotes ${feathernotes_SRCS} ${feathernotes_DBUS_SRCS} ${feathernotes_RESOURCES} ${EXTRA_HEADERS} ${DESKTOP_FILE})
endif(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)

if(QT_VERSION_MAJOR EQUAL 6)
target_link_libraries(feathernotes ${Qt6Core_LIBRARIES}
${Qt6Gui_LIBRARIES}
${Qt6Widgets_LIBRARIES}
${Qt6Svg_LIBRARIES}
${Qt6Xml_LIBRARIES}
${Qt6Network_LIBRARIES}
${Qt6PrintSupport_LIBRARIES}
${Qt6DBus_LIBRARIES})
else()
target_link_libraries(feathernotes ${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Xml_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5PrintSupport_LIBRARIES}
${Qt5DBus_LIBRARIES})
endif()
endif(Qt6LinguistTools_FOUND)

target_link_libraries(feathernotes ${Qt6Core_LIBRARIES}
${Qt6Gui_LIBRARIES}
${Qt6Widgets_LIBRARIES}
${Qt6Svg_LIBRARIES}
${Qt6Xml_LIBRARIES}
${Qt6Network_LIBRARIES}
${Qt6PrintSupport_LIBRARIES}
${Qt6DBus_LIBRARIES})

if(WITH_HUNSPELL)
target_link_libraries(feathernotes ${HUNSPELL_LIBRARIES})
endif()

if(NOT WITHOUT_X11 AND UNIX AND NOT APPLE AND NOT HAIKU)
if(QT_VERSION_MAJOR EQUAL 6)
target_link_libraries(feathernotes ${X11_LIBRARIES})
else()
target_link_libraries(feathernotes ${Qt5X11Extras_LIBRARIES}
${X11_LIBRARIES})
endif()
target_link_libraries(feathernotes ${X11_LIBRARIES})
endif()

# installation
Expand Down

0 comments on commit d65d517

Please sign in to comment.