cutter/docs/Compiling-with-CMake.md

34 lines
1.3 KiB
Markdown
Raw Normal View History

2017-09-27 21:40:54 +00:00
# Compiling with CMake
The "official" way to build Cutter is by using qmake, but as an alternative, a [CMakeLists.txt](https://github.com/radareorg/cutter/blob/master/src/CMakeLists.txt) is provided, so CMake can be used as well.
2017-09-27 21:40:54 +00:00
This page provides a guide to compile on **Linux** or **macOS**, the process for Windows is described in [Compiling-on-Windows.md](Compiling-on-Windows.md).
2017-09-27 21:40:54 +00:00
## Requirements
* CMake >= 3.1
* Radare2 installed from submodule, see [README.md](https://github.com/radareorg/cutter#requirements)
* Qt 5.9.1
2017-09-27 21:40:54 +00:00
## Building
The root for CMake is in src/. In-source builds are **not allowed**, so you **must** run CMake from a separate directory:
```
cd src
mkdir build
cd build
cmake ..
```
If all went well, you should now have a working Makefile in your build directory:
```
make
```
## Troubleshooting
Depending on how Qt installed (Distribution packages or using the Qt installer application), CMake may not be able to find it by itself if it is not in a common place. If that is the case, double check that the correct Qt version is installed. Locate its prefix (a directory containing bin/, lib/, include/, etc.) and specify it to CMake using `CMAKE_PREFIX_PATH` in the above process, e.g.:
2017-09-27 21:40:54 +00:00
```
rm CMakeCache.txt # the cache may be polluted with unwanted libraries found before
cmake -DCMAKE_PREFIX_PATH=/opt/Qt/5.9.1/gcc_64 ..
```