mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-22 04:46:11 +00:00
Remove qmake (#2546)
* Remove qmake project and move some variables directly to CMake project * Remove meson and update docs. * Add instructions for basic macOS build.
This commit is contained in:
parent
4f3a5c1c2e
commit
562979bcff
3
.github/workflows/ccpp.yml
vendored
3
.github/workflows/ccpp.yml
vendored
@ -80,7 +80,8 @@ jobs:
|
|||||||
brew install pkg-config
|
brew install pkg-config
|
||||||
- name: py dependencies
|
- name: py dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install meson
|
# 0.56.1 doesn't work with python 3.5 on Ubuntu 16.04
|
||||||
|
pip install meson==0.56.0
|
||||||
- name: cmake ubuntu
|
- name: cmake ubuntu
|
||||||
if: contains(matrix.os, 'ubuntu')
|
if: contains(matrix.os, 'ubuntu')
|
||||||
run: |
|
run: |
|
||||||
|
@ -32,20 +32,9 @@ if(NOT CUTTER_ENABLE_PYTHON)
|
|||||||
set(CUTTER_ENABLE_PYTHON_BINDINGS OFF)
|
set(CUTTER_ENABLE_PYTHON_BINDINGS OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Parse Cutter.pro to get filenames
|
set(CUTTER_VERSION_MAJOR 1)
|
||||||
include(QMakeProParse)
|
set(CUTTER_VERSION_MINOR 12)
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/Cutter.pro"
|
set(CUTTER_VERSION_PATCH 0)
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/src/Cutter.pro"
|
|
||||||
COPYONLY) # trigger reconfigure if Cutter.pro changes
|
|
||||||
parse_qmake_pro("${CMAKE_CURRENT_BINARY_DIR}/src/Cutter.pro" CUTTER_PRO)
|
|
||||||
# TODO: These variables, exception the versions should be moved to src/CMakeLists.txt after qmake was removed
|
|
||||||
set(SOURCE_FILES ${CUTTER_PRO_SOURCES})
|
|
||||||
set(HEADER_FILES ${CUTTER_PRO_HEADERS})
|
|
||||||
set(UI_FILES ${CUTTER_PRO_FORMS})
|
|
||||||
set(QRC_FILES ${CUTTER_PRO_RESOURCES})
|
|
||||||
set(CUTTER_VERSION_MAJOR "${CUTTER_PRO_CUTTER_VERSION_MAJOR}")
|
|
||||||
set(CUTTER_VERSION_MINOR "${CUTTER_PRO_CUTTER_VERSION_MINOR}")
|
|
||||||
set(CUTTER_VERSION_PATCH "${CUTTER_PRO_CUTTER_VERSION_PATCH}")
|
|
||||||
|
|
||||||
set(CUTTER_VERSION_FULL "${CUTTER_VERSION_MAJOR}.${CUTTER_VERSION_MINOR}.${CUTTER_VERSION_PATCH}")
|
set(CUTTER_VERSION_FULL "${CUTTER_VERSION_MAJOR}.${CUTTER_VERSION_MINOR}.${CUTTER_VERSION_PATCH}")
|
||||||
|
|
||||||
|
46
build.bat
46
build.bat
@ -1,46 +0,0 @@
|
|||||||
@ECHO off
|
|
||||||
SETLOCAL ENABLEDELAYEDEXPANSION
|
|
||||||
SETLOCAL ENABLEEXTENSIONS
|
|
||||||
|
|
||||||
IF "%VisualStudioVersion%" == "14.0" ( IF NOT DEFINED Platform SET "Platform=X86" )
|
|
||||||
FOR /F %%i IN ('powershell -c "\"%Platform%\".toLower()"') DO SET PLATFORM=%%i
|
|
||||||
powershell -c "if ('%PLATFORM%' -notin ('x86', 'x64')) {Exit 1}"
|
|
||||||
IF !ERRORLEVEL! NEQ 0 (
|
|
||||||
ECHO Unknown platform: %PLATFORM%
|
|
||||||
EXIT /B 1
|
|
||||||
)
|
|
||||||
|
|
||||||
SET "RZDIST=rz_dist"
|
|
||||||
SET "BUILDDIR=build_%PLATFORM%"
|
|
||||||
SET "BREAKPAD_SOURCE_DIR=%CD%\src\breakpad\src\src"
|
|
||||||
|
|
||||||
ECHO Preparing directory
|
|
||||||
RMDIR /S /Q %BUILDDIR%
|
|
||||||
MKDIR %BUILDDIR%
|
|
||||||
|
|
||||||
ECHO Prepare translations
|
|
||||||
FOR %%i in (src\translations\*.ts) DO lrelease %%i
|
|
||||||
|
|
||||||
CD %BUILDDIR%
|
|
||||||
|
|
||||||
IF NOT DEFINED CUTTER_ENABLE_CRASH_REPORTS (
|
|
||||||
SET "CUTTER_ENABLE_CRASH_REPORTS=false"
|
|
||||||
)
|
|
||||||
|
|
||||||
ECHO Building cutter
|
|
||||||
qmake BREAKPAD_SOURCE_DIR=%BREAKPAD_SOURCE_DIR% CUTTER_ENABLE_CRASH_REPORTS=%CUTTER_ENABLE_CRASH_REPORTS% %* ..\src\cutter.pro -config release
|
|
||||||
IF !ERRORLEVEL! NEQ 0 EXIT /B 1
|
|
||||||
nmake
|
|
||||||
IF !ERRORLEVEL! NEQ 0 EXIT /B 1
|
|
||||||
|
|
||||||
ECHO Deploying cutter
|
|
||||||
MKDIR cutter
|
|
||||||
COPY release\cutter.exe cutter\cutter.exe
|
|
||||||
XCOPY /S /I ..\%RZDIST%\share cutter\share
|
|
||||||
XCOPY /S /I ..\%RZDIST%\lib cutter\lib
|
|
||||||
DEL cutter\lib\*.lib
|
|
||||||
COPY ..\%RZDIST%\bin\*.dll cutter\
|
|
||||||
windeployqt cutter\cutter.exe
|
|
||||||
FOR %%i in (..\src\translations\*.qm) DO MOVE "%%~fi" cutter\translations
|
|
||||||
|
|
||||||
ENDLOCAL
|
|
@ -1,26 +0,0 @@
|
|||||||
# ------------------------
|
|
||||||
# QMakeConfigureFile.cmake
|
|
||||||
# ------------------------
|
|
||||||
|
|
||||||
function(_prepare_qmake_configure_file INPUT OUTPUT)
|
|
||||||
# copyonly configure once to trigger re-running cmake on changes
|
|
||||||
configure_file("${INPUT}" "${OUTPUT}.qmake.in" COPYONLY)
|
|
||||||
file(READ "${INPUT}" CONTENT)
|
|
||||||
|
|
||||||
# replace \" with "
|
|
||||||
string(REPLACE "\\\"" "\"" CONTENT "${CONTENT}")
|
|
||||||
# replace variables
|
|
||||||
string(REGEX REPLACE "\\\$\\\$([A-Za-z0-9_]+)" "\${\\1}" CONTENT "${CONTENT}")
|
|
||||||
string(REGEX REPLACE "\\\$\\\${([A-Za-z0-9_]+)}" "\${\\1}" CONTENT "${CONTENT}")
|
|
||||||
|
|
||||||
file(WRITE "${OUTPUT}.cmake.in" "${CONTENT}")
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# qmake_configure_file(<INPUT> <OUTPUT>)
|
|
||||||
#
|
|
||||||
# like configure_file, but using qmake syntax
|
|
||||||
#
|
|
||||||
macro(qmake_configure_file INPUT OUTPUT)
|
|
||||||
_prepare_qmake_configure_file("${INPUT}" "${OUTPUT}")
|
|
||||||
configure_file("${OUTPUT}.cmake.in" "${OUTPUT}")
|
|
||||||
endmacro()
|
|
@ -1,49 +0,0 @@
|
|||||||
# -------------------
|
|
||||||
# QMakeProParse.cmake
|
|
||||||
# -------------------
|
|
||||||
#
|
|
||||||
# qmake project parsing utilities
|
|
||||||
#
|
|
||||||
|
|
||||||
# parse_qmake_pro(<PRO_FILE> <PREFIX>)
|
|
||||||
#
|
|
||||||
# parse qmake .pro file PRO_FILE and set cmake variables <PREFIX>_<VAR_NAME>
|
|
||||||
# to content of variable VAR_NAME in the .pro file.
|
|
||||||
#
|
|
||||||
# supported qmake syntax:
|
|
||||||
# - VARIABLE = values
|
|
||||||
# - VARIABLE += values
|
|
||||||
#
|
|
||||||
# not (yet) supported:
|
|
||||||
# - VARIABLE -= values
|
|
||||||
# - scopes
|
|
||||||
#
|
|
||||||
function(parse_qmake_pro PRO_FILE PREFIX)
|
|
||||||
file(READ ${PRO_FILE} PRO_CONTENT)
|
|
||||||
|
|
||||||
# concatenate lines with backslashes
|
|
||||||
string(REGEX REPLACE "\\\\\ *\n" "" PRO_CONTENT "${PRO_CONTENT}")
|
|
||||||
|
|
||||||
# separate lines
|
|
||||||
string(REGEX MATCHALL "[^\n]+(\n|$)" PRO_LINES "${PRO_CONTENT}")
|
|
||||||
|
|
||||||
foreach(LINE IN LISTS PRO_LINES)
|
|
||||||
string(STRIP "${LINE}" LINE)
|
|
||||||
|
|
||||||
# VARIABLE = some values ...
|
|
||||||
string(REGEX MATCH "^([a-zA-Z_]+)\ *=(.*)" VAR_SET "${LINE}")
|
|
||||||
if(CMAKE_MATCH_1)
|
|
||||||
separate_arguments(VALUES UNIX_COMMAND ${CMAKE_MATCH_2})
|
|
||||||
set(${PREFIX}_${CMAKE_MATCH_1} "${VALUES}" PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# VARIABLE += some values ...
|
|
||||||
string(REGEX MATCH "^([a-zA-Z_]+)\ *\\+=(.*)" VAR_SET "${LINE}")
|
|
||||||
if(CMAKE_MATCH_1)
|
|
||||||
separate_arguments(VALUES UNIX_COMMAND ${CMAKE_MATCH_2})
|
|
||||||
set(VAR_NAME ${PREFIX}_${CMAKE_MATCH_1})
|
|
||||||
set(${VAR_NAME} "${${VAR_NAME}}" "${VALUES}" PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endforeach()
|
|
||||||
endfunction()
|
|
@ -87,7 +87,6 @@ If your operating system has a newer version of CMake (> v3.12) you can use this
|
|||||||
cmake -B build -DCUTTER_USE_BUNDLED_RIZIN=ON
|
cmake -B build -DCUTTER_USE_BUNDLED_RIZIN=ON
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
.. note::
|
|
||||||
If you want to use Cutter with another version of Rizin you can omit ``-DCUTTER_USE_BUNDLED_RIZIN=ON``. Note that using a version of Rizin which isn't the version Cutter is using can cause issues and the compilation might fail.
|
If you want to use Cutter with another version of Rizin you can omit ``-DCUTTER_USE_BUNDLED_RIZIN=ON``. Note that using a version of Rizin which isn't the version Cutter is using can cause issues and the compilation might fail.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
@ -140,92 +139,35 @@ After the configuration is done, click ``Generate`` and you can open
|
|||||||
``Cutter.sln`` to compile the code as usual.
|
``Cutter.sln`` to compile the code as usual.
|
||||||
|
|
||||||
|
|
||||||
Building with Meson
|
Building on macOS
|
||||||
~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
There is another way to compile Cutter on Windows if the one above does
|
|
||||||
not work or does not suit your needs.
|
|
||||||
|
|
||||||
Additional requirements:
|
|
||||||
|
|
||||||
- Ninja build system
|
|
||||||
- Meson build system
|
|
||||||
|
|
||||||
Download and unpack
|
|
||||||
`Ninja <https://github.com/ninja-build/ninja/releases>`__ to the Cutter
|
|
||||||
source root directory (ie. **cutter** - working dir).
|
|
||||||
|
|
||||||
Note that in the below steps, the paths may vary depending on your version of Qt and Visual Studio.
|
|
||||||
|
|
||||||
Environment settings (example for x64 version):
|
|
||||||
|
|
||||||
.. code:: batch
|
|
||||||
|
|
||||||
:: Export MSVC variables
|
|
||||||
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
|
|
||||||
:: Add qmake to PATH
|
|
||||||
SET "PATH=C:\Qt\5.10.1\msvc2015_64\bin;%PATH%"
|
|
||||||
:: Add Python to PATH
|
|
||||||
SET "PATH=C:\Program Files\Python36;%PATH%"
|
|
||||||
|
|
||||||
Install Meson:
|
|
||||||
|
|
||||||
.. code:: batch
|
|
||||||
|
|
||||||
python -m pip install meson
|
|
||||||
|
|
||||||
To compile Cutter, run:
|
|
||||||
|
|
||||||
.. code:: batch
|
|
||||||
|
|
||||||
CALL prepare_rizin.bat
|
|
||||||
CALL build.bat
|
|
||||||
|
|
||||||
|
|
||||||
--------------
|
|
||||||
|
|
||||||
Building with Qmake
|
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
Using QtCreator
|
Requirements
|
||||||
~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
One standard way is to simply load the project inside QtCreator.
|
* XCode
|
||||||
To do so, open QtCreator and on the welcome screen click on "Open Project",
|
* CMake
|
||||||
and finally select the ``cutter/src/Cutter.pro`` file.
|
* Qt
|
||||||
QtCreator will then allow you to directly edit the source code and build the project.
|
* meson
|
||||||
|
* ninja
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
On **Windows**, for the ``.pro`` file to be compiled successfully, it is required
|
For basic build all dependencies except XCode can be installed using homebrew:
|
||||||
to run ``prepare_rizin.bat`` beforehand.
|
|
||||||
|
|
||||||
Compiling on Linux / macOS
|
::
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
The easiest way, but not the one we recommend, is to simply run ``./build.sh`` from the root directory,
|
brew install cmake qt5 meson ninja
|
||||||
and let the magic happen. The script will use ``qmake`` to build Cutter.
|
|
||||||
The ``build.sh`` script is meant to be deprecated and will be deleted in the future.
|
|
||||||
|
|
||||||
If you want to manually use qmake, follow these steps:
|
|
||||||
|
|
||||||
.. code:: sh
|
Recommended Way for dev builds
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
mkdir build; cd build
|
.. code:: batch
|
||||||
qmake ../src/Cutter.pro
|
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. -DCUTTER_USE_BUNDLED_RIZIN=ON -DCMAKE_PREFIX_PATH=/local/opt/qt5
|
||||||
make
|
make
|
||||||
cd ..
|
|
||||||
|
|
||||||
Additional Steps for macOS
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
On macOS you will also have to copy the launcher bash script:
|
|
||||||
|
|
||||||
.. code:: sh
|
|
||||||
|
|
||||||
mv Cutter.app/Contents/MacOS/Cutter Cutter.app/Contents/MacOS/Cutter.bin
|
|
||||||
cp ../src/macos/Cutter Cutter.app/Contents/MacOS/Cutter && chmod +x Cutter.app/Contents/MacOS/Cutter
|
|
||||||
|
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
@ -344,9 +286,7 @@ encounter any problems.
|
|||||||
|
|
||||||
You can also try:
|
You can also try:
|
||||||
|
|
||||||
- ``PKG_CONFIG_PATH=$HOME/bin/prefix/rizin/lib/pkgconfig qmake``
|
- ``PKG_CONFIG_PATH=$HOME/bin/prefix/rizin/lib/pkgconfig cmake ...``
|
||||||
- ``PKG_CONFIG_PATH=$HOME/cutter/rizin/pkgcfg qmake`` (for a newer
|
|
||||||
version and if the rizin submodule is being built and used)
|
|
||||||
|
|
||||||
.. image:: images/cutter_path_settings.png
|
.. image:: images/cutter_path_settings.png
|
||||||
|
|
||||||
|
@ -32,9 +32,6 @@ Qt Creator
|
|||||||
----------
|
----------
|
||||||
QT Creator is an open-source IDE made by the same developers as Qt.
|
QT Creator is an open-source IDE made by the same developers as Qt.
|
||||||
|
|
||||||
Even though Cutter has qmake project cutter.pro it is recommended to use the CMake project in QTCreator.
|
|
||||||
QTCreator support for CMake is as good as qmake one but not all Cutter project configuration options are available in qmake project and in future Cutter qmake project might be removed.
|
|
||||||
|
|
||||||
Pros and Cons
|
Pros and Cons
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -48,7 +45,7 @@ Project setup
|
|||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
The following instructions were made based on version 4.12.4 of Qt Creator. The steps might slightly differ between the versions.
|
The following instructions were made based on version 4.12.4 of Qt Creator. The steps might slightly differ between the versions.
|
||||||
|
|
||||||
- Go to :menuselection:`File --> Open File or Project..` and select :file:`cutter/src/CMakeList.txt`
|
- Go to :menuselection:`File --> Open File or Project..` and select :file:`cutter/CMakeList.txt`
|
||||||
- Select kit and press :guilabel:`Configure Project`
|
- Select kit and press :guilabel:`Configure Project`
|
||||||
- Configuration step might fail due to Rizin not being found, that's normal
|
- Configuration step might fail due to Rizin not being found, that's normal
|
||||||
- Click :guilabel:`Projects` button with wrench icon on the left side of the screen
|
- Click :guilabel:`Projects` button with wrench icon on the left side of the screen
|
||||||
@ -141,7 +138,7 @@ Project setup
|
|||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
- Go to :menuselection:`File --> Open` and select the folder in which you cloned Cutter
|
- Go to :menuselection:`File --> Open` and select the folder in which you cloned Cutter
|
||||||
- Go to :menuselection:`File --> Settings --> Build, Execution, Deployment --> CMake`. In the :guilabel:`CMake Options` field enter ``-DCUTTER_USE_BUNDLED_RIZIN=ON``
|
- Go to :menuselection:`File --> Settings --> Build, Execution, Deployment --> CMake`. In the :guilabel:`CMake Options` field enter ``-DCUTTER_USE_BUNDLED_RIZIN=ON``
|
||||||
- Open :file:`cutter/src/CMakeLists.txt` using the project file list on the left side of the screen
|
- Open :file:`cutter/CMakeLists.txt` using the project file list on the left side of the screen
|
||||||
- A yellow bar with a message :guilabel:`CMake project is not loaded` should appear, click :guilabel:`Load CMake project`
|
- A yellow bar with a message :guilabel:`CMake project is not loaded` should appear, click :guilabel:`Load CMake project`
|
||||||
|
|
||||||
Changing CMake configuration
|
Changing CMake configuration
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Release Procedure
|
Release Procedure
|
||||||
=================
|
=================
|
||||||
|
|
||||||
1. Update translations submodule `https://github.com/rizinorg/cutter-translations`_
|
1. Update translations submodule `<https://github.com/rizinorg/cutter-translations>`_
|
||||||
1. The latest archive from Crowdin should already be in the repository, if not make sure to merge any automated Pull Request from Crowdin (e.g. https://github.com/rizinorg/cutter-translations/pull/9)
|
1. The latest archive from Crowdin should already be in the repository, if not make sure to merge any automated Pull Request from Crowdin (e.g. https://github.com/rizinorg/cutter-translations/pull/9)
|
||||||
2. Update submodule in cutter
|
2. Update submodule in cutter
|
||||||
2. If there is a desire to keep working in the master branch, create branch for the release and do all the following work there.
|
2. If there is a desire to keep working in the master branch, create branch for the release and do all the following work there.
|
||||||
@ -10,7 +10,7 @@ Release Procedure
|
|||||||
#. appveyor.yml
|
#. appveyor.yml
|
||||||
#. docs/sourc/conf.py
|
#. docs/sourc/conf.py
|
||||||
#. docs/source/index.rst
|
#. docs/source/index.rst
|
||||||
#. Cutter.pro
|
#. CMakeLists.txt
|
||||||
#. Cutter.appdata.xml
|
#. Cutter.appdata.xml
|
||||||
#. To be safe, search the code base for the previous version number.
|
#. To be safe, search the code base for the previous version number.
|
||||||
5. Create a tag for the release candidate. For example, for the `v1.11.0` release you'd do something like this:
|
5. Create a tag for the release candidate. For example, for the `v1.11.0` release you'd do something like this:
|
||||||
|
@ -18,7 +18,7 @@ git pull origin master
|
|||||||
|
|
||||||
# Generate Crowdin single translation file from cutter_fr.ts
|
# Generate Crowdin single translation file from cutter_fr.ts
|
||||||
log "Generating single translation file"
|
log "Generating single translation file"
|
||||||
lupdate ../Cutter.pro
|
find . -iname "*.ts" | xargs lupdate .. -ts
|
||||||
cp ./fr/cutter_fr_FR.ts ./Translations.ts
|
cp ./fr/cutter_fr_FR.ts ./Translations.ts
|
||||||
|
|
||||||
# Push it so Crowdin can find new strings, and later push updated translations
|
# Push it so Crowdin can find new strings, and later push updated translations
|
||||||
|
@ -3,13 +3,13 @@ import os
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
scripts_path = os.path.dirname(os.path.realpath(__file__))
|
scripts_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
pro_file_path = os.path.join(scripts_path, "..", "src", "Cutter.pro")
|
pro_file_path = os.path.join(scripts_path, "..", "CMakeLists.txt")
|
||||||
|
|
||||||
with open(pro_file_path, "r") as f:
|
with open(pro_file_path, "r") as f:
|
||||||
pro_content = f.read()
|
pro_content = f.read()
|
||||||
|
|
||||||
def version_var_re(name):
|
def version_var_re(name):
|
||||||
return "^[ \t]*{}[ \t]*=[ \t]*(\d+)[ \t]*$".format(name)
|
return "^set\({}[ \t]*(\d+)\)$".format(name)
|
||||||
|
|
||||||
m = re.search(version_var_re("CUTTER_VERSION_MAJOR"), pro_content, flags=re.MULTILINE)
|
m = re.search(version_var_re("CUTTER_VERSION_MAJOR"), pro_content, flags=re.MULTILINE)
|
||||||
version_major = int(m.group(1)) if m is not None else 0
|
version_major = int(m.group(1)) if m is not None else 0
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
import json
|
|
||||||
|
|
||||||
in_filename = sys.argv[1]
|
|
||||||
out_filename = sys.argv[2]
|
|
||||||
vars = json.loads(sys.argv[3])
|
|
||||||
|
|
||||||
with open(in_filename, "r") as f:
|
|
||||||
content = f.read()
|
|
||||||
|
|
||||||
content = content.replace("\\\"", "\"")
|
|
||||||
|
|
||||||
varname_pattern = re.compile("[A-Za-z0-9_]+")
|
|
||||||
for name, value in vars.items():
|
|
||||||
if varname_pattern.fullmatch(name) is None:
|
|
||||||
print("Name \"{}\" is not a valid variable name.".format(name))
|
|
||||||
continue
|
|
||||||
|
|
||||||
pattern = "\\$\\$({}|\\{{{}\\}})".format(name, name)
|
|
||||||
print(pattern)
|
|
||||||
content = re.sub(pattern, str(value), content)
|
|
||||||
|
|
||||||
with open(out_filename, "w") as f:
|
|
||||||
f.write(content)
|
|
@ -1,30 +0,0 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
name = sys.argv[1]
|
|
||||||
value = []
|
|
||||||
root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
|
||||||
with open(os.path.join(root, 'src', 'Cutter.pro')) as f:
|
|
||||||
text = f.read()
|
|
||||||
text = text.replace('\\\n', '')
|
|
||||||
nbraces = 0
|
|
||||||
for line in text.split('\n'):
|
|
||||||
line = line.strip()
|
|
||||||
if not line or all(char in line for char in ('{', '}')):
|
|
||||||
continue
|
|
||||||
if line.startswith('}'):
|
|
||||||
nbraces -= 1
|
|
||||||
continue
|
|
||||||
if line.endswith('{'):
|
|
||||||
nbraces += 1
|
|
||||||
continue
|
|
||||||
if nbraces > 0 or '=' not in line:
|
|
||||||
continue
|
|
||||||
words = line.split()
|
|
||||||
if words[0] == name and '=' in words[1]:
|
|
||||||
value.extend(words[2:])
|
|
||||||
if name == 'QT':
|
|
||||||
value = [str.title(s) for s in value]
|
|
||||||
if not value:
|
|
||||||
sys.exit(1)
|
|
||||||
print(';'.join(value), end='')
|
|
@ -1,7 +1,381 @@
|
|||||||
include(QMakeConfigureFile)
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/CutterConfig.h.in"
|
||||||
qmake_configure_file("${CMAKE_CURRENT_SOURCE_DIR}/CutterConfig.h.in"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/CutterConfig.h")
|
"${CMAKE_CURRENT_BINARY_DIR}/CutterConfig.h")
|
||||||
|
|
||||||
|
set(SOURCES
|
||||||
|
Main.cpp
|
||||||
|
core/Cutter.cpp
|
||||||
|
dialogs/EditStringDialog.cpp
|
||||||
|
dialogs/WriteCommandsDialogs.cpp
|
||||||
|
widgets/DisassemblerGraphView.cpp
|
||||||
|
widgets/OverviewView.cpp
|
||||||
|
common/RichTextPainter.cpp
|
||||||
|
dialogs/InitialOptionsDialog.cpp
|
||||||
|
dialogs/AboutDialog.cpp
|
||||||
|
dialogs/CommentsDialog.cpp
|
||||||
|
dialogs/EditInstructionDialog.cpp
|
||||||
|
dialogs/FlagDialog.cpp
|
||||||
|
dialogs/RemoteDebugDialog.cpp
|
||||||
|
dialogs/NativeDebugDialog.cpp
|
||||||
|
dialogs/XrefsDialog.cpp
|
||||||
|
core/MainWindow.cpp
|
||||||
|
common/Helpers.cpp
|
||||||
|
common/Highlighter.cpp
|
||||||
|
common/MdHighlighter.cpp
|
||||||
|
common/DirectionalComboBox.cpp
|
||||||
|
dialogs/preferences/AsmOptionsWidget.cpp
|
||||||
|
dialogs/NewFileDialog.cpp
|
||||||
|
common/AnalTask.cpp
|
||||||
|
widgets/CommentsWidget.cpp
|
||||||
|
widgets/ConsoleWidget.cpp
|
||||||
|
widgets/Dashboard.cpp
|
||||||
|
widgets/EntrypointWidget.cpp
|
||||||
|
widgets/ExportsWidget.cpp
|
||||||
|
widgets/FlagsWidget.cpp
|
||||||
|
widgets/FunctionsWidget.cpp
|
||||||
|
widgets/ImportsWidget.cpp
|
||||||
|
widgets/Omnibar.cpp
|
||||||
|
widgets/RelocsWidget.cpp
|
||||||
|
widgets/SectionsWidget.cpp
|
||||||
|
widgets/SegmentsWidget.cpp
|
||||||
|
widgets/StringsWidget.cpp
|
||||||
|
widgets/SymbolsWidget.cpp
|
||||||
|
menus/DisassemblyContextMenu.cpp
|
||||||
|
menus/DecompilerContextMenu.cpp
|
||||||
|
widgets/DisassemblyWidget.cpp
|
||||||
|
widgets/HexdumpWidget.cpp
|
||||||
|
common/Configuration.cpp
|
||||||
|
common/Colors.cpp
|
||||||
|
common/TempConfig.cpp
|
||||||
|
common/SvgIconEngine.cpp
|
||||||
|
common/SyntaxHighlighter.cpp
|
||||||
|
widgets/DecompilerWidget.cpp
|
||||||
|
widgets/VisualNavbar.cpp
|
||||||
|
widgets/GraphView.cpp
|
||||||
|
dialogs/preferences/PreferencesDialog.cpp
|
||||||
|
dialogs/preferences/AppearanceOptionsWidget.cpp
|
||||||
|
dialogs/preferences/GraphOptionsWidget.cpp
|
||||||
|
dialogs/preferences/PreferenceCategory.cpp
|
||||||
|
dialogs/preferences/InitializationFileEditor.cpp
|
||||||
|
widgets/QuickFilterView.cpp
|
||||||
|
widgets/ClassesWidget.cpp
|
||||||
|
widgets/ResourcesWidget.cpp
|
||||||
|
widgets/VTablesWidget.cpp
|
||||||
|
widgets/TypesWidget.cpp
|
||||||
|
widgets/HeadersWidget.cpp
|
||||||
|
widgets/SearchWidget.cpp
|
||||||
|
CutterApplication.cpp
|
||||||
|
common/PythonAPI.cpp
|
||||||
|
dialogs/RizinPluginsDialog.cpp
|
||||||
|
widgets/CutterDockWidget.cpp
|
||||||
|
widgets/CutterTreeWidget.cpp
|
||||||
|
widgets/GraphWidget.cpp
|
||||||
|
widgets/OverviewWidget.cpp
|
||||||
|
common/JsonTreeItem.cpp
|
||||||
|
common/JsonModel.cpp
|
||||||
|
dialogs/VersionInfoDialog.cpp
|
||||||
|
widgets/ZignaturesWidget.cpp
|
||||||
|
common/AsyncTask.cpp
|
||||||
|
dialogs/AsyncTaskDialog.cpp
|
||||||
|
widgets/StackWidget.cpp
|
||||||
|
widgets/RegistersWidget.cpp
|
||||||
|
widgets/ThreadsWidget.cpp
|
||||||
|
widgets/ProcessesWidget.cpp
|
||||||
|
widgets/BacktraceWidget.cpp
|
||||||
|
dialogs/MapFileDialog.cpp
|
||||||
|
common/CommandTask.cpp
|
||||||
|
common/ProgressIndicator.cpp
|
||||||
|
common/RizinTask.cpp
|
||||||
|
dialogs/RizinTaskDialog.cpp
|
||||||
|
widgets/DebugActions.cpp
|
||||||
|
widgets/MemoryMapWidget.cpp
|
||||||
|
dialogs/preferences/DebugOptionsWidget.cpp
|
||||||
|
dialogs/preferences/PluginsOptionsWidget.cpp
|
||||||
|
widgets/BreakpointWidget.cpp
|
||||||
|
dialogs/BreakpointsDialog.cpp
|
||||||
|
dialogs/AttachProcDialog.cpp
|
||||||
|
widgets/RegisterRefsWidget.cpp
|
||||||
|
dialogs/SetToDataDialog.cpp
|
||||||
|
dialogs/EditVariablesDialog.cpp
|
||||||
|
dialogs/EditFunctionDialog.cpp
|
||||||
|
widgets/CutterTreeView.cpp
|
||||||
|
widgets/ComboQuickFilterView.cpp
|
||||||
|
dialogs/HexdumpRangeDialog.cpp
|
||||||
|
common/QtResImporter.cpp
|
||||||
|
common/CutterSeekable.cpp
|
||||||
|
common/RefreshDeferrer.cpp
|
||||||
|
dialogs/WelcomeDialog.cpp
|
||||||
|
common/RunScriptTask.cpp
|
||||||
|
dialogs/EditMethodDialog.cpp
|
||||||
|
dialogs/TypesInteractionDialog.cpp
|
||||||
|
widgets/SdbWidget.cpp
|
||||||
|
common/PythonManager.cpp
|
||||||
|
plugins/PluginManager.cpp
|
||||||
|
common/BasicBlockHighlighter.cpp
|
||||||
|
common/BasicInstructionHighlighter.cpp
|
||||||
|
dialogs/LinkTypeDialog.cpp
|
||||||
|
widgets/ColorPicker.cpp
|
||||||
|
common/ColorThemeWorker.cpp
|
||||||
|
widgets/ColorThemeComboBox.cpp
|
||||||
|
widgets/ColorThemeListView.cpp
|
||||||
|
dialogs/preferences/ColorThemeEditDialog.cpp
|
||||||
|
common/UpdateWorker.cpp
|
||||||
|
widgets/MemoryDockWidget.cpp
|
||||||
|
common/CrashHandler.cpp
|
||||||
|
common/BugReporting.cpp
|
||||||
|
common/HighDpiPixmap.cpp
|
||||||
|
widgets/GraphGridLayout.cpp
|
||||||
|
widgets/HexWidget.cpp
|
||||||
|
common/SelectionHighlight.cpp
|
||||||
|
common/Decompiler.cpp
|
||||||
|
menus/AddressableItemContextMenu.cpp
|
||||||
|
common/AddressableItemModel.cpp
|
||||||
|
widgets/ListDockWidget.cpp
|
||||||
|
dialogs/MultitypeFileSaveDialog.cpp
|
||||||
|
widgets/BoolToggleDelegate.cpp
|
||||||
|
common/IOModesController.cpp
|
||||||
|
common/SettingsUpgrade.cpp
|
||||||
|
dialogs/LayoutManager.cpp
|
||||||
|
common/CutterLayout.cpp
|
||||||
|
widgets/GraphHorizontalAdapter.cpp
|
||||||
|
common/ResourcePaths.cpp
|
||||||
|
widgets/CutterGraphView.cpp
|
||||||
|
widgets/SimpleTextGraphView.cpp
|
||||||
|
widgets/RizinGraphWidget.cpp
|
||||||
|
widgets/CallGraph.cpp
|
||||||
|
widgets/AddressableDockWidget.cpp
|
||||||
|
dialogs/preferences/AnalOptionsWidget.cpp
|
||||||
|
common/DecompilerHighlighter.cpp
|
||||||
|
)
|
||||||
|
set(HEADER_FILES
|
||||||
|
core/Cutter.h
|
||||||
|
core/CutterCommon.h
|
||||||
|
core/CutterDescriptions.h
|
||||||
|
dialogs/EditStringDialog.h
|
||||||
|
dialogs/WriteCommandsDialogs.h
|
||||||
|
widgets/DisassemblerGraphView.h
|
||||||
|
widgets/OverviewView.h
|
||||||
|
common/RichTextPainter.h
|
||||||
|
common/CachedFontMetrics.h
|
||||||
|
dialogs/AboutDialog.h
|
||||||
|
dialogs/preferences/AsmOptionsWidget.h
|
||||||
|
dialogs/CommentsDialog.h
|
||||||
|
dialogs/EditInstructionDialog.h
|
||||||
|
dialogs/FlagDialog.h
|
||||||
|
dialogs/RemoteDebugDialog.h
|
||||||
|
dialogs/NativeDebugDialog.h
|
||||||
|
dialogs/XrefsDialog.h
|
||||||
|
common/Helpers.h
|
||||||
|
core/MainWindow.h
|
||||||
|
common/Highlighter.h
|
||||||
|
common/MdHighlighter.h
|
||||||
|
common/DirectionalComboBox.h
|
||||||
|
dialogs/InitialOptionsDialog.h
|
||||||
|
dialogs/NewFileDialog.h
|
||||||
|
common/AnalTask.h
|
||||||
|
widgets/CommentsWidget.h
|
||||||
|
widgets/ConsoleWidget.h
|
||||||
|
widgets/Dashboard.h
|
||||||
|
widgets/EntrypointWidget.h
|
||||||
|
widgets/ExportsWidget.h
|
||||||
|
widgets/FlagsWidget.h
|
||||||
|
widgets/FunctionsWidget.h
|
||||||
|
widgets/ImportsWidget.h
|
||||||
|
widgets/Omnibar.h
|
||||||
|
widgets/RelocsWidget.h
|
||||||
|
widgets/SectionsWidget.h
|
||||||
|
widgets/SegmentsWidget.h
|
||||||
|
widgets/StringsWidget.h
|
||||||
|
widgets/SymbolsWidget.h
|
||||||
|
menus/DisassemblyContextMenu.h
|
||||||
|
menus/DecompilerContextMenu.h
|
||||||
|
widgets/DisassemblyWidget.h
|
||||||
|
widgets/HexdumpWidget.h
|
||||||
|
common/Configuration.h
|
||||||
|
common/Colors.h
|
||||||
|
common/TempConfig.h
|
||||||
|
common/SvgIconEngine.h
|
||||||
|
common/SyntaxHighlighter.h
|
||||||
|
widgets/DecompilerWidget.h
|
||||||
|
widgets/VisualNavbar.h
|
||||||
|
widgets/GraphView.h
|
||||||
|
dialogs/preferences/PreferencesDialog.h
|
||||||
|
dialogs/preferences/AppearanceOptionsWidget.h
|
||||||
|
dialogs/preferences/PreferenceCategory.h
|
||||||
|
dialogs/preferences/GraphOptionsWidget.h
|
||||||
|
dialogs/preferences/InitializationFileEditor.h
|
||||||
|
widgets/QuickFilterView.h
|
||||||
|
widgets/ClassesWidget.h
|
||||||
|
widgets/ResourcesWidget.h
|
||||||
|
CutterApplication.h
|
||||||
|
widgets/VTablesWidget.h
|
||||||
|
widgets/TypesWidget.h
|
||||||
|
widgets/HeadersWidget.h
|
||||||
|
widgets/SearchWidget.h
|
||||||
|
common/PythonAPI.h
|
||||||
|
dialogs/RizinPluginsDialog.h
|
||||||
|
widgets/CutterDockWidget.h
|
||||||
|
widgets/CutterTreeWidget.h
|
||||||
|
widgets/GraphWidget.h
|
||||||
|
widgets/OverviewWidget.h
|
||||||
|
common/JsonTreeItem.h
|
||||||
|
common/JsonModel.h
|
||||||
|
dialogs/VersionInfoDialog.h
|
||||||
|
widgets/ZignaturesWidget.h
|
||||||
|
common/AsyncTask.h
|
||||||
|
dialogs/AsyncTaskDialog.h
|
||||||
|
widgets/StackWidget.h
|
||||||
|
widgets/RegistersWidget.h
|
||||||
|
widgets/ThreadsWidget.h
|
||||||
|
widgets/ProcessesWidget.h
|
||||||
|
widgets/BacktraceWidget.h
|
||||||
|
dialogs/MapFileDialog.h
|
||||||
|
common/StringsTask.h
|
||||||
|
common/FunctionsTask.h
|
||||||
|
common/CommandTask.h
|
||||||
|
common/ProgressIndicator.h
|
||||||
|
plugins/CutterPlugin.h
|
||||||
|
common/RizinTask.h
|
||||||
|
dialogs/RizinTaskDialog.h
|
||||||
|
widgets/DebugActions.h
|
||||||
|
widgets/MemoryMapWidget.h
|
||||||
|
dialogs/preferences/DebugOptionsWidget.h
|
||||||
|
dialogs/preferences/PluginsOptionsWidget.h
|
||||||
|
widgets/BreakpointWidget.h
|
||||||
|
dialogs/BreakpointsDialog.h
|
||||||
|
dialogs/AttachProcDialog.h
|
||||||
|
widgets/RegisterRefsWidget.h
|
||||||
|
dialogs/SetToDataDialog.h
|
||||||
|
common/InitialOptions.h
|
||||||
|
dialogs/EditVariablesDialog.h
|
||||||
|
dialogs/EditFunctionDialog.h
|
||||||
|
widgets/CutterTreeView.h
|
||||||
|
widgets/ComboQuickFilterView.h
|
||||||
|
dialogs/HexdumpRangeDialog.h
|
||||||
|
common/QtResImporter.h
|
||||||
|
common/CutterSeekable.h
|
||||||
|
common/RefreshDeferrer.h
|
||||||
|
dialogs/WelcomeDialog.h
|
||||||
|
common/RunScriptTask.h
|
||||||
|
common/Json.h
|
||||||
|
dialogs/EditMethodDialog.h
|
||||||
|
common/CrashHandler.h
|
||||||
|
dialogs/TypesInteractionDialog.h
|
||||||
|
widgets/SdbWidget.h
|
||||||
|
common/PythonManager.h
|
||||||
|
plugins/PluginManager.h
|
||||||
|
common/BasicBlockHighlighter.h
|
||||||
|
common/BasicInstructionHighlighter.h
|
||||||
|
common/UpdateWorker.h
|
||||||
|
widgets/ColorPicker.h
|
||||||
|
common/ColorThemeWorker.h
|
||||||
|
widgets/ColorThemeComboBox.h
|
||||||
|
widgets/MemoryDockWidget.h
|
||||||
|
widgets/ColorThemeListView.h
|
||||||
|
dialogs/preferences/ColorThemeEditDialog.h
|
||||||
|
dialogs/LinkTypeDialog.h
|
||||||
|
common/BugReporting.h
|
||||||
|
common/HighDpiPixmap.h
|
||||||
|
widgets/GraphLayout.h
|
||||||
|
widgets/GraphGridLayout.h
|
||||||
|
widgets/HexWidget.h
|
||||||
|
common/SelectionHighlight.h
|
||||||
|
common/Decompiler.h
|
||||||
|
menus/AddressableItemContextMenu.h
|
||||||
|
common/AddressableItemModel.h
|
||||||
|
widgets/ListDockWidget.h
|
||||||
|
widgets/AddressableItemList.h
|
||||||
|
dialogs/MultitypeFileSaveDialog.h
|
||||||
|
widgets/BoolToggleDelegate.h
|
||||||
|
common/IOModesController.h
|
||||||
|
common/SettingsUpgrade.h
|
||||||
|
dialogs/LayoutManager.h
|
||||||
|
common/CutterLayout.h
|
||||||
|
common/BinaryTrees.h
|
||||||
|
common/LinkedListPool.h
|
||||||
|
widgets/GraphHorizontalAdapter.h
|
||||||
|
common/ResourcePaths.h
|
||||||
|
widgets/CutterGraphView.h
|
||||||
|
widgets/SimpleTextGraphView.h
|
||||||
|
widgets/RizinGraphWidget.h
|
||||||
|
widgets/CallGraph.h
|
||||||
|
widgets/AddressableDockWidget.h
|
||||||
|
dialogs/preferences/AnalOptionsWidget.h
|
||||||
|
common/DecompilerHighlighter.h
|
||||||
|
)
|
||||||
|
set(UI_FILES
|
||||||
|
dialogs/AboutDialog.ui
|
||||||
|
dialogs/EditStringDialog.ui
|
||||||
|
dialogs/Base64EnDecodedWriteDialog.ui
|
||||||
|
dialogs/DuplicateFromOffsetDialog.ui
|
||||||
|
dialogs/IncrementDecrementDialog.ui
|
||||||
|
dialogs/preferences/AsmOptionsWidget.ui
|
||||||
|
dialogs/CommentsDialog.ui
|
||||||
|
dialogs/EditInstructionDialog.ui
|
||||||
|
dialogs/FlagDialog.ui
|
||||||
|
dialogs/RemoteDebugDialog.ui
|
||||||
|
dialogs/NativeDebugDialog.ui
|
||||||
|
dialogs/XrefsDialog.ui
|
||||||
|
dialogs/NewFileDialog.ui
|
||||||
|
dialogs/InitialOptionsDialog.ui
|
||||||
|
dialogs/EditFunctionDialog.ui
|
||||||
|
core/MainWindow.ui
|
||||||
|
widgets/ConsoleWidget.ui
|
||||||
|
widgets/Dashboard.ui
|
||||||
|
widgets/EntrypointWidget.ui
|
||||||
|
widgets/FlagsWidget.ui
|
||||||
|
widgets/StringsWidget.ui
|
||||||
|
widgets/HexdumpWidget.ui
|
||||||
|
dialogs/preferences/PreferencesDialog.ui
|
||||||
|
dialogs/preferences/AppearanceOptionsWidget.ui
|
||||||
|
dialogs/preferences/GraphOptionsWidget.ui
|
||||||
|
dialogs/preferences/InitializationFileEditor.ui
|
||||||
|
widgets/QuickFilterView.ui
|
||||||
|
widgets/DecompilerWidget.ui
|
||||||
|
widgets/ClassesWidget.ui
|
||||||
|
widgets/VTablesWidget.ui
|
||||||
|
widgets/TypesWidget.ui
|
||||||
|
widgets/SearchWidget.ui
|
||||||
|
dialogs/RizinPluginsDialog.ui
|
||||||
|
dialogs/VersionInfoDialog.ui
|
||||||
|
widgets/ZignaturesWidget.ui
|
||||||
|
dialogs/AsyncTaskDialog.ui
|
||||||
|
dialogs/RizinTaskDialog.ui
|
||||||
|
widgets/StackWidget.ui
|
||||||
|
widgets/RegistersWidget.ui
|
||||||
|
widgets/ThreadsWidget.ui
|
||||||
|
widgets/ProcessesWidget.ui
|
||||||
|
widgets/BacktraceWidget.ui
|
||||||
|
dialogs/MapFileDialog.ui
|
||||||
|
dialogs/preferences/DebugOptionsWidget.ui
|
||||||
|
widgets/BreakpointWidget.ui
|
||||||
|
dialogs/BreakpointsDialog.ui
|
||||||
|
dialogs/AttachProcDialog.ui
|
||||||
|
widgets/RegisterRefsWidget.ui
|
||||||
|
dialogs/SetToDataDialog.ui
|
||||||
|
dialogs/EditVariablesDialog.ui
|
||||||
|
widgets/CutterTreeView.ui
|
||||||
|
widgets/ComboQuickFilterView.ui
|
||||||
|
dialogs/HexdumpRangeDialog.ui
|
||||||
|
dialogs/WelcomeDialog.ui
|
||||||
|
dialogs/EditMethodDialog.ui
|
||||||
|
dialogs/TypesInteractionDialog.ui
|
||||||
|
widgets/SdbWidget.ui
|
||||||
|
dialogs/LinkTypeDialog.ui
|
||||||
|
widgets/ColorPicker.ui
|
||||||
|
dialogs/preferences/ColorThemeEditDialog.ui
|
||||||
|
widgets/ListDockWidget.ui
|
||||||
|
dialogs/LayoutManager.ui
|
||||||
|
widgets/RizinGraphWidget.ui
|
||||||
|
dialogs/preferences/AnalOptionsWidget.ui
|
||||||
|
)
|
||||||
|
set(QRC_FILES
|
||||||
|
resources.qrc
|
||||||
|
themes/native/native.qrc
|
||||||
|
themes/qdarkstyle/dark.qrc
|
||||||
|
themes/midnight/midnight.qrc
|
||||||
|
themes/lightstyle/light.qrc
|
||||||
|
)
|
||||||
|
|
||||||
if(CUTTER_ENABLE_PYTHON_BINDINGS)
|
if(CUTTER_ENABLE_PYTHON_BINDINGS)
|
||||||
set(BINDINGS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bindings")
|
set(BINDINGS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bindings")
|
||||||
set(BINDINGS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/bindings")
|
set(BINDINGS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/bindings")
|
||||||
@ -30,8 +404,8 @@ endif()
|
|||||||
|
|
||||||
|
|
||||||
if (TARGET Graphviz::GVC)
|
if (TARGET Graphviz::GVC)
|
||||||
list(APPEND SOURCE_FILES ${CUTTER_PRO_GRAPHVIZ_SOURCES})
|
list(APPEND SOURCES widgets/GraphvizLayout.cpp)
|
||||||
list(APPEND HEADER_FILES ${CUTTER_PRO_GRAPHVIZ_HEADERS})
|
list(APPEND HEADER_FILES widgets/GraphvizLayout.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
@ -47,7 +421,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_executable(Cutter ${UI_FILES} ${QRC_FILES} ${PLATFORM_RESOURCES} ${SOURCE_FILES} ${HEADER_FILES} ${BINDINGS_SOURCE})
|
add_executable(Cutter ${UI_FILES} ${QRC_FILES} ${PLATFORM_RESOURCES} ${SOURCES} ${HEADER_FILES} ${BINDINGS_SOURCE})
|
||||||
set_target_properties(Cutter PROPERTIES
|
set_target_properties(Cutter PROPERTIES
|
||||||
RUNTIME_OUTPUT_DIRECTORY ..
|
RUNTIME_OUTPUT_DIRECTORY ..
|
||||||
PDB_OUTPUT_DIRECTORY ..
|
PDB_OUTPUT_DIRECTORY ..
|
||||||
@ -123,7 +497,7 @@ if(CUTTER_ENABLE_PYTHON)
|
|||||||
string(REPLACE ";" ":" BINDINGS_INCLUDE_DIRS "${BINDINGS_INCLUDE_DIRS}")
|
string(REPLACE ";" ":" BINDINGS_INCLUDE_DIRS "${BINDINGS_INCLUDE_DIRS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qmake_configure_file("${BINDINGS_SRC_DIR}/bindings.txt.in" "${BINDINGS_BUILD_DIR}/bindings.txt")
|
configure_file("${BINDINGS_SRC_DIR}/bindings.txt.in" "${BINDINGS_BUILD_DIR}/bindings.txt")
|
||||||
add_compile_definitions(WIN32_LEAN_AND_MEAN)
|
add_compile_definitions(WIN32_LEAN_AND_MEAN)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
725
src/Cutter.pro
725
src/Cutter.pro
@ -1,725 +0,0 @@
|
|||||||
TEMPLATE = app
|
|
||||||
|
|
||||||
TARGET = Cutter
|
|
||||||
|
|
||||||
CUTTER_VERSION_MAJOR = 1
|
|
||||||
CUTTER_VERSION_MINOR = 12
|
|
||||||
CUTTER_VERSION_PATCH = 0
|
|
||||||
|
|
||||||
VERSION = $${CUTTER_VERSION_MAJOR}.$${CUTTER_VERSION_MINOR}.$${CUTTER_VERSION_PATCH}
|
|
||||||
|
|
||||||
# Required QT version
|
|
||||||
lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5")
|
|
||||||
|
|
||||||
TRANSLATIONS += translations/ar/cutter_ar.ts \
|
|
||||||
translations/ca/cutter_ca.ts \
|
|
||||||
translations/de/cutter_de.ts \
|
|
||||||
translations/es-ES/cutter_es.ts \
|
|
||||||
translations/fa/cutter_fa.ts \
|
|
||||||
translations/fr/cutter_fr.ts \
|
|
||||||
translations/he/cutter_he.ts \
|
|
||||||
translations/hi/cutter_hi.ts \
|
|
||||||
translations/it/cutter_it.ts \
|
|
||||||
translations/ja/cutter_ja.ts \
|
|
||||||
translations/nl/cutter_nl.ts \
|
|
||||||
translations/pt-PT/cutter_pt.ts \
|
|
||||||
translations/ro/cutter_ro.ts \
|
|
||||||
translations/ru/cutter_ru.ts \
|
|
||||||
translations/tr/cutter_tr.ts \
|
|
||||||
translations/zh-CN/cutter_zh.ts
|
|
||||||
|
|
||||||
# translations/ko/cutter_ko.ts problems with fonts
|
|
||||||
# translations/pt-BR/cutter_pt.ts #2321 handling multiple versions of a language
|
|
||||||
|
|
||||||
# Icon for OS X
|
|
||||||
ICON = img/cutter.icns
|
|
||||||
|
|
||||||
# Icon/resources for Windows
|
|
||||||
win32: RC_ICONS = img/cutter.ico
|
|
||||||
|
|
||||||
QT += core gui widgets svg network
|
|
||||||
QT_CONFIG -= no-pkg-config
|
|
||||||
CONFIG += c++11
|
|
||||||
|
|
||||||
!defined(CUTTER_ENABLE_CRASH_REPORTS, var) CUTTER_ENABLE_CRASH_REPORTS=false
|
|
||||||
equals(CUTTER_ENABLE_CRASH_REPORTS, true) CONFIG += CUTTER_ENABLE_CRASH_REPORTS
|
|
||||||
|
|
||||||
!defined(CUTTER_ENABLE_PYTHON, var) CUTTER_ENABLE_PYTHON=false
|
|
||||||
equals(CUTTER_ENABLE_PYTHON, true) CONFIG += CUTTER_ENABLE_PYTHON
|
|
||||||
|
|
||||||
!defined(CUTTER_ENABLE_PYTHON_BINDINGS, var) CUTTER_ENABLE_PYTHON_BINDINGS=false
|
|
||||||
equals(CUTTER_ENABLE_PYTHON, true) {
|
|
||||||
equals(CUTTER_ENABLE_PYTHON_BINDINGS, true) {
|
|
||||||
CONFIG += CUTTER_ENABLE_PYTHON_BINDINGS
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
!defined(CUTTER_BUNDLE_RZ_APPBUNDLE, var) CUTTER_BUNDLE_RZ_APPBUNDLE=false
|
|
||||||
equals(CUTTER_BUNDLE_RZ_APPBUNDLE, true) CONFIG += CUTTER_BUNDLE_RZ_APPBUNDLE
|
|
||||||
|
|
||||||
!defined(CUTTER_APPVEYOR_R2DEC, var) CUTTER_APPVEYOR_R2DEC=false
|
|
||||||
equals(CUTTER_APPVEYOR_R2DEC, true) CONFIG += CUTTER_APPVEYOR_R2DEC
|
|
||||||
|
|
||||||
!defined(CUTTER_RZGHIDRA_STATIC, var) CUTTER_RZGHIDRA_STATIC=false
|
|
||||||
equals(CUTTER_RZGHIDRA_STATIC, true) CONFIG += CUTTER_RZGHIDRA_STATIC
|
|
||||||
|
|
||||||
DEFINES += CUTTER_SOURCE_BUILD
|
|
||||||
|
|
||||||
CUTTER_ENABLE_CRASH_REPORTS {
|
|
||||||
message("Crash report support enabled.")
|
|
||||||
DEFINES += CUTTER_ENABLE_CRASH_REPORTS
|
|
||||||
} else {
|
|
||||||
message("Crash report support disabled.")
|
|
||||||
}
|
|
||||||
|
|
||||||
CUTTER_ENABLE_PYTHON {
|
|
||||||
message("Python enabled.")
|
|
||||||
DEFINES += CUTTER_ENABLE_PYTHON
|
|
||||||
} else {
|
|
||||||
message("Python disabled.")
|
|
||||||
}
|
|
||||||
|
|
||||||
CUTTER_ENABLE_PYTHON_BINDINGS {
|
|
||||||
message("Python Bindings enabled.")
|
|
||||||
DEFINES += CUTTER_ENABLE_PYTHON_BINDINGS
|
|
||||||
} else {
|
|
||||||
message("Python Bindings disabled. (requires CUTTER_ENABLE_PYTHON=true)")
|
|
||||||
}
|
|
||||||
|
|
||||||
win32:defined(CUTTER_DEPS_DIR, var) {
|
|
||||||
!defined(SHIBOKEN_EXECUTABLE, var) SHIBOKEN_EXECUTABLE="$${CUTTER_DEPS_DIR}/pyside/bin/shiboken2.exe"
|
|
||||||
!defined(SHIBOKEN_INCLUDEDIR, var) SHIBOKEN_INCLUDEDIR="$${CUTTER_DEPS_DIR}/pyside/include/shiboken2"
|
|
||||||
!defined(SHIBOKEN_LIBRARY, var) SHIBOKEN_LIBRARY="$${CUTTER_DEPS_DIR}/pyside/lib/shiboken2.abi3.lib"
|
|
||||||
!defined(PYSIDE_INCLUDEDIR, var) PYSIDE_INCLUDEDIR="$${CUTTER_DEPS_DIR}/pyside/include/PySide2"
|
|
||||||
!defined(PYSIDE_LIBRARY, var) PYSIDE_LIBRARY="$${CUTTER_DEPS_DIR}/pyside/lib/pyside2.abi3.lib"
|
|
||||||
!defined(PYSIDE_TYPESYSTEMS, var) PYSIDE_TYPESYSTEMS="$${CUTTER_DEPS_DIR}/pyside/share/PySide2/typesystems"
|
|
||||||
}
|
|
||||||
|
|
||||||
INCLUDEPATH *= . core widgets dialogs common plugins menus
|
|
||||||
|
|
||||||
win32 {
|
|
||||||
# Generate debug symbols in release mode
|
|
||||||
QMAKE_CXXFLAGS_RELEASE += -Zi # Compiler
|
|
||||||
QMAKE_LFLAGS_RELEASE += /DEBUG # Linker
|
|
||||||
|
|
||||||
# Multithreaded compilation
|
|
||||||
QMAKE_CXXFLAGS += -MP
|
|
||||||
}
|
|
||||||
|
|
||||||
macx {
|
|
||||||
QMAKE_CXXFLAGS = -mmacosx-version-min=10.7 -std=gnu0x -stdlib=libc++
|
|
||||||
QMAKE_TARGET_BUNDLE_PREFIX = org.rizin
|
|
||||||
QMAKE_BUNDLE = cutter
|
|
||||||
QMAKE_INFO_PLIST = macos/Info.plist
|
|
||||||
}
|
|
||||||
|
|
||||||
unix:exists(/usr/local/include/libr)|bsd:exists(/usr/local/include/libr) {
|
|
||||||
INCLUDEPATH += /usr/local/include/libr
|
|
||||||
INCLUDEPATH += /usr/local/include/libr/sdb
|
|
||||||
}
|
|
||||||
unix {
|
|
||||||
QMAKE_LFLAGS += -rdynamic # Export dynamic symbols for plugins
|
|
||||||
}
|
|
||||||
|
|
||||||
# Libraries
|
|
||||||
include(lib_rizin.pri)
|
|
||||||
|
|
||||||
!win32 {
|
|
||||||
CONFIG += link_pkgconfig
|
|
||||||
}
|
|
||||||
|
|
||||||
CUTTER_ENABLE_PYTHON {
|
|
||||||
win32 {
|
|
||||||
PYTHON_EXECUTABLE = $$system("where python", lines)
|
|
||||||
PYTHON_EXECUTABLE = $$first(PYTHON_EXECUTABLE)
|
|
||||||
pythonpath = $$clean_path($$dirname(PYTHON_EXECUTABLE))
|
|
||||||
LIBS += -L$${pythonpath}/libs -lpython3
|
|
||||||
INCLUDEPATH += $${pythonpath}/include
|
|
||||||
}
|
|
||||||
|
|
||||||
unix|macx|bsd {
|
|
||||||
defined(PYTHON_FRAMEWORK_DIR, var) {
|
|
||||||
message("Using Python.framework at $$PYTHON_FRAMEWORK_DIR")
|
|
||||||
INCLUDEPATH += $$PYTHON_FRAMEWORK_DIR/Python.framework/Headers
|
|
||||||
LIBS += -F$$PYTHON_FRAMEWORK_DIR -framework Python
|
|
||||||
DEFINES += MACOS_PYTHON_FRAMEWORK_BUNDLED
|
|
||||||
} else {
|
|
||||||
!packagesExist(python3) {
|
|
||||||
error("ERROR: Python 3 could not be found. Make sure it is available to pkg-config.")
|
|
||||||
}
|
|
||||||
PKGCONFIG += python3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CUTTER_ENABLE_PYTHON_BINDINGS {
|
|
||||||
isEmpty(SHIBOKEN_EXECUTABLE):!packagesExist(shiboken2) {
|
|
||||||
error("ERROR: Shiboken2, which is required to build the Python Bindings, could not be found. Make sure it is available to pkg-config.")
|
|
||||||
}
|
|
||||||
isEmpty(PYSIDE_LIBRARY):!packagesExist(pyside2) {
|
|
||||||
error("ERROR: PySide2, which is required to build the Python Bindings, could not be found. Make sure it is available to pkg-config.")
|
|
||||||
}
|
|
||||||
win32 {
|
|
||||||
BINDINGS_SRC_LIST_CMD = "\"$${PYTHON_EXECUTABLE}\" bindings/src_list.py"
|
|
||||||
} else {
|
|
||||||
BINDINGS_SRC_LIST_CMD = "python3 bindings/src_list.py"
|
|
||||||
}
|
|
||||||
BINDINGS_SRC_DIR = "$${PWD}/bindings"
|
|
||||||
BINDINGS_BUILD_DIR = "$${OUT_PWD}/bindings"
|
|
||||||
BINDINGS_SOURCE_DIR = "$${BINDINGS_BUILD_DIR}/CutterBindings"
|
|
||||||
BINDINGS_SOURCE = $$system("$${BINDINGS_SRC_LIST_CMD} qmake \"$${BINDINGS_BUILD_DIR}\"")
|
|
||||||
BINDINGS_INCLUDE_DIRS = "$$[QT_INSTALL_HEADERS]" \
|
|
||||||
"$$[QT_INSTALL_HEADERS]/QtCore" \
|
|
||||||
"$$[QT_INSTALL_HEADERS]/QtWidgets" \
|
|
||||||
"$$[QT_INSTALL_HEADERS]/QtGui"
|
|
||||||
for (path, RZ_INCLUDEPATH) {
|
|
||||||
BINDINGS_INCLUDE_DIRS += "$$path"
|
|
||||||
}
|
|
||||||
for(path, INCLUDEPATH) {
|
|
||||||
BINDINGS_INCLUDE_DIRS += $$absolute_path("$$path")
|
|
||||||
}
|
|
||||||
|
|
||||||
win32 {
|
|
||||||
PATH_SEP = ";"
|
|
||||||
} else {
|
|
||||||
PATH_SEP = ":"
|
|
||||||
}
|
|
||||||
BINDINGS_INCLUDE_DIRS = $$join(BINDINGS_INCLUDE_DIRS, $$PATH_SEP)
|
|
||||||
|
|
||||||
isEmpty(SHIBOKEN_EXECUTABLE) {
|
|
||||||
SHIBOKEN_EXECUTABLE = $$system("pkg-config --variable=generator_location shiboken2")
|
|
||||||
}
|
|
||||||
|
|
||||||
isEmpty(PYSIDE_TYPESYSTEMS) {
|
|
||||||
PYSIDE_TYPESYSTEMS = $$system("pkg-config --variable=typesystemdir pyside2")
|
|
||||||
}
|
|
||||||
isEmpty(PYSIDE_INCLUDEDIR) {
|
|
||||||
PYSIDE_INCLUDEDIR = $$system("pkg-config --variable=includedir pyside2")
|
|
||||||
}
|
|
||||||
|
|
||||||
QMAKE_SUBSTITUTES += bindings/bindings.txt.in
|
|
||||||
|
|
||||||
SHIBOKEN_OPTIONS = --project-file="$${BINDINGS_BUILD_DIR}/bindings.txt"
|
|
||||||
defined(SHIBOKEN_EXTRA_OPTIONS, var) SHIBOKEN_OPTIONS += $${SHIBOKEN_EXTRA_OPTIONS}
|
|
||||||
|
|
||||||
win32:SHIBOKEN_OPTIONS += --avoid-protected-hack
|
|
||||||
bindings.target = bindings_target
|
|
||||||
bindings.commands = $$quote($$system_path($${SHIBOKEN_EXECUTABLE})) $${SHIBOKEN_OPTIONS}
|
|
||||||
QMAKE_EXTRA_TARGETS += bindings
|
|
||||||
PRE_TARGETDEPS += bindings_target
|
|
||||||
# GENERATED_SOURCES += $${BINDINGS_SOURCE} done by dummy targets bellow
|
|
||||||
|
|
||||||
INCLUDEPATH += "$${BINDINGS_SOURCE_DIR}"
|
|
||||||
|
|
||||||
win32:DEFINES += WIN32_LEAN_AND_MEAN
|
|
||||||
|
|
||||||
!isEmpty(PYSIDE_LIBRARY) {
|
|
||||||
LIBS += "$$SHIBOKEN_LIBRARY" "$$PYSIDE_LIBRARY"
|
|
||||||
INCLUDEPATH += "$$SHIBOKEN_INCLUDEDIR"
|
|
||||||
} else:macx {
|
|
||||||
# Hack needed because with regular PKGCONFIG qmake will mess up everything
|
|
||||||
QMAKE_CXXFLAGS += $$system("pkg-config --cflags shiboken2 pyside2")
|
|
||||||
LIBS += $$system("pkg-config --libs shiboken2 pyside2")
|
|
||||||
} else {
|
|
||||||
PKGCONFIG += shiboken2 pyside2
|
|
||||||
}
|
|
||||||
INCLUDEPATH += "$$PYSIDE_INCLUDEDIR" "$$PYSIDE_INCLUDEDIR/QtCore" "$$PYSIDE_INCLUDEDIR/QtWidgets" "$$PYSIDE_INCLUDEDIR/QtGui"
|
|
||||||
|
|
||||||
|
|
||||||
BINDINGS_DUMMY_INPUT_LIST = bindings/src_list.py
|
|
||||||
|
|
||||||
# dummy rules to specify dependency between generated binding files and bindings_target
|
|
||||||
bindings_h.input = BINDINGS_DUMMY_INPUT_LIST
|
|
||||||
bindings_h.depends = bindings_target
|
|
||||||
bindings_h.output = cutterbindings_python.h
|
|
||||||
bindings_h.commands = "echo placeholder command ${QMAKE_FILE_OUT}"
|
|
||||||
bindings_h.variable_out = HEADERS
|
|
||||||
QMAKE_EXTRA_COMPILERS += bindings_h
|
|
||||||
|
|
||||||
for(path, BINDINGS_SOURCE) {
|
|
||||||
dummy_input = $$replace(path, .cpp, .txt)
|
|
||||||
BINDINGS_DUMMY_INPUTS += $$dummy_input
|
|
||||||
win32 {
|
|
||||||
_ = $$system("mkdir \"$$dirname(dummy_input)\"; echo a >\"$$dummy_input\"")
|
|
||||||
} else {
|
|
||||||
_ = $$system("mkdir -p \"$$dirname(dummy_input)\"; echo a >\"$$dummy_input\"")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bindings_cpp.input = BINDINGS_DUMMY_INPUTS
|
|
||||||
bindings_cpp.depends = bindings_target
|
|
||||||
bindings_cpp.output = "$${BINDINGS_SOURCE_DIR}/${QMAKE_FILE_IN_BASE}.cpp"
|
|
||||||
bindings_cpp.commands = "echo placeholder command ${QMAKE_FILE_OUT}"
|
|
||||||
bindings_cpp.variable_out = GENERATED_SOURCES
|
|
||||||
QMAKE_EXTRA_COMPILERS += bindings_cpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CUTTER_ENABLE_CRASH_REPORTS {
|
|
||||||
QMAKE_CXXFLAGS += -g
|
|
||||||
defined(BREAKPAD_FRAMEWORK_DIR, var)|defined(BREAKPAD_SOURCE_DIR, var) {
|
|
||||||
defined(BREAKPAD_FRAMEWORK_DIR, var) {
|
|
||||||
INCLUDEPATH += $$BREAKPAD_FRAMEWORK_DIR/Breakpad.framework/Headers
|
|
||||||
LIBS += -F$$BREAKPAD_FRAMEWORK_DIR -framework Breakpad
|
|
||||||
}
|
|
||||||
defined(BREAKPAD_SOURCE_DIR, var) {
|
|
||||||
INCLUDEPATH += $$BREAKPAD_SOURCE_DIR
|
|
||||||
win32 {
|
|
||||||
LIBS += -L$$quote($$BREAKPAD_SOURCE_DIR\\client\\windows\\release\\lib) -lexception_handler -lcrash_report_sender -lcrash_generation_server -lcrash_generation_client -lcommon
|
|
||||||
}
|
|
||||||
unix:LIBS += -L$$BREAKPAD_SOURCE_DIR/client/linux -lbreakpad-client
|
|
||||||
macos:error("Please use scripts\prepare_breakpad_macos.sh script to provide breakpad framework.")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
CONFIG += link_pkgconfig
|
|
||||||
!packagesExist(breakpad-client) {
|
|
||||||
error("ERROR: Breakpad could not be found. Make sure it is available to pkg-config.")
|
|
||||||
}
|
|
||||||
PKGCONFIG += breakpad-client
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
macx:CUTTER_BUNDLE_RZ_APPBUNDLE {
|
|
||||||
message("Using rizin rom AppBundle")
|
|
||||||
DEFINES += MACOS_RZ_BUNDLED
|
|
||||||
}
|
|
||||||
|
|
||||||
CUTTER_APPVEYOR_R2DEC {
|
|
||||||
message("Appveyor r2dec")
|
|
||||||
DEFINES += CUTTER_APPVEYOR_R2DEC
|
|
||||||
}
|
|
||||||
|
|
||||||
CUTTER_RZGHIDRA_STATIC {
|
|
||||||
message("Building with static rz-ghidra support")
|
|
||||||
DEFINES += CUTTER_RZGHIDRA_STATIC
|
|
||||||
SOURCES += $$RZGHIDRA_SOURCE/cutter-plugin/RzGhidraDecompiler.cpp
|
|
||||||
HEADERS += $$RZGHIDRA_SOURCE/cutter-plugin/RzGhidraDecompiler.h
|
|
||||||
INCLUDEPATH += $$RZGHIDRA_SOURCE/cutter-plugin
|
|
||||||
LIBS += -L$$RZGHIDRA_INSTALL_PATH -lcore_ghidra -ldelayimp
|
|
||||||
QMAKE_LFLAGS += /delayload:core_ghidra.dll
|
|
||||||
}
|
|
||||||
|
|
||||||
QMAKE_SUBSTITUTES += CutterConfig.h.in
|
|
||||||
|
|
||||||
SOURCES += \
|
|
||||||
Main.cpp \
|
|
||||||
core/Cutter.cpp \
|
|
||||||
dialogs/EditStringDialog.cpp \
|
|
||||||
dialogs/WriteCommandsDialogs.cpp \
|
|
||||||
widgets/DisassemblerGraphView.cpp \
|
|
||||||
widgets/OverviewView.cpp \
|
|
||||||
common/RichTextPainter.cpp \
|
|
||||||
dialogs/InitialOptionsDialog.cpp \
|
|
||||||
dialogs/AboutDialog.cpp \
|
|
||||||
dialogs/CommentsDialog.cpp \
|
|
||||||
dialogs/EditInstructionDialog.cpp \
|
|
||||||
dialogs/FlagDialog.cpp \
|
|
||||||
dialogs/RemoteDebugDialog.cpp \
|
|
||||||
dialogs/NativeDebugDialog.cpp \
|
|
||||||
dialogs/XrefsDialog.cpp \
|
|
||||||
core/MainWindow.cpp \
|
|
||||||
common/Helpers.cpp \
|
|
||||||
common/Highlighter.cpp \
|
|
||||||
common/MdHighlighter.cpp \
|
|
||||||
common/DirectionalComboBox.cpp \
|
|
||||||
dialogs/preferences/AsmOptionsWidget.cpp \
|
|
||||||
dialogs/NewFileDialog.cpp \
|
|
||||||
common/AnalTask.cpp \
|
|
||||||
widgets/CommentsWidget.cpp \
|
|
||||||
widgets/ConsoleWidget.cpp \
|
|
||||||
widgets/Dashboard.cpp \
|
|
||||||
widgets/EntrypointWidget.cpp \
|
|
||||||
widgets/ExportsWidget.cpp \
|
|
||||||
widgets/FlagsWidget.cpp \
|
|
||||||
widgets/FunctionsWidget.cpp \
|
|
||||||
widgets/ImportsWidget.cpp \
|
|
||||||
widgets/Omnibar.cpp \
|
|
||||||
widgets/RelocsWidget.cpp \
|
|
||||||
widgets/SectionsWidget.cpp \
|
|
||||||
widgets/SegmentsWidget.cpp \
|
|
||||||
widgets/StringsWidget.cpp \
|
|
||||||
widgets/SymbolsWidget.cpp \
|
|
||||||
menus/DisassemblyContextMenu.cpp \
|
|
||||||
menus/DecompilerContextMenu.cpp \
|
|
||||||
widgets/DisassemblyWidget.cpp \
|
|
||||||
widgets/HexdumpWidget.cpp \
|
|
||||||
common/Configuration.cpp \
|
|
||||||
common/Colors.cpp \
|
|
||||||
common/TempConfig.cpp \
|
|
||||||
common/SvgIconEngine.cpp \
|
|
||||||
common/SyntaxHighlighter.cpp \
|
|
||||||
widgets/DecompilerWidget.cpp \
|
|
||||||
widgets/VisualNavbar.cpp \
|
|
||||||
widgets/GraphView.cpp \
|
|
||||||
dialogs/preferences/PreferencesDialog.cpp \
|
|
||||||
dialogs/preferences/AppearanceOptionsWidget.cpp \
|
|
||||||
dialogs/preferences/GraphOptionsWidget.cpp \
|
|
||||||
dialogs/preferences/PreferenceCategory.cpp \
|
|
||||||
dialogs/preferences/InitializationFileEditor.cpp \
|
|
||||||
widgets/QuickFilterView.cpp \
|
|
||||||
widgets/ClassesWidget.cpp \
|
|
||||||
widgets/ResourcesWidget.cpp \
|
|
||||||
widgets/VTablesWidget.cpp \
|
|
||||||
widgets/TypesWidget.cpp \
|
|
||||||
widgets/HeadersWidget.cpp \
|
|
||||||
widgets/SearchWidget.cpp \
|
|
||||||
CutterApplication.cpp \
|
|
||||||
common/PythonAPI.cpp \
|
|
||||||
dialogs/RizinPluginsDialog.cpp \
|
|
||||||
widgets/CutterDockWidget.cpp \
|
|
||||||
widgets/CutterTreeWidget.cpp \
|
|
||||||
widgets/GraphWidget.cpp \
|
|
||||||
widgets/OverviewWidget.cpp \
|
|
||||||
common/JsonTreeItem.cpp \
|
|
||||||
common/JsonModel.cpp \
|
|
||||||
dialogs/VersionInfoDialog.cpp \
|
|
||||||
widgets/ZignaturesWidget.cpp \
|
|
||||||
common/AsyncTask.cpp \
|
|
||||||
dialogs/AsyncTaskDialog.cpp \
|
|
||||||
widgets/StackWidget.cpp \
|
|
||||||
widgets/RegistersWidget.cpp \
|
|
||||||
widgets/ThreadsWidget.cpp \
|
|
||||||
widgets/ProcessesWidget.cpp \
|
|
||||||
widgets/BacktraceWidget.cpp \
|
|
||||||
dialogs/MapFileDialog.cpp \
|
|
||||||
common/CommandTask.cpp \
|
|
||||||
common/ProgressIndicator.cpp \
|
|
||||||
common/RizinTask.cpp \
|
|
||||||
dialogs/RizinTaskDialog.cpp \
|
|
||||||
widgets/DebugActions.cpp \
|
|
||||||
widgets/MemoryMapWidget.cpp \
|
|
||||||
dialogs/preferences/DebugOptionsWidget.cpp \
|
|
||||||
dialogs/preferences/PluginsOptionsWidget.cpp \
|
|
||||||
widgets/BreakpointWidget.cpp \
|
|
||||||
dialogs/BreakpointsDialog.cpp \
|
|
||||||
dialogs/AttachProcDialog.cpp \
|
|
||||||
widgets/RegisterRefsWidget.cpp \
|
|
||||||
dialogs/SetToDataDialog.cpp \
|
|
||||||
dialogs/EditVariablesDialog.cpp \
|
|
||||||
dialogs/EditFunctionDialog.cpp \
|
|
||||||
widgets/CutterTreeView.cpp \
|
|
||||||
widgets/ComboQuickFilterView.cpp \
|
|
||||||
dialogs/HexdumpRangeDialog.cpp \
|
|
||||||
common/QtResImporter.cpp \
|
|
||||||
common/CutterSeekable.cpp \
|
|
||||||
common/RefreshDeferrer.cpp \
|
|
||||||
dialogs/WelcomeDialog.cpp \
|
|
||||||
common/RunScriptTask.cpp \
|
|
||||||
dialogs/EditMethodDialog.cpp \
|
|
||||||
dialogs/TypesInteractionDialog.cpp \
|
|
||||||
widgets/SdbWidget.cpp \
|
|
||||||
common/PythonManager.cpp \
|
|
||||||
plugins/PluginManager.cpp \
|
|
||||||
common/BasicBlockHighlighter.cpp \
|
|
||||||
common/BasicInstructionHighlighter.cpp \
|
|
||||||
dialogs/LinkTypeDialog.cpp \
|
|
||||||
widgets/ColorPicker.cpp \
|
|
||||||
common/ColorThemeWorker.cpp \
|
|
||||||
widgets/ColorThemeComboBox.cpp \
|
|
||||||
widgets/ColorThemeListView.cpp \
|
|
||||||
dialogs/preferences/ColorThemeEditDialog.cpp \
|
|
||||||
common/UpdateWorker.cpp \
|
|
||||||
widgets/MemoryDockWidget.cpp \
|
|
||||||
common/CrashHandler.cpp \
|
|
||||||
common/BugReporting.cpp \
|
|
||||||
common/HighDpiPixmap.cpp \
|
|
||||||
widgets/GraphGridLayout.cpp \
|
|
||||||
widgets/HexWidget.cpp \
|
|
||||||
common/SelectionHighlight.cpp \
|
|
||||||
common/Decompiler.cpp \
|
|
||||||
menus/AddressableItemContextMenu.cpp \
|
|
||||||
common/AddressableItemModel.cpp \
|
|
||||||
widgets/ListDockWidget.cpp \
|
|
||||||
dialogs/MultitypeFileSaveDialog.cpp \
|
|
||||||
widgets/BoolToggleDelegate.cpp \
|
|
||||||
common/IOModesController.cpp \
|
|
||||||
common/SettingsUpgrade.cpp \
|
|
||||||
dialogs/LayoutManager.cpp \
|
|
||||||
common/CutterLayout.cpp \
|
|
||||||
widgets/GraphHorizontalAdapter.cpp \
|
|
||||||
common/ResourcePaths.cpp \
|
|
||||||
widgets/CutterGraphView.cpp \
|
|
||||||
widgets/SimpleTextGraphView.cpp \
|
|
||||||
widgets/RizinGraphWidget.cpp \
|
|
||||||
widgets/CallGraph.cpp \
|
|
||||||
widgets/AddressableDockWidget.cpp \
|
|
||||||
dialogs/preferences/AnalOptionsWidget.cpp \
|
|
||||||
common/DecompilerHighlighter.cpp
|
|
||||||
|
|
||||||
GRAPHVIZ_SOURCES = \
|
|
||||||
widgets/GraphvizLayout.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
|
||||||
core/Cutter.h \
|
|
||||||
core/CutterCommon.h \
|
|
||||||
core/CutterDescriptions.h \
|
|
||||||
dialogs/EditStringDialog.h \
|
|
||||||
dialogs/WriteCommandsDialogs.h \
|
|
||||||
widgets/DisassemblerGraphView.h \
|
|
||||||
widgets/OverviewView.h \
|
|
||||||
common/RichTextPainter.h \
|
|
||||||
common/CachedFontMetrics.h \
|
|
||||||
dialogs/AboutDialog.h \
|
|
||||||
dialogs/preferences/AsmOptionsWidget.h \
|
|
||||||
dialogs/CommentsDialog.h \
|
|
||||||
dialogs/EditInstructionDialog.h \
|
|
||||||
dialogs/FlagDialog.h \
|
|
||||||
dialogs/RemoteDebugDialog.h \
|
|
||||||
dialogs/NativeDebugDialog.h \
|
|
||||||
dialogs/XrefsDialog.h \
|
|
||||||
common/Helpers.h \
|
|
||||||
core/MainWindow.h \
|
|
||||||
common/Highlighter.h \
|
|
||||||
common/MdHighlighter.h \
|
|
||||||
common/DirectionalComboBox.h \
|
|
||||||
dialogs/InitialOptionsDialog.h \
|
|
||||||
dialogs/NewFileDialog.h \
|
|
||||||
common/AnalTask.h \
|
|
||||||
widgets/CommentsWidget.h \
|
|
||||||
widgets/ConsoleWidget.h \
|
|
||||||
widgets/Dashboard.h \
|
|
||||||
widgets/EntrypointWidget.h \
|
|
||||||
widgets/ExportsWidget.h \
|
|
||||||
widgets/FlagsWidget.h \
|
|
||||||
widgets/FunctionsWidget.h \
|
|
||||||
widgets/ImportsWidget.h \
|
|
||||||
widgets/Omnibar.h \
|
|
||||||
widgets/RelocsWidget.h \
|
|
||||||
widgets/SectionsWidget.h \
|
|
||||||
widgets/SegmentsWidget.h \
|
|
||||||
widgets/StringsWidget.h \
|
|
||||||
widgets/SymbolsWidget.h \
|
|
||||||
menus/DisassemblyContextMenu.h \
|
|
||||||
menus/DecompilerContextMenu.h \
|
|
||||||
widgets/DisassemblyWidget.h \
|
|
||||||
widgets/HexdumpWidget.h \
|
|
||||||
common/Configuration.h \
|
|
||||||
common/Colors.h \
|
|
||||||
common/TempConfig.h \
|
|
||||||
common/SvgIconEngine.h \
|
|
||||||
common/SyntaxHighlighter.h \
|
|
||||||
widgets/DecompilerWidget.h \
|
|
||||||
widgets/VisualNavbar.h \
|
|
||||||
widgets/GraphView.h \
|
|
||||||
dialogs/preferences/PreferencesDialog.h \
|
|
||||||
dialogs/preferences/AppearanceOptionsWidget.h \
|
|
||||||
dialogs/preferences/PreferenceCategory.h \
|
|
||||||
dialogs/preferences/GraphOptionsWidget.h \
|
|
||||||
dialogs/preferences/InitializationFileEditor.h \
|
|
||||||
widgets/QuickFilterView.h \
|
|
||||||
widgets/ClassesWidget.h \
|
|
||||||
widgets/ResourcesWidget.h \
|
|
||||||
CutterApplication.h \
|
|
||||||
widgets/VTablesWidget.h \
|
|
||||||
widgets/TypesWidget.h \
|
|
||||||
widgets/HeadersWidget.h \
|
|
||||||
widgets/SearchWidget.h \
|
|
||||||
common/PythonAPI.h \
|
|
||||||
dialogs/RizinPluginsDialog.h \
|
|
||||||
widgets/CutterDockWidget.h \
|
|
||||||
widgets/CutterTreeWidget.h \
|
|
||||||
widgets/GraphWidget.h \
|
|
||||||
widgets/OverviewWidget.h \
|
|
||||||
common/JsonTreeItem.h \
|
|
||||||
common/JsonModel.h \
|
|
||||||
dialogs/VersionInfoDialog.h \
|
|
||||||
widgets/ZignaturesWidget.h \
|
|
||||||
common/AsyncTask.h \
|
|
||||||
dialogs/AsyncTaskDialog.h \
|
|
||||||
widgets/StackWidget.h \
|
|
||||||
widgets/RegistersWidget.h \
|
|
||||||
widgets/ThreadsWidget.h \
|
|
||||||
widgets/ProcessesWidget.h \
|
|
||||||
widgets/BacktraceWidget.h \
|
|
||||||
dialogs/MapFileDialog.h \
|
|
||||||
common/StringsTask.h \
|
|
||||||
common/FunctionsTask.h \
|
|
||||||
common/CommandTask.h \
|
|
||||||
common/ProgressIndicator.h \
|
|
||||||
plugins/CutterPlugin.h \
|
|
||||||
common/RizinTask.h \
|
|
||||||
dialogs/RizinTaskDialog.h \
|
|
||||||
widgets/DebugActions.h \
|
|
||||||
widgets/MemoryMapWidget.h \
|
|
||||||
dialogs/preferences/DebugOptionsWidget.h \
|
|
||||||
dialogs/preferences/PluginsOptionsWidget.h \
|
|
||||||
widgets/BreakpointWidget.h \
|
|
||||||
dialogs/BreakpointsDialog.h \
|
|
||||||
dialogs/AttachProcDialog.h \
|
|
||||||
widgets/RegisterRefsWidget.h \
|
|
||||||
dialogs/SetToDataDialog.h \
|
|
||||||
common/InitialOptions.h \
|
|
||||||
dialogs/EditVariablesDialog.h \
|
|
||||||
dialogs/EditFunctionDialog.h \
|
|
||||||
widgets/CutterTreeView.h \
|
|
||||||
widgets/ComboQuickFilterView.h \
|
|
||||||
dialogs/HexdumpRangeDialog.h \
|
|
||||||
common/QtResImporter.h \
|
|
||||||
common/CutterSeekable.h \
|
|
||||||
common/RefreshDeferrer.h \
|
|
||||||
dialogs/WelcomeDialog.h \
|
|
||||||
common/RunScriptTask.h \
|
|
||||||
common/Json.h \
|
|
||||||
dialogs/EditMethodDialog.h \
|
|
||||||
common/CrashHandler.h \
|
|
||||||
dialogs/TypesInteractionDialog.h \
|
|
||||||
widgets/SdbWidget.h \
|
|
||||||
common/PythonManager.h \
|
|
||||||
plugins/PluginManager.h \
|
|
||||||
common/BasicBlockHighlighter.h \
|
|
||||||
common/BasicInstructionHighlighter.h \
|
|
||||||
common/UpdateWorker.h \
|
|
||||||
widgets/ColorPicker.h \
|
|
||||||
common/ColorThemeWorker.h \
|
|
||||||
widgets/ColorThemeComboBox.h \
|
|
||||||
widgets/MemoryDockWidget.h \
|
|
||||||
widgets/ColorThemeListView.h \
|
|
||||||
dialogs/preferences/ColorThemeEditDialog.h \
|
|
||||||
dialogs/LinkTypeDialog.h \
|
|
||||||
common/BugReporting.h \
|
|
||||||
common/HighDpiPixmap.h \
|
|
||||||
widgets/GraphLayout.h \
|
|
||||||
widgets/GraphGridLayout.h \
|
|
||||||
widgets/HexWidget.h \
|
|
||||||
common/SelectionHighlight.h \
|
|
||||||
common/Decompiler.h \
|
|
||||||
menus/AddressableItemContextMenu.h \
|
|
||||||
common/AddressableItemModel.h \
|
|
||||||
widgets/ListDockWidget.h \
|
|
||||||
widgets/AddressableItemList.h \
|
|
||||||
dialogs/MultitypeFileSaveDialog.h \
|
|
||||||
widgets/BoolToggleDelegate.h \
|
|
||||||
common/IOModesController.h \
|
|
||||||
common/SettingsUpgrade.h \
|
|
||||||
dialogs/LayoutManager.h \
|
|
||||||
common/CutterLayout.h \
|
|
||||||
common/BinaryTrees.h \
|
|
||||||
common/LinkedListPool.h \
|
|
||||||
widgets/GraphHorizontalAdapter.h \
|
|
||||||
common/ResourcePaths.h \
|
|
||||||
widgets/CutterGraphView.h \
|
|
||||||
widgets/SimpleTextGraphView.h \
|
|
||||||
widgets/RizinGraphWidget.h \
|
|
||||||
widgets/CallGraph.h \
|
|
||||||
widgets/AddressableDockWidget.h \
|
|
||||||
dialogs/preferences/AnalOptionsWidget.h \
|
|
||||||
common/DecompilerHighlighter.h
|
|
||||||
|
|
||||||
GRAPHVIZ_HEADERS = widgets/GraphvizLayout.h
|
|
||||||
|
|
||||||
FORMS += \
|
|
||||||
dialogs/AboutDialog.ui \
|
|
||||||
dialogs/EditStringDialog.ui \
|
|
||||||
dialogs/Base64EnDecodedWriteDialog.ui \
|
|
||||||
dialogs/DuplicateFromOffsetDialog.ui \
|
|
||||||
dialogs/IncrementDecrementDialog.ui \
|
|
||||||
dialogs/preferences/AsmOptionsWidget.ui \
|
|
||||||
dialogs/CommentsDialog.ui \
|
|
||||||
dialogs/EditInstructionDialog.ui \
|
|
||||||
dialogs/FlagDialog.ui \
|
|
||||||
dialogs/RemoteDebugDialog.ui \
|
|
||||||
dialogs/NativeDebugDialog.ui \
|
|
||||||
dialogs/XrefsDialog.ui \
|
|
||||||
dialogs/NewFileDialog.ui \
|
|
||||||
dialogs/InitialOptionsDialog.ui \
|
|
||||||
dialogs/EditFunctionDialog.ui \
|
|
||||||
core/MainWindow.ui \
|
|
||||||
widgets/ConsoleWidget.ui \
|
|
||||||
widgets/Dashboard.ui \
|
|
||||||
widgets/EntrypointWidget.ui \
|
|
||||||
widgets/FlagsWidget.ui \
|
|
||||||
widgets/StringsWidget.ui \
|
|
||||||
widgets/HexdumpWidget.ui \
|
|
||||||
dialogs/preferences/PreferencesDialog.ui \
|
|
||||||
dialogs/preferences/AppearanceOptionsWidget.ui \
|
|
||||||
dialogs/preferences/GraphOptionsWidget.ui \
|
|
||||||
dialogs/preferences/InitializationFileEditor.ui \
|
|
||||||
widgets/QuickFilterView.ui \
|
|
||||||
widgets/DecompilerWidget.ui \
|
|
||||||
widgets/ClassesWidget.ui \
|
|
||||||
widgets/VTablesWidget.ui \
|
|
||||||
widgets/TypesWidget.ui \
|
|
||||||
widgets/SearchWidget.ui \
|
|
||||||
dialogs/RizinPluginsDialog.ui \
|
|
||||||
dialogs/VersionInfoDialog.ui \
|
|
||||||
widgets/ZignaturesWidget.ui \
|
|
||||||
dialogs/AsyncTaskDialog.ui \
|
|
||||||
dialogs/RizinTaskDialog.ui \
|
|
||||||
widgets/StackWidget.ui \
|
|
||||||
widgets/RegistersWidget.ui \
|
|
||||||
widgets/ThreadsWidget.ui \
|
|
||||||
widgets/ProcessesWidget.ui \
|
|
||||||
widgets/BacktraceWidget.ui \
|
|
||||||
dialogs/MapFileDialog.ui \
|
|
||||||
dialogs/preferences/DebugOptionsWidget.ui \
|
|
||||||
widgets/BreakpointWidget.ui \
|
|
||||||
dialogs/BreakpointsDialog.ui \
|
|
||||||
dialogs/AttachProcDialog.ui \
|
|
||||||
widgets/RegisterRefsWidget.ui \
|
|
||||||
dialogs/SetToDataDialog.ui \
|
|
||||||
dialogs/EditVariablesDialog.ui \
|
|
||||||
widgets/CutterTreeView.ui \
|
|
||||||
widgets/ComboQuickFilterView.ui \
|
|
||||||
dialogs/HexdumpRangeDialog.ui \
|
|
||||||
dialogs/WelcomeDialog.ui \
|
|
||||||
dialogs/EditMethodDialog.ui \
|
|
||||||
dialogs/TypesInteractionDialog.ui \
|
|
||||||
widgets/SdbWidget.ui \
|
|
||||||
dialogs/LinkTypeDialog.ui \
|
|
||||||
widgets/ColorPicker.ui \
|
|
||||||
dialogs/preferences/ColorThemeEditDialog.ui \
|
|
||||||
widgets/ListDockWidget.ui \
|
|
||||||
dialogs/LayoutManager.ui \
|
|
||||||
widgets/RizinGraphWidget.ui \
|
|
||||||
dialogs/preferences/AnalOptionsWidget.ui
|
|
||||||
|
|
||||||
RESOURCES += \
|
|
||||||
resources.qrc \
|
|
||||||
themes/native/native.qrc \
|
|
||||||
themes/qdarkstyle/dark.qrc \
|
|
||||||
themes/midnight/midnight.qrc \
|
|
||||||
themes/lightstyle/light.qrc
|
|
||||||
|
|
||||||
|
|
||||||
DISTFILES += Cutter.astylerc
|
|
||||||
|
|
||||||
# 'make install' for AppImage
|
|
||||||
unix {
|
|
||||||
isEmpty(PREFIX) {
|
|
||||||
PREFIX = /usr/local
|
|
||||||
}
|
|
||||||
|
|
||||||
icon_file = img/cutter.svg
|
|
||||||
|
|
||||||
share_pixmaps.path = $$PREFIX/share/pixmaps
|
|
||||||
share_pixmaps.files = $$icon_file
|
|
||||||
|
|
||||||
|
|
||||||
desktop_file = org.rizin.Cutter.desktop
|
|
||||||
|
|
||||||
share_applications.path = $$PREFIX/share/applications
|
|
||||||
share_applications.files = $$desktop_file
|
|
||||||
|
|
||||||
appstream_file = org.rizin.Cutter.appdata.xml
|
|
||||||
|
|
||||||
# Used by ???
|
|
||||||
share_appdata.path = $$PREFIX/share/appdata
|
|
||||||
share_appdata.files = $$appstream_file
|
|
||||||
|
|
||||||
# Used by AppImageHub (See https://www.freedesktop.org/software/appstream)
|
|
||||||
share_appdata.path = $$PREFIX/share/metainfo
|
|
||||||
share_appdata.files = $$appstream_file
|
|
||||||
|
|
||||||
# built-in no need for files atm
|
|
||||||
target.path = $$PREFIX/bin
|
|
||||||
|
|
||||||
INSTALLS += target share_appdata share_applications share_pixmaps
|
|
||||||
|
|
||||||
# Triggered for example by 'qmake APPIMAGE=1'
|
|
||||||
!isEmpty(APPIMAGE){
|
|
||||||
appimage_root.path = /
|
|
||||||
appimage_root.files = $$icon_file $$desktop_file
|
|
||||||
|
|
||||||
INSTALLS += appimage_root
|
|
||||||
DEFINES += APPIMAGE
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,12 +2,12 @@
|
|||||||
#ifndef CUTTER_CONFIG_H
|
#ifndef CUTTER_CONFIG_H
|
||||||
#define CUTTER_CONFIG_H
|
#define CUTTER_CONFIG_H
|
||||||
|
|
||||||
#define CUTTER_VERSION_MAJOR $$CUTTER_VERSION_MAJOR
|
#define CUTTER_VERSION_MAJOR @CUTTER_VERSION_MAJOR@
|
||||||
#define CUTTER_VERSION_MINOR $$CUTTER_VERSION_MINOR
|
#define CUTTER_VERSION_MINOR @CUTTER_VERSION_MINOR@
|
||||||
#define CUTTER_VERSION_PATCH $$CUTTER_VERSION_PATCH
|
#define CUTTER_VERSION_PATCH @CUTTER_VERSION_PATCH@
|
||||||
|
|
||||||
#define CUTTER_VERSION_FULL \"$${CUTTER_VERSION_MAJOR}.$${CUTTER_VERSION_MINOR}.$${CUTTER_VERSION_PATCH}\"
|
#define CUTTER_VERSION_FULL "@CUTTER_VERSION_FULL@"
|
||||||
|
|
||||||
#define CUTTER_EXTRA_PLUGIN_DIRS \"$${CUTTER_EXTRA_PLUGIN_DIRS}\"
|
#define CUTTER_EXTRA_PLUGIN_DIRS "@CUTTER_EXTRA_PLUGIN_DIRS@"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
#ifndef CUTTER_CONFIG_H
|
|
||||||
#define CUTTER_CONFIG_H
|
|
||||||
|
|
||||||
#define CUTTER_VERSION_MAJOR @CUTTER_VERSION_MAJOR@
|
|
||||||
#define CUTTER_VERSION_MINOR @CUTTER_VERSION_MINOR@
|
|
||||||
#define CUTTER_VERSION_PATCH @CUTTER_VERSION_PATCH@
|
|
||||||
|
|
||||||
#define CUTTER_VERSION_FULL "@CUTTER_VERSION_MAJOR@.@CUTTER_VERSION_MINOR@.@CUTTER_VERSION_PATCH@"
|
|
||||||
|
|
||||||
#endif
|
|
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
generator-set = shiboken
|
generator-set = shiboken
|
||||||
|
|
||||||
header-file = $${BINDINGS_SRC_DIR}/bindings.h
|
header-file = ${BINDINGS_SRC_DIR}/bindings.h
|
||||||
typesystem-file = $${BINDINGS_SRC_DIR}/bindings.xml
|
typesystem-file = ${BINDINGS_SRC_DIR}/bindings.xml
|
||||||
|
|
||||||
output-directory = $${BINDINGS_BUILD_DIR}
|
output-directory = ${BINDINGS_BUILD_DIR}
|
||||||
|
|
||||||
include-path = $${BINDINGS_INCLUDE_DIRS}
|
include-path = ${BINDINGS_INCLUDE_DIRS}
|
||||||
|
|
||||||
typesystem-paths = $${PYSIDE_TYPESYSTEMS}
|
typesystem-paths = ${PYSIDE_TYPESYSTEMS}
|
||||||
|
|
||||||
enable-parent-ctor-heuristic
|
enable-parent-ctor-heuristic
|
||||||
enable-pyside-extensions
|
enable-pyside-extensions
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
bindings_xml = configure_file(input: 'bindings.xml',
|
|
||||||
output: 'bindings.xml',
|
|
||||||
copy: true)
|
|
||||||
|
|
||||||
conf_json = '''{"BINDINGS_SRC_DIR":"@0@",
|
|
||||||
"BINDINGS_BUILD_DIR":"@1@",
|
|
||||||
"BINDINGS_INCLUDE_DIRS":"@2@",
|
|
||||||
"PYSIDE_TYPESYSTEMS":"@3@"}'''.format(
|
|
||||||
meson.current_source_dir(),
|
|
||||||
meson.current_build_dir(),
|
|
||||||
':'.join(bindings_generate_inc),
|
|
||||||
pyside_dep.get_pkgconfig_variable('typesystemdir'))
|
|
||||||
bindings_txt = configure_file(input: 'bindings.txt.in',
|
|
||||||
output: 'bindings.txt',
|
|
||||||
command: configure_qmake_cmd + ['@INPUT@', '@OUTPUT0@', conf_json])
|
|
||||||
|
|
||||||
bindings_h = files('bindings.h')
|
|
||||||
|
|
||||||
subdir('CutterBindings')
|
|
@ -1,103 +0,0 @@
|
|||||||
win32 {
|
|
||||||
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
|
|
||||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
|
||||||
LIBS += -L"$$PWD/../rz_dist/lib"
|
|
||||||
RZ_INCLUDEPATH += "$$PWD/../rz_dist/include/librz"
|
|
||||||
RZ_INCLUDEPATH += "$$PWD/../rz_dist/include/librz/sdb"
|
|
||||||
INCLUDEPATH += $$RZ_INCLUDEPATH
|
|
||||||
|
|
||||||
LIBS += \
|
|
||||||
-lrz_core \
|
|
||||||
-lrz_config \
|
|
||||||
-lrz_cons \
|
|
||||||
-lrz_io \
|
|
||||||
-lrz_util \
|
|
||||||
-lrz_flag \
|
|
||||||
-lrz_asm \
|
|
||||||
-lrz_debug \
|
|
||||||
-lrz_hash \
|
|
||||||
-lrz_bin \
|
|
||||||
-lrz_lang \
|
|
||||||
-lrz_analysis \
|
|
||||||
-lrz_parse \
|
|
||||||
-lrz_bp \
|
|
||||||
-lrz_egg \
|
|
||||||
-lrz_reg \
|
|
||||||
-lrz_search \
|
|
||||||
-lrz_syscall \
|
|
||||||
-lrz_socket \
|
|
||||||
-lrz_fs \
|
|
||||||
-lrz_magic \
|
|
||||||
-lrz_crypto
|
|
||||||
} else {
|
|
||||||
macx|bsd {
|
|
||||||
RZPREFIX=/usr/local
|
|
||||||
} else {
|
|
||||||
RZPREFIX=/usr
|
|
||||||
}
|
|
||||||
USE_PKGCONFIG = 1
|
|
||||||
RZ_USER_PKGCONFIG = $$(HOME)/bin/prefix/rizin/lib/pkgconfig
|
|
||||||
exists($$RZ_USER_PKGCONFIG) {
|
|
||||||
# caution: may not work for cross compilations
|
|
||||||
PKG_CONFIG_PATH=$$PKG_CONFIG_PATH:$$RZ_USER_PKGCONFIG
|
|
||||||
} else {
|
|
||||||
unix {
|
|
||||||
exists($$RZPREFIX/lib/pkgconfig/rz_core.pc) {
|
|
||||||
PKG_CONFIG_PATH=$$PKG_CONFIG_PATH:$$RZPREFIX/lib/pkgconfig
|
|
||||||
} else {
|
|
||||||
LIBS += -L$$RZPREFIX/lib
|
|
||||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz
|
|
||||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz/sdb
|
|
||||||
USE_PKGCONFIG = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
macx {
|
|
||||||
LIBS += -L$$RZPREFIX/lib
|
|
||||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz
|
|
||||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz/sdb
|
|
||||||
USE_PKGCONFIG = 0
|
|
||||||
}
|
|
||||||
bsd {
|
|
||||||
!exists($$PKG_CONFIG_PATH/rz_core.pc) {
|
|
||||||
LIBS += -L$$RZPREFIX/lib
|
|
||||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz
|
|
||||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz/sdb
|
|
||||||
USE_PKGCONFIG = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
INCLUDEPATH += $$RZ_INCLUDEPATH
|
|
||||||
|
|
||||||
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
|
|
||||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
|
||||||
equals(USE_PKGCONFIG, 1) {
|
|
||||||
CONFIG += link_pkgconfig
|
|
||||||
PKGCONFIG += rz_core
|
|
||||||
RZ_INCLUDEPATH = "$$system("pkg-config --variable=includedir rz_core")/librz"
|
|
||||||
RZ_INCLUDEPATH += "$$system("pkg-config --variable=includedir rz_core")/librz/sdb"
|
|
||||||
} else {
|
|
||||||
LIBS += \
|
|
||||||
-lrz_core \
|
|
||||||
-lrz_config \
|
|
||||||
-lrz_cons \
|
|
||||||
-lrz_io \
|
|
||||||
-lrz_flag \
|
|
||||||
-lrz_asm \
|
|
||||||
-lrz_debug \
|
|
||||||
-lrz_hash \
|
|
||||||
-lrz_bin \
|
|
||||||
-lrz_lang \
|
|
||||||
-lrz_parse \
|
|
||||||
-lrz_bp \
|
|
||||||
-lrz_egg \
|
|
||||||
-lrz_reg \
|
|
||||||
-lrz_search \
|
|
||||||
-lrz_syscall \
|
|
||||||
-lrz_socket \
|
|
||||||
-lrz_fs \
|
|
||||||
-lrz_analysis \
|
|
||||||
-lrz_magic \
|
|
||||||
-lrz_util \
|
|
||||||
-lrz_crypto
|
|
||||||
}
|
|
||||||
}
|
|
120
src/meson.build
120
src/meson.build
@ -1,120 +0,0 @@
|
|||||||
project('Cutter', 'cpp', default_options: 'cpp_std=c++11', meson_version: '>=0.47.0')
|
|
||||||
|
|
||||||
qt5_mod = import('qt5')
|
|
||||||
py3_exe = import('python').find_installation('python3')
|
|
||||||
|
|
||||||
qt_modules = []
|
|
||||||
feature_define_args = []
|
|
||||||
if get_option('enable_python')
|
|
||||||
message('Python is enabled')
|
|
||||||
feature_define_args += ['-DCUTTER_ENABLE_PYTHON']
|
|
||||||
|
|
||||||
if get_option('enable_python_bindings')
|
|
||||||
message('Python Bindings are enabled')
|
|
||||||
feature_define_args += ['-DCUTTER_ENABLE_PYTHON_BINDINGS']
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
add_project_arguments(feature_define_args, language: 'cpp')
|
|
||||||
add_project_arguments('-DCUTTER_SOURCE_BUILD', language: 'cpp')
|
|
||||||
|
|
||||||
parse_cmd = [py3_exe, join_paths(meson.current_source_dir(), '../scripts/meson_parse_qmake.py')]
|
|
||||||
configure_qmake_cmd = [py3_exe, join_paths(meson.current_source_dir(), '../scripts/meson_configure_qmake_in.py')]
|
|
||||||
|
|
||||||
qt_modules += run_command(parse_cmd + ['QT'], check: true).stdout().split(';')
|
|
||||||
sources = run_command(parse_cmd + ['SOURCES'], check: true).stdout().split(';')
|
|
||||||
headers = run_command(parse_cmd + ['HEADERS'], check: true).stdout().split(';')
|
|
||||||
ui_files = run_command(parse_cmd + ['FORMS'], check: true).stdout().split(';')
|
|
||||||
qresources = run_command(parse_cmd + ['RESOURCES'], check: true).stdout().split(';')
|
|
||||||
version_major = run_command(parse_cmd + ['CUTTER_VERSION_MAJOR'], check: true).stdout()
|
|
||||||
version_minor = run_command(parse_cmd + ['CUTTER_VERSION_MINOR'], check: true).stdout()
|
|
||||||
version_patch = run_command(parse_cmd + ['CUTTER_VERSION_PATCH'], check: true).stdout()
|
|
||||||
|
|
||||||
conf_json = '''{"CUTTER_VERSION_MAJOR":@0@,
|
|
||||||
"CUTTER_VERSION_MINOR":@1@,
|
|
||||||
"CUTTER_VERSION_PATCH":@2@}'''.format(
|
|
||||||
version_major, version_minor, version_patch)
|
|
||||||
configure_file(input: 'CutterConfig.h.in',
|
|
||||||
output: 'CutterConfig.h',
|
|
||||||
command: configure_qmake_cmd + ['@INPUT@', '@OUTPUT0@', conf_json])
|
|
||||||
conf_inc = include_directories('.')
|
|
||||||
|
|
||||||
sp_dir = join_paths(meson.source_root(), 'subprojects')
|
|
||||||
sp_rizin_dir = join_paths(sp_dir, 'rizin')
|
|
||||||
exists_cmd = '__import__("sys").exit(__import__("os").path.exists("@0@"))'.format(sp_rizin_dir)
|
|
||||||
if run_command(py3_exe, '-c', exists_cmd).returncode() == 0
|
|
||||||
rizin_src_dir = join_paths(meson.source_root(), '..', 'rizin')
|
|
||||||
if host_machine.system() == 'windows'
|
|
||||||
sp_dir = '\\'.join(sp_dir.split('/'))
|
|
||||||
sp_rizin_dir = '\\'.join(sp_rizin_dir.split('/'))
|
|
||||||
rizin_src_dir = '\\'.join(rizin_src_dir.split('/'))
|
|
||||||
link_cmd = ['CMD', '/C', 'MKDIR', sp_dir, '&', 'MKLINK', '/D', sp_rizin_dir, rizin_src_dir]
|
|
||||||
else
|
|
||||||
link_cmd = ['sh', '-c', 'mkdir @0@ ; ln -s @1@ @2@'.format(sp_dir, rizin_src_dir, sp_rizin_dir)]
|
|
||||||
endif
|
|
||||||
run_command(link_cmd, check: true)
|
|
||||||
endif
|
|
||||||
|
|
||||||
librz_dep = dependency('librz',
|
|
||||||
fallback : ['rizin', 'librz_dep'],
|
|
||||||
default_options : ['enable_tests=false'])
|
|
||||||
|
|
||||||
qt5dep = dependency('qt5', modules: qt_modules, main: true)
|
|
||||||
|
|
||||||
deps = [librz_dep, qt5dep]
|
|
||||||
if get_option('enable_python')
|
|
||||||
py3_dep = dependency('python3')
|
|
||||||
deps += [py3_dep]
|
|
||||||
if get_option('enable_python_bindings')
|
|
||||||
shiboken_dep = dependency('shiboken2', method: 'pkg-config')
|
|
||||||
pyside_dep = dependency('pyside2', method: 'pkg-config')
|
|
||||||
pyside_inc_dep = declare_dependency(include_directories: include_directories(join_paths(pyside_dep.get_pkgconfig_variable('includedir'), 'QtCore'),
|
|
||||||
join_paths(pyside_dep.get_pkgconfig_variable('includedir'), 'QtGui'),
|
|
||||||
join_paths(pyside_dep.get_pkgconfig_variable('includedir'), 'QtWidgets')))
|
|
||||||
deps += [shiboken_dep, pyside_dep, pyside_inc_dep]
|
|
||||||
shiboken_exe = shiboken_dep.get_pkgconfig_variable('generator_location')
|
|
||||||
qt5core_dep = dependency('Qt5Core', method: 'pkg-config')
|
|
||||||
bindings_generate_inc = [meson.current_source_dir(),
|
|
||||||
join_paths(meson.current_source_dir(), 'core'),
|
|
||||||
join_paths(meson.current_source_dir(), 'common'),
|
|
||||||
join_paths(meson.current_source_dir(), 'widgets'),
|
|
||||||
join_paths(meson.current_source_dir(), 'plugins'),
|
|
||||||
join_paths(meson.current_source_dir(), 'menus'),
|
|
||||||
join_paths(meson.current_source_dir(), 'subprojects/rizin/librz/include'),
|
|
||||||
join_paths(meson.current_build_dir(), 'subprojects/rizin'),
|
|
||||||
qt5core_dep.get_pkgconfig_variable('includedir'),
|
|
||||||
join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtCore'),
|
|
||||||
join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtGui'),
|
|
||||||
join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtWidgets')]
|
|
||||||
message('bindings_inc: @0@'.format(bindings_generate_inc))
|
|
||||||
subdir('bindings')
|
|
||||||
sources += bindings_target
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
moc_files = qt5_mod.preprocess(
|
|
||||||
moc_headers: headers,
|
|
||||||
ui_files: ui_files,
|
|
||||||
qresources: qresources,
|
|
||||||
moc_extra_arguments: feature_define_args
|
|
||||||
)
|
|
||||||
|
|
||||||
cpp = meson.get_compiler('cpp')
|
|
||||||
|
|
||||||
if host_machine.system() == 'windows'
|
|
||||||
add_project_arguments('-D_CRT_NONSTDC_NO_DEPRECATE', language: 'cpp')
|
|
||||||
add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: 'cpp')
|
|
||||||
add_project_link_arguments(join_paths(py3_exe.get_variable('BINDIR'), 'libs', 'python3.lib'), language: 'cpp')
|
|
||||||
endif
|
|
||||||
|
|
||||||
cutter_exe = executable(
|
|
||||||
'Cutter',
|
|
||||||
moc_files,
|
|
||||||
gui_app: true,
|
|
||||||
sources: sources,
|
|
||||||
include_directories: [
|
|
||||||
include_directories('core', 'common', 'widgets', 'plugins'),
|
|
||||||
conf_inc
|
|
||||||
],
|
|
||||||
dependencies: deps,
|
|
||||||
)
|
|
@ -1,2 +0,0 @@
|
|||||||
option('enable_python', type: 'boolean', value: true)
|
|
||||||
option('enable_python_bindings', type: 'boolean', value: true)
|
|
Loading…
Reference in New Issue
Block a user