-
Notifications
You must be signed in to change notification settings - Fork 23
Build on any OS with CLion
Chnoblouch edited this page Nov 2, 2021
·
20 revisions
- All C++ projects can also be built with the platform-independent IDE CLion from JetBrains. The advantage is that CLion uses cmake directly and does not create an additional project definition. For Windows without Visual Studio download the MinGW version with the GNU toolchain. For Windows, we recommend to build and work with Visual Studio.
- Clone the SLProject GIT repository into a directory of your choice.
- Open the CLion IDE.
- Choose Import Project from Sources on the Welcome screen.
- Select the top-level CMakeLists.txt file in the SLProject root folder.
- Choose Open Existing Project
- Wait for the configuration to complete.
- Press the Hammer Button on the top toolbar to build all projects.
-
Note: CLion on Windows uses NMake as the default build system. NMake doesn't support parallel builds, which makes the compilation process incredibly slow. It's highly recommended that you switch to a better build system such as Ninja.
- Go to File > Settings... > Build, Execution, Deployment > CMake
- Add -G Ninja to the CMake options of the Debug configuration
-
Note: CLion on Windows uses NMake as the default build system. NMake doesn't support parallel builds, which makes the compilation process incredibly slow. It's highly recommended that you switch to a better build system such as Ninja.
- Press the Run Button on the top toolbar to run the selected app|configuration.
- The CLion defines by default only the Debug configuration. The Release configuration has to be added manually:
- Go to File > Settings... > Build, Execution, Deployment > CMake
- Press the + button to add a new configuration (CLion automatically chooses the Release configuration)
- Add the CMake option -G Ninja if you use Windows and want to run parallel builds
- Press on OK