-
Notifications
You must be signed in to change notification settings - Fork 25
CMake Intro
To build Road Runner, you will have to use CMake or similar build tool. If you haven't used CMake, it's pretty simple.
Simply put, CMake is a tool that tells your computer's compiler how to link all of your files together, thanks to the help of different CMakeLists.txt
files throughout your project.
This allows a project to compiled natively on each platform, while still keeping the repository platform independent
First, download CMake from the internet. The GUI is easy to use, and will do the job just fine for compiling roadrunner.
When you open up the GUI, it has two address lines at the top for the source and build directories. First enter the directory name for the top level directory in your project. This must have a CMakeLists.txt
file in it.
Next, enter the build directory, which is most likely a directory that you will have to create. It might be a folder under the top-level directory called build
, or like in the case of roadrunner, you may have a directory completely separate from the sources.
CMake allows you to choose a generator for different IDEs and platforms, so that you can generate build files that will work with your preferred development environment. It will prompt you to choose which generator you want to use for this project when you click "configure".
Next just press configure in the bottom left. It should load in the settings, and show what each of their values is. Some of these settings you may have to adjust after loading them in. For example, in roadrunner, you usually have to change the CMAKE_INSTALL_PREFIX
parameter, because it defaults to a write protected directory.
Once all errors have been resolved, click "generate", and you may now open the project files that were created in your build directory.
CMake generates your build files in the build directory, but it also stores the settings that you specified through the GUI there. Sometimes you may make a mistake, and want to reset the cache, which can be done by clicking File->Delete Cache