rizinorg / rz-ghidra

Deep ghidra decompiler and sleigh disassembler integration for rizin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build cutter plugin "Could not find a package configuration file provided by 'Cutter'"

msmit5 opened this issue · comments

commented

Hello,

I have been trying to install this as a cutter plugin. I have installed both cutter and rizin from source, and I have managed to install this as a standard rizin plugin without any issues.

However, I cannot build this as a cutter plugin.

commands I have tried

  1. cmake -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_CUTTER_PLUGIN=ON ..
  2. PKG_CONFIG_PATH=~/.local/share/rizin/cutter/plugins/lib/pkgconfig cmake -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_CUTTER_PLUGIN=ON ..
  3. cmake -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_CUTTER_PLUGIN=ON -DCUTTER_SOURCE_DIR=~/gitClones/cutter ..
  4. PKG_CONFIG_PATH=~/.local/share/rizin/cutter/plugins/lib/pkgconfig cmake -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_CUTTER_PLUGIN=ON -DCUTTER_SOURCE_DIR=~/gitClones/cutter ..

error:

  By not providing "FindCutter.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Cutter", but
  CMake did not find one.

  Could not find a package configuration file provided by "Cutter" with any
  of the following names:

    CutterConfig.cmake
    cutter-config.cmake

  Add the installation prefix of "Cutter" to CMAKE_PREFIX_PATH or set
  "Cutter_DIR" to a directory containing one of the above files.  If "Cutter"
  provides a separate development package or SDK, be sure it has been
  installed.
  • What plugin are you trying to build? Sorry, didn't notice that this issue is in rz-ghidra repo.
  • How exactly did you build and install Cutter?

Guessing that you installed Cutter in something like "~/.local". You are probably missing something like -DCMAKE_PREFIX_PATH=~/.local. (After writing this comment I noticed that it's also exactly what the cmake error message suggests you to do).

commented

I built cutter from source as instructed in the cutter documentation. I built it as described in the cutter docs here. My command was cmake -B build -DCUTTER_ENABLE_PYTHON=ON -DCUTTER_ENABLE_PYTHON_BINDINGS=ON -DCUTTER_ENABLE_KSYNTAXHIGHLIGHTING=ON -DCUTTER_ENABLE_GRAPHVIZ=ON ..

I did not place the cutter binary anywhere special. I left it in the build folder because I was planning on just creating a desktop file that pointed there.

As for adding -DCMAKE_PREFIX_PATH=~/.local, to my command, it does not make it work, and I get the same error. The full command I used is cmake -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_CUTTER_PLUGIN=ON DCUTTER_SOURCE_DIR=~/gitClones/cutter -DCMAKE_PREFIX_PATH=~/.local ..

Yes it will not work unless you put the correct path there. "~/.local" was just an example. You need to use the path you used for installing Cutter, which is difficult to do if you compiled cutter without performing install step. Build instructions in the readme of this repository also say that.
image
Although if you consistently installed everything in same place it's likely that you wouldn't need to manually specify as much stuff.

Where did you find instructions with DCUTTER_SOURCE_DIR? It hasn't been a thing for quite some time. Let us of know if there is any outdated documentation still referring to the old setting.

By the way is there a reason you are compiling stuff yourself instead of using prebuilt package from cutter CI? It should have rz-ghidra included. I assume you already know where the release page is and if you want something newer than last release you can get the dev builds from https://github.com/rizinorg/cutter/actions/workflows/ci.yml .

commented

Thanks for the help!

I managed to get it installed and working properly!

As for the instructions with the DCUTTER_SOURCE_DIR, I found that in a github issue when I was troubleshooting. I did not see it in the docs.

There are two reasons I was compiling from source. First, when I learned about radare2, a common piece of advice I saw was to build from source instead of using the prebuilt packages, and I figured I'd do the same thing with rizin and related tools. Second, I also wanted the most up to date binaries.

Thanks for the tip that there are dev builds. I was not aware they existed, and as I said, I wanted the most up to date binaries. I'll keep that in mind for the future.