mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 10:56:11 +00:00
Use qt6 by default (#3366)
* Use Qt6 by default. * Replace a potentially ambigious CUTTER_QT6=On/Off option with CUTTER_QT=(5|6) * Add support Qt6 version of KSyntaxHighlighter
This commit is contained in:
parent
27f5cc36ee
commit
c817c6b53f
@ -39,7 +39,6 @@ build_script:
|
|||||||
- cmd: "cmake
|
- cmd: "cmake
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
-DCUTTER_USE_BUNDLED_RIZIN=ON
|
-DCUTTER_USE_BUNDLED_RIZIN=ON
|
||||||
-DCUTTER_QT6=ON
|
|
||||||
-DCUTTER_ENABLE_PYTHON=ON
|
-DCUTTER_ENABLE_PYTHON=ON
|
||||||
-DCUTTER_ENABLE_PYTHON_BINDINGS=ON
|
-DCUTTER_ENABLE_PYTHON_BINDINGS=ON
|
||||||
-DCUTTER_ENABLE_PACKAGING=ON
|
-DCUTTER_ENABLE_PACKAGING=ON
|
||||||
|
11
.github/actions/build-linux-old/entrypoint.sh
vendored
11
.github/actions/build-linux-old/entrypoint.sh
vendored
@ -109,13 +109,6 @@ fi
|
|||||||
# otherwise git complains about dubious ownership, due to code being checked out outside the container with a different user
|
# otherwise git complains about dubious ownership, due to code being checked out outside the container with a different user
|
||||||
git config --global --add safe.directory /github/workspace/rizin
|
git config --global --add safe.directory /github/workspace/rizin
|
||||||
|
|
||||||
if [ $qt_major = 6]
|
|
||||||
then
|
|
||||||
CMAKE_QT_ARG='ON'
|
|
||||||
else
|
|
||||||
CMAKE_QT_ARG='OFF'
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
if [ "$system_deps" = "false" ]
|
if [ "$system_deps" = "false" ]
|
||||||
@ -144,14 +137,14 @@ then
|
|||||||
-DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \
|
-DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=appdir/usr \
|
-DCMAKE_INSTALL_PREFIX=appdir/usr \
|
||||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
|
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
|
||||||
-DCUTTER_QT6=$CMAKE_QT_ARG \
|
-DCUTTER_QT=$qt_major \
|
||||||
..
|
..
|
||||||
else
|
else
|
||||||
cmake \
|
cmake \
|
||||||
-G Ninja \
|
-G Ninja \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCUTTER_USE_BUNDLED_RIZIN=ON \
|
-DCUTTER_USE_BUNDLED_RIZIN=ON \
|
||||||
-DCUTTER_QT6=$CMAKE_QT_ARG \
|
-DCUTTER_QT=$qt_major \
|
||||||
..
|
..
|
||||||
fi
|
fi
|
||||||
ninja
|
ninja
|
||||||
|
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@ -222,20 +222,13 @@ jobs:
|
|||||||
-DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \
|
-DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=appdir/usr \
|
-DCMAKE_INSTALL_PREFIX=appdir/usr \
|
||||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
|
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
|
||||||
-DCUTTER_QT6=${{ matrix.qt-major == '6' && 'ON' || 'OFF' }} \
|
-DCUTTER_QT=${{ matrix.qt-major }} \
|
||||||
..
|
|
||||||
elif [ "${{ matrix.image }}" = "ubuntu:22.04" ]
|
|
||||||
then
|
|
||||||
cmake \
|
|
||||||
-G Ninja \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DCUTTER_QT6=ON \
|
|
||||||
-DCUTTER_USE_BUNDLED_RIZIN=ON \
|
|
||||||
..
|
..
|
||||||
else
|
else
|
||||||
cmake \
|
cmake \
|
||||||
-G Ninja \
|
-G Ninja \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCUTTER_QT=${{ matrix.qt-major }} \
|
||||||
-DCUTTER_USE_BUNDLED_RIZIN=ON \
|
-DCUTTER_USE_BUNDLED_RIZIN=ON \
|
||||||
..
|
..
|
||||||
fi
|
fi
|
||||||
@ -473,7 +466,6 @@ jobs:
|
|||||||
-DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \
|
-DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \
|
||||||
-DCUTTER_PACKAGE_RZ_LIBYARA=ON \
|
-DCUTTER_PACKAGE_RZ_LIBYARA=ON \
|
||||||
-DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \
|
-DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \
|
||||||
-DCUTTER_QT6=ON \
|
|
||||||
-DCPACK_PACKAGE_FILE_NAME="$PACKAGE_NAME" \
|
-DCPACK_PACKAGE_FILE_NAME="$PACKAGE_NAME" \
|
||||||
-DCPACK_BUNDLE_APPLE_CERT_APP="-" \
|
-DCPACK_BUNDLE_APPLE_CERT_APP="-" \
|
||||||
.. && \
|
.. && \
|
||||||
@ -518,7 +510,6 @@ jobs:
|
|||||||
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON ^
|
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON ^
|
||||||
-DCMAKE_PREFIX_PATH="%CUTTER_DEPS%\pyside" ^
|
-DCMAKE_PREFIX_PATH="%CUTTER_DEPS%\pyside" ^
|
||||||
-DCPACK_PACKAGE_FILE_NAME=%PACKAGE_NAME% ^
|
-DCPACK_PACKAGE_FILE_NAME=%PACKAGE_NAME% ^
|
||||||
-DCUTTER_QT6=ON ^
|
|
||||||
-G Ninja ^
|
-G Ninja ^
|
||||||
..
|
..
|
||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
|
@ -29,7 +29,8 @@ option(CUTTER_PACKAGE_RZ_LIBSWIFT "Compile and install rz-libswift demangler dur
|
|||||||
option(CUTTER_PACKAGE_RZ_LIBYARA "Compile and install rz-libyara during the install step." OFF)
|
option(CUTTER_PACKAGE_RZ_LIBYARA "Compile and install rz-libyara during the install step." OFF)
|
||||||
option(CUTTER_PACKAGE_RZ_SILHOUETTE "Compile and install rz-silhouette during the install step." OFF)
|
option(CUTTER_PACKAGE_RZ_SILHOUETTE "Compile and install rz-silhouette during the install step." OFF)
|
||||||
option(CUTTER_PACKAGE_JSDEC "Compile and install jsdec during install step." OFF)
|
option(CUTTER_PACKAGE_JSDEC "Compile and install jsdec during install step." OFF)
|
||||||
OPTION(CUTTER_QT6 "Use QT6" OFF)
|
set("CUTTER_QT" 6 CACHE STRING "Major QT version to use 5|6")
|
||||||
|
set_property(CACHE "CUTTER_QT" PROPERTY STRINGS 5 6)
|
||||||
|
|
||||||
if(NOT CUTTER_ENABLE_PYTHON)
|
if(NOT CUTTER_ENABLE_PYTHON)
|
||||||
set(CUTTER_ENABLE_PYTHON_BINDINGS OFF)
|
set(CUTTER_ENABLE_PYTHON_BINDINGS OFF)
|
||||||
@ -84,12 +85,10 @@ set(CMAKE_AUTOMOC ON)
|
|||||||
set(CMAKE_AUTOUIC ON)
|
set(CMAKE_AUTOUIC ON)
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
set(QT_COMPONENTS Core Widgets Gui Svg Network)
|
set(QT_COMPONENTS Core Widgets Gui Svg Network)
|
||||||
if (CUTTER_QT6)
|
if (CUTTER_QT GREATER_EQUAL 6)
|
||||||
set(QT_PREFIX Qt6)
|
|
||||||
list(APPEND QT_COMPONENTS Core5Compat SvgWidgets OpenGLWidgets)
|
list(APPEND QT_COMPONENTS Core5Compat SvgWidgets OpenGLWidgets)
|
||||||
else()
|
|
||||||
set(QT_PREFIX Qt5)
|
|
||||||
endif()
|
endif()
|
||||||
|
set(QT_PREFIX "Qt${CUTTER_QT}")
|
||||||
find_package(${QT_PREFIX} REQUIRED COMPONENTS ${QT_COMPONENTS})
|
find_package(${QT_PREFIX} REQUIRED COMPONENTS ${QT_COMPONENTS})
|
||||||
|
|
||||||
if(CUTTER_ENABLE_PYTHON)
|
if(CUTTER_ENABLE_PYTHON)
|
||||||
@ -105,7 +104,7 @@ if(CUTTER_ENABLE_PYTHON)
|
|||||||
add_definitions(-DCUTTER_ENABLE_PYTHON)
|
add_definitions(-DCUTTER_ENABLE_PYTHON)
|
||||||
|
|
||||||
if(CUTTER_ENABLE_PYTHON_BINDINGS)
|
if(CUTTER_ENABLE_PYTHON_BINDINGS)
|
||||||
if (CUTTER_QT6)
|
if (CUTTER_QT GREATER_EQUAL 6)
|
||||||
# 6.12.3 => 6.12
|
# 6.12.3 => 6.12
|
||||||
if("${Qt6_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)\\.[0-9]+")
|
if("${Qt6_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)\\.[0-9]+")
|
||||||
set(Shiboken6_VERSION_REQUIRED "${CMAKE_MATCH_1}")
|
set(Shiboken6_VERSION_REQUIRED "${CMAKE_MATCH_1}")
|
||||||
@ -122,7 +121,7 @@ if(CUTTER_ENABLE_PYTHON)
|
|||||||
set(CMAKE_REQUIRED_INCLUDES "${PYSIDE_INCLUDE_DIRS};${LIBSHIBOKEN_INCLUDE_DIRS}")
|
set(CMAKE_REQUIRED_INCLUDES "${PYSIDE_INCLUDE_DIRS};${LIBSHIBOKEN_INCLUDE_DIRS}")
|
||||||
CHECK_INCLUDE_FILE_CXX("pysidecleanup.h" HAVE_PYSIDECLEANUP)
|
CHECK_INCLUDE_FILE_CXX("pysidecleanup.h" HAVE_PYSIDECLEANUP)
|
||||||
add_compile_definitions("HAVE_PYSIDECLEANUP=${HAVE_PYSIDECLEANUP}")
|
add_compile_definitions("HAVE_PYSIDECLEANUP=${HAVE_PYSIDECLEANUP}")
|
||||||
else()
|
elseif(CUTTER_QT EQUAL 5)
|
||||||
# 5.12.3 => 5.12
|
# 5.12.3 => 5.12
|
||||||
if("${Qt5_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)\\.[0-9]+")
|
if("${Qt5_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)\\.[0-9]+")
|
||||||
set(Shiboken2_VERSION_REQUIRED "${CMAKE_MATCH_1}")
|
set(Shiboken2_VERSION_REQUIRED "${CMAKE_MATCH_1}")
|
||||||
@ -132,6 +131,8 @@ if(CUTTER_ENABLE_PYTHON)
|
|||||||
find_package(Shiboken2 "${Shiboken2_VERSION_REQUIRED}" REQUIRED)
|
find_package(Shiboken2 "${Shiboken2_VERSION_REQUIRED}" REQUIRED)
|
||||||
find_package(PySide2 "${Shiboken2_VERSION_REQUIRED}" REQUIRED)
|
find_package(PySide2 "${Shiboken2_VERSION_REQUIRED}" REQUIRED)
|
||||||
get_target_property(PYSIDE_INCLUDE_DIRS PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES)
|
get_target_property(PYSIDE_INCLUDE_DIRS PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Unsupported QT version ${CUTTER_QT}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(_dir IN LISTS PYSIDE_INCLUDE_DIRS)
|
foreach(_dir IN LISTS PYSIDE_INCLUDE_DIRS)
|
||||||
@ -145,23 +146,18 @@ if(CUTTER_ENABLE_PYTHON)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CUTTER_ENABLE_KSYNTAXHIGHLIGHTING AND (NOT CUTTER_QT6))
|
if(CUTTER_ENABLE_KSYNTAXHIGHLIGHTING)
|
||||||
if(CUTTER_ENABLE_KSYNTAXHIGHLIGHTING STREQUAL AUTO)
|
if(CUTTER_ENABLE_KSYNTAXHIGHLIGHTING STREQUAL AUTO)
|
||||||
find_package(KF5SyntaxHighlighting)
|
find_package(KF${CUTTER_QT}SyntaxHighlighting)
|
||||||
if(KF5SyntaxHighlighting_FOUND)
|
if(KF${CUTTER_QT}SyntaxHighlighting_FOUND)
|
||||||
set(KSYNTAXHIGHLIGHTING_STATUS ON)
|
set(KSYNTAXHIGHLIGHTING_STATUS ON)
|
||||||
else()
|
else()
|
||||||
set(KSYNTAXHIGHLIGHTING_STATUS "OFF (KSyntaxHighlighting not found)")
|
set(KSYNTAXHIGHLIGHTING_STATUS "OFF (KSyntaxHighlighting not found)")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
find_package(KF5SyntaxHighlighting REQUIRED)
|
find_package(KF${CUTTER_QT}SyntaxHighlighting REQUIRED)
|
||||||
set(KSYNTAXHIGHLIGHTING_STATUS ON)
|
set(KSYNTAXHIGHLIGHTING_STATUS ON)
|
||||||
endif()
|
endif()
|
||||||
else()
|
|
||||||
if(CUTTER_ENABLE_KSYNTAXHIGHLIGHTING AND CUTTER_QT6)
|
|
||||||
message(WARNING "KSyntaxHighlighting has been disabled because not supported in QT6")
|
|
||||||
endif()
|
|
||||||
set(KSYNTAXHIGHLIGHTING_STATUS OFF)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CUTTER_ENABLE_GRAPHVIZ)
|
if (CUTTER_ENABLE_GRAPHVIZ)
|
||||||
@ -192,9 +188,13 @@ message(STATUS "- Package RzLibSwift: ${CUTTER_PACKAGE_RZ_LIBSWIFT}")
|
|||||||
message(STATUS "- Package RzLibYara: ${CUTTER_PACKAGE_RZ_LIBYARA}")
|
message(STATUS "- Package RzLibYara: ${CUTTER_PACKAGE_RZ_LIBYARA}")
|
||||||
message(STATUS "- Package RzSilhouette: ${CUTTER_PACKAGE_RZ_SILHOUETTE}")
|
message(STATUS "- Package RzSilhouette: ${CUTTER_PACKAGE_RZ_SILHOUETTE}")
|
||||||
message(STATUS "- Package JSDec: ${CUTTER_PACKAGE_JSDEC}")
|
message(STATUS "- Package JSDec: ${CUTTER_PACKAGE_JSDEC}")
|
||||||
message(STATUS "- QT6: ${CUTTER_QT6}")
|
message(STATUS "- QT: ${CUTTER_QT}")
|
||||||
message(STATUS "")
|
message(STATUS "")
|
||||||
|
|
||||||
|
if (CUTTER_QT LESS 5 OR CUTTER_QT GREATER 6)
|
||||||
|
message(FATAL_ERROR "Unsupported QT major version")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
if(CUTTER_ENABLE_PACKAGING)
|
if(CUTTER_ENABLE_PACKAGING)
|
||||||
|
@ -24,10 +24,10 @@ set(TS_FILES
|
|||||||
# translations/pt-BR/cutter_pt.ts #2321 handling multiple versions of a language
|
# translations/pt-BR/cutter_pt.ts #2321 handling multiple versions of a language
|
||||||
|
|
||||||
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/translations)
|
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/translations)
|
||||||
if (CUTTER_QT6)
|
if (CUTTER_QT EQUAL 6)
|
||||||
find_package(Qt6LinguistTools REQUIRED)
|
find_package(Qt6LinguistTools REQUIRED)
|
||||||
qt6_add_translation(qmFiles ${TS_FILES})
|
qt6_add_translation(qmFiles ${TS_FILES})
|
||||||
else()
|
elseif(CUTTER_QT EQUAL 5)
|
||||||
find_package(Qt5LinguistTools REQUIRED)
|
find_package(Qt5LinguistTools REQUIRED)
|
||||||
qt5_add_translation(qmFiles ${TS_FILES})
|
qt5_add_translation(qmFiles ${TS_FILES})
|
||||||
endif()
|
endif()
|
||||||
|
2
dist/CMakeLists.txt
vendored
2
dist/CMakeLists.txt
vendored
@ -163,7 +163,7 @@ if(CUTTER_ENABLE_DEPENDENCY_DOWNLOADS AND (NOT WIN32))
|
|||||||
else()
|
else()
|
||||||
set (YARA_PLUGIN_OPTIONS "")
|
set (YARA_PLUGIN_OPTIONS "")
|
||||||
endif()
|
endif()
|
||||||
if (CUTTER_QT6)
|
if (CUTTER_QT EQUAL 6)
|
||||||
set (YARA_PLUGIN_OPTIONS "${YARA_PLUGIN_OPTIONS} -DCUTTER_QT6=ON")
|
set (YARA_PLUGIN_OPTIONS "${YARA_PLUGIN_OPTIONS} -DCUTTER_QT6=ON")
|
||||||
endif()
|
endif()
|
||||||
install(CODE "
|
install(CODE "
|
||||||
|
@ -45,13 +45,15 @@ On Linux, you will need:
|
|||||||
* meson
|
* meson
|
||||||
* libzip-dev
|
* libzip-dev
|
||||||
* libzlib-dev
|
* libzlib-dev
|
||||||
* qt5
|
* qt6
|
||||||
* qt5-svg
|
* qt6-svg
|
||||||
* pkgconf
|
* pkgconf
|
||||||
* curl*
|
* curl*
|
||||||
* python-setuptools*
|
* python-setuptools*
|
||||||
* KSyntaxHighlighter**
|
* KSyntaxHighlighter**
|
||||||
* graphviz**
|
* graphviz**
|
||||||
|
* shiboken6**
|
||||||
|
* pyside6**
|
||||||
|
|
||||||
`*` Recommended while building with ``make``/``Cmake``.
|
`*` Recommended while building with ``make``/``Cmake``.
|
||||||
|
|
||||||
@ -61,22 +63,14 @@ On Debian-based Linux distributions, all of these essential packages can be inst
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo apt install build-essential cmake meson libzip-dev zlib1g-dev qt5-default libqt5svg5-dev qttools5-dev qttools5-dev-tools
|
sudo apt install build-essential cmake meson pkgconf libzip-dev zlib1g-dev qt6-base-dev qt6-tools-dev qt6-tools-dev-tools libqt6svg6-dev libqt6core5compat6-dev libqt6svgwidgets6 qt6-l10n-tools
|
||||||
|
|
||||||
.. note::
|
|
||||||
On Debian 11 (bullseye) and higher or Ubuntu 22.04 (Jammy) and higher, replace ``qt5-default`` above with ``qtbase5-dev``.
|
|
||||||
|
|
||||||
Depending on your configuration you'll might also need the following:
|
Depending on your configuration you'll might also need the following:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
# When building with CUTTER_ENABLE_KSYNTAXHIGHLIGHTING (Default)
|
|
||||||
sudo apt install libkf5syntaxhighlighting-dev
|
|
||||||
# When building with CUTTER_ENABLE_GRAPHVIZ (Default)
|
# When building with CUTTER_ENABLE_GRAPHVIZ (Default)
|
||||||
sudo apt install libgraphviz-dev
|
sudo apt install libgraphviz-dev
|
||||||
# when building with CUTTER_ENABLE_PYTHON_BINDINGS
|
|
||||||
sudo apt install libshiboken2-dev libpyside2-dev qtdeclarative5-dev
|
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
For Ubuntu 20.04 and lower (or in any case you get an error ``Meson version is x but project requires >=y``), ``meson`` should be installed with ``pip install --upgrade --user meson``.
|
For Ubuntu 20.04 and lower (or in any case you get an error ``Meson version is x but project requires >=y``), ``meson`` should be installed with ``pip install --upgrade --user meson``.
|
||||||
@ -85,19 +79,25 @@ On Arch-based Linux distributions:
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
sudo pacman -Syu --needed base-devel cmake meson qt6-base qt6-svg qt6-tools
|
||||||
|
|
||||||
# When building with CUTTER_ENABLE_KSYNTAXHIGHLIGHTING (Default)
|
# When building with CUTTER_ENABLE_KSYNTAXHIGHLIGHTING (Default)
|
||||||
sudo pacman -Syu --needed syntax-highlighting
|
sudo pacman -Syu --needed syntax-highlighting
|
||||||
# When building with CUTTER_ENABLE_GRAPHVIZ (Default)
|
# When building with CUTTER_ENABLE_GRAPHVIZ (Default)
|
||||||
sudo pacman -Syu --needed graphviz
|
sudo pacman -Syu --needed graphviz
|
||||||
|
# When building with CUTTER_ENABLE_PYTHON and CUTTER_ENABLE_PYTHON_BINDINGS
|
||||||
sudo pacman -Syu --needed base-devel cmake meson qt5-base qt5-svg qt5-tools
|
sudo pacman -Syu --needed pyside6 shiboken6
|
||||||
|
|
||||||
|
|
||||||
On dnf/yum based distributions:
|
On dnf/yum based distributions:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo dnf install -y gcc gcc-c++ make cmake meson qt5-qtbase-devel qt5-qtsvg-devel qt5-qttools-devel
|
sudo dnf install -y gcc gcc-c++ make cmake meson qt6-qtbase-devel qt6-qtsvg-devel qt6-qttools-devel qt6-qt5compat-devel
|
||||||
|
# Optional packages
|
||||||
|
sudo dnf install -y graphviz-devel kf6-syntax-highlighting-devel python3-devel shiboken6 python3-pyside6-devel clang
|
||||||
|
|
||||||
|
|
||||||
|
On older Linux systems not supported by QT6 you can use Qt 5.15. Use of Qt5 on operating systems other than Linux is untested.
|
||||||
|
|
||||||
Building Steps
|
Building Steps
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
@ -163,12 +163,12 @@ Building on Windows
|
|||||||
Requirements
|
Requirements
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
Cutter works on Windows 7 or newer.
|
Cutter works on Windows 10 or newer.
|
||||||
To compile Cutter it is necessary to have the following installed:
|
To compile Cutter it is necessary to have the following installed:
|
||||||
|
|
||||||
* A version of `Visual Studio <https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16>`_ (2015, 2017 and 2019 are supported)
|
* A version of `Visual Studio <https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16>`_ (2019 or newer)
|
||||||
* `CMake <https://cmake.org/download/>`_
|
* `CMake <https://cmake.org/download/>`_
|
||||||
* `Qt 5 <https://www.qt.io/download-qt-installer>`_
|
* `Qt 6 <https://www.qt.io/download-qt-installer>`_ See :doc:`development environment setup</contributing/code/ide-setup>` for alternative ways of obtaining Qt that don't require Qt account.
|
||||||
* `Meson <https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip>`_
|
* `Meson <https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip>`_
|
||||||
* `Ninja <https://github.com/ninja-build/ninja/releases/latest>`_
|
* `Ninja <https://github.com/ninja-build/ninja/releases/latest>`_
|
||||||
|
|
||||||
@ -198,12 +198,9 @@ If they are not available, you can use PowerShell to add them to your PATH one b
|
|||||||
Note that the paths below may vary depending on your version of Qt and Visual Studio.
|
Note that the paths below may vary depending on your version of Qt and Visual Studio.
|
||||||
|
|
||||||
.. code:: powershell
|
.. code:: powershell
|
||||||
|
|
||||||
# First, set CMAKE_PREFIX_PATH to Qt5 intallation prefix
|
|
||||||
$Env:CMAKE_PREFIX_PATH = "C:\Qt\5.15.2\msvc2019_64\lib\cmake\Qt5"
|
|
||||||
|
|
||||||
# Then, add the following directory to your PATH
|
# Add the following directory to your PATH
|
||||||
$Env:Path += ";C:\Qt\5.15.2\msvc2019_64\bin"
|
$Env:Path += ";C:\Qt\6.7.2\msvc2019_64\bin"
|
||||||
|
|
||||||
# Build Cutter
|
# Build Cutter
|
||||||
cmake -B build
|
cmake -B build
|
||||||
@ -231,7 +228,7 @@ For basic build all dependencies except XCode can be installed using homebrew:
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
brew install cmake qt5 meson ninja
|
brew install cmake qt6 meson ninja
|
||||||
|
|
||||||
|
|
||||||
Recommended Way for dev builds
|
Recommended Way for dev builds
|
||||||
@ -241,7 +238,7 @@ Recommended Way for dev builds
|
|||||||
|
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5
|
cmake .. -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt6
|
||||||
make
|
make
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
@ -252,17 +249,19 @@ CMake Building Options
|
|||||||
Note that there are some major building options available:
|
Note that there are some major building options available:
|
||||||
|
|
||||||
* ``CUTTER_USE_BUNDLED_RIZIN`` automatically compile Rizin from submodule (Enabled by default).
|
* ``CUTTER_USE_BUNDLED_RIZIN`` automatically compile Rizin from submodule (Enabled by default).
|
||||||
* ``CUTTER_ENABLE_PYTHON`` compile with Python support.
|
* ``CUTTER_ENABLE_PYTHON`` compile with Python support, required for Python plugins.
|
||||||
* ``CUTTER_ENABLE_PYTHON_BINDINGS`` automatically generate Python Bindings with Shiboken, required for Python plugins!
|
* ``CUTTER_ENABLE_PYTHON_BINDINGS`` automatically generate Python Bindings with Shiboken, required for Python plugins!
|
||||||
* ``CUTTER_ENABLE_KSYNTAXHIGHLIGHTING`` use KSyntaxHighlighting for code highlighting.
|
* ``CUTTER_ENABLE_KSYNTAXHIGHLIGHTING`` use KSyntaxHighlighting for code highlighting.
|
||||||
* ``CUTTER_ENABLE_GRAPHVIZ`` enable Graphviz for graph layouts.
|
* ``CUTTER_ENABLE_GRAPHVIZ`` enable Graphviz for graph layouts.
|
||||||
* ``CUTTER_EXTRA_PLUGIN_DIRS`` List of addition plugin locations. Useful when preparing package for Linux distros that have strict package layout rules.
|
* ``CUTTER_EXTRA_PLUGIN_DIRS`` List of addition plugin locations. Useful when preparing package for Linux distros that have strict package layout rules.
|
||||||
|
* ``CUTTER_QT`` Qt major version to use. Defaults to 6. Allowed values: 5, 6.
|
||||||
|
|
||||||
Cutter binary release options, not needed for most users and might not work easily outside CI environment:
|
Cutter binary release options, not needed for most users and might not work easily outside CI environment:
|
||||||
|
|
||||||
* ``CUTTER_ENABLE_DEPENDENCY_DOWNLOADS`` Enable downloading of dependencies. Setting to OFF doesn't affect any downloads done by Rizin build. This option is used for preparing Cutter binary release packges. Turned off by default.
|
* ``CUTTER_ENABLE_DEPENDENCY_DOWNLOADS`` Enable downloading of dependencies. Setting to OFF doesn't affect any downloads done by Rizin build. This option is used for preparing Cutter binary release packges. Turned off by default.
|
||||||
* ``CUTTER_PACKAGE_DEPENDENCIES`` During install step include the third party dependencies. This option is used for preparing Cutter binary release packges.
|
* ``CUTTER_PACKAGE_DEPENDENCIES`` During install step include the third party dependencies. This option is used for preparing Cutter binary release packages.
|
||||||
|
|
||||||
|
For full list of Cutter specific build options and their description see CMakeCache.txt after configuring the project or use a graphical CMake configurator if your IDE provides one.
|
||||||
|
|
||||||
These options can be enabled or disabled from the command line arguments passed to CMake.
|
These options can be enabled or disabled from the command line arguments passed to CMake.
|
||||||
For example, to build Cutter with support for Python plugins, you can run this command:
|
For example, to build Cutter with support for Python plugins, you can run this command:
|
||||||
@ -278,6 +277,8 @@ Or if one wants to explicitly disable an option:
|
|||||||
cmake -B build -DCUTTER_ENABLE_PYTHON=OFF
|
cmake -B build -DCUTTER_ENABLE_PYTHON=OFF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Troubleshooting
|
Troubleshooting
|
||||||
@ -345,11 +346,3 @@ You can also try:
|
|||||||
You can also install Rizin into ``/usr/lib/pkgconfig/`` and then
|
You can also install Rizin into ``/usr/lib/pkgconfig/`` and then
|
||||||
add a variable ``PKG_CONFIG_PATH`` with the value ``/usr/lib/pkgconfig/``.
|
add a variable ``PKG_CONFIG_PATH`` with the value ``/usr/lib/pkgconfig/``.
|
||||||
|
|
||||||
* **macOS libjpeg error**
|
|
||||||
|
|
||||||
On macOS, Qt5 apps fail to build on QtCreator if you have the ``libjpeg``
|
|
||||||
installed with brew. Run this command to work around the issue:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
sudo mv /usr/local/lib/libjpeg.dylib /usr/local/lib/libjpeg.dylib.not-found
|
|
||||||
|
@ -182,7 +182,7 @@ Project setup
|
|||||||
- Check options that you want Cutter to be built with, or leave it as-is for the default options.
|
- Check options that you want Cutter to be built with, or leave it as-is for the default options.
|
||||||
- If you are using vcpkg, Visual Studio should detect it automatically. The list of CMake options in the configurator should have some referring to vcpkg. If they are not there, specify the path to vcpkg toolchain file in the :guilabel:`CMake toolchain file` field.
|
- If you are using vcpkg, Visual Studio should detect it automatically. The list of CMake options in the configurator should have some referring to vcpkg. If they are not there, specify the path to vcpkg toolchain file in the :guilabel:`CMake toolchain file` field.
|
||||||
- If you are not using vcpkg, configure the path to Qt as mentioned in :ref:`windows CMake instructions<building:Building on Windows>`. You can specify the CMake flag in :guilabel:`CMake command arguments:` field.
|
- If you are not using vcpkg, configure the path to Qt as mentioned in :ref:`windows CMake instructions<building:Building on Windows>`. You can specify the CMake flag in :guilabel:`CMake command arguments:` field.
|
||||||
- To Ensure that VS debugger can display Qt types in a readable way, it is recommended to install `Qt Visual Studio Tools <https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019>`_ plugin. It will create a :file:`Documents/Visual Studio 2019/Visualizers/qt5.natvis` file. Once :file:`qt5.natvis` has been created you can uninstall the plugin.
|
- To Ensure that VS debugger can display Qt types in a readable way, it is recommended to install `Qt Visual Studio Tools <https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019>`_ plugin. It will create a :file:`Documents/Visual Studio 2019/Visualizers/qt6.natvis` file. Once :file:`qt6.natvis` has been created you can uninstall the plugin.
|
||||||
|
|
||||||
Changing CMake configuration
|
Changing CMake configuration
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -197,4 +197,4 @@ Editing Qt .ui files and Qt integration
|
|||||||
By default Visual Studio will open ``.ui`` files as XML text documents. You can configure to open it using Qt Designer by right-clicking and selecting :guilabel:`Open With...`.
|
By default Visual Studio will open ``.ui`` files as XML text documents. You can configure to open it using Qt Designer by right-clicking and selecting :guilabel:`Open With...`.
|
||||||
|
|
||||||
There is a Qt plugin for Visual Studio from Qt. It isn't very useful for Cutter development since it is aimed more at helping with Qt integration into Visual Studio projects.
|
There is a Qt plugin for Visual Studio from Qt. It isn't very useful for Cutter development since it is aimed more at helping with Qt integration into Visual Studio projects.
|
||||||
It doesn't do much for CMake based projects. The biggest benefit is that it automatically installs :file:`qt5.natvis` file for more readable displaying of Qt types in the debugger.
|
It doesn't do much for CMake based projects. The biggest benefit is that it automatically installs :file:`qt6.natvis` file for more readable displaying of Qt types in the debugger.
|
||||||
|
@ -410,12 +410,14 @@ if (CUTTER_ENABLE_PYTHON)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CUTTER_ENABLE_PYTHON_BINDINGS)
|
if(CUTTER_ENABLE_PYTHON_BINDINGS)
|
||||||
if (CUTTER_QT6)
|
if (CUTTER_QT EQUAL 6)
|
||||||
set(PYSIDE_NAME PySide6)
|
set(PYSIDE_NAME PySide6)
|
||||||
set(SHIBOKEN_COMMAND Shiboken6::shiboken6)
|
set(SHIBOKEN_COMMAND Shiboken6::shiboken6)
|
||||||
else()
|
set (CUTTER_PYSIDE_LIBS Shiboken6::libshiboken PySide6::pyside6)
|
||||||
|
elseif(CUTTER_QT EQUAL 5)
|
||||||
set(PYSIDE_NAME PySide2)
|
set(PYSIDE_NAME PySide2)
|
||||||
set(SHIBOKEN_COMMAND Shiboken2::shiboken2)
|
set(SHIBOKEN_COMMAND Shiboken2::shiboken2)
|
||||||
|
set (CUTTER_PYSIDE_LIBS Shiboken2::libshiboken PySide2::pyside2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(BINDINGS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bindings")
|
set(BINDINGS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bindings")
|
||||||
@ -491,7 +493,7 @@ if (TARGET Graphviz::GVC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(Cutter PUBLIC ${QT_PREFIX}::Core ${QT_PREFIX}::Widgets ${QT_PREFIX}::Gui PRIVATE ${QT_PREFIX}::Svg ${QT_PREFIX}::Network)
|
target_link_libraries(Cutter PUBLIC ${QT_PREFIX}::Core ${QT_PREFIX}::Widgets ${QT_PREFIX}::Gui PRIVATE ${QT_PREFIX}::Svg ${QT_PREFIX}::Network)
|
||||||
if (CUTTER_QT6)
|
if (CUTTER_QT EQUAL 6)
|
||||||
target_link_libraries(Cutter PUBLIC Qt6::Core5Compat Qt6::SvgWidgets)
|
target_link_libraries(Cutter PUBLIC Qt6::Core5Compat Qt6::SvgWidgets)
|
||||||
target_link_libraries(Cutter PRIVATE Qt6::OpenGLWidgets)
|
target_link_libraries(Cutter PRIVATE Qt6::OpenGLWidgets)
|
||||||
endif()
|
endif()
|
||||||
@ -517,11 +519,7 @@ if(CUTTER_ENABLE_PYTHON)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CUTTER_ENABLE_PYTHON_BINDINGS)
|
if(CUTTER_ENABLE_PYTHON_BINDINGS)
|
||||||
if (CUTTER_QT6)
|
target_link_libraries(Cutter PRIVATE ${CUTTER_PYSIDE_LIBS})
|
||||||
target_link_libraries(Cutter PRIVATE Shiboken6::libshiboken PySide6::pyside6)
|
|
||||||
else()
|
|
||||||
target_link_libraries(Cutter PRIVATE Shiboken2::libshiboken PySide2::pyside2)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
get_target_property(RAW_BINDINGS_INCLUDE_DIRS Cutter INCLUDE_DIRECTORIES)
|
get_target_property(RAW_BINDINGS_INCLUDE_DIRS Cutter INCLUDE_DIRECTORIES)
|
||||||
if(NOT CUTTER_USE_BUNDLED_RIZIN)
|
if(NOT CUTTER_USE_BUNDLED_RIZIN)
|
||||||
@ -544,15 +542,11 @@ if(CUTTER_ENABLE_PYTHON)
|
|||||||
list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtCore")
|
list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtCore")
|
||||||
list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtGui")
|
list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtGui")
|
||||||
list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtWidgets")
|
list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtWidgets")
|
||||||
elseif(CUTTER_QT6)
|
elseif(CUTTER_QT EQUAL 6)
|
||||||
string(APPEND BINDINGS_INCLUDE_DIR_LINES "framework-include-path=${QT6_INSTALL_PREFIX}/${QT6_INSTALL_LIBS}\n")
|
string(APPEND BINDINGS_INCLUDE_DIR_LINES "framework-include-path=${QT6_INSTALL_PREFIX}/${QT6_INSTALL_LIBS}\n")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if (CUTTER_QT6)
|
list(APPEND BINDINGS_INCLUDE_DIRS ${${QT_PREFIX}Core_INCLUDE_DIRS} ${${QT_PREFIX}Widgets_INCLUDE_DIRS} ${${QT_PREFIX}Gui_INCLUDE_DIRS})
|
||||||
list(APPEND BINDINGS_INCLUDE_DIRS ${Qt6Core_INCLUDE_DIRS} ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Gui_INCLUDE_DIRS})
|
|
||||||
else()
|
|
||||||
list(APPEND BINDINGS_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS})
|
|
||||||
endif()
|
|
||||||
list(APPEND BINDINGS_INCLUDE_DIRS ${Rizin_INCLUDE_DIRS})
|
list(APPEND BINDINGS_INCLUDE_DIRS ${Rizin_INCLUDE_DIRS})
|
||||||
list(APPEND BINDINGS_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}")
|
list(APPEND BINDINGS_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
@ -567,8 +561,8 @@ if(CUTTER_ENABLE_PYTHON)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(TARGET KF5::SyntaxHighlighting)
|
if(TARGET KF${CUTTER_QT}::SyntaxHighlighting)
|
||||||
target_link_libraries(Cutter PRIVATE KF5::SyntaxHighlighting)
|
target_link_libraries(Cutter PRIVATE KF${CUTTER_QT}::SyntaxHighlighting)
|
||||||
target_compile_definitions(Cutter PRIVATE CUTTER_ENABLE_KSYNTAXHIGHLIGHTING)
|
target_compile_definitions(Cutter PRIVATE CUTTER_ENABLE_KSYNTAXHIGHLIGHTING)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user