From 8f156298afcec5a045223e19c8216cee98ad55f3 Mon Sep 17 00:00:00 2001 From: nerix Date: Sat, 26 Mar 2022 15:14:26 +0100 Subject: [PATCH] docs(building): add instructions for CLion on Windows (#3626) Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> --- BUILDING_ON_WINDOWS.md | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/BUILDING_ON_WINDOWS.md b/BUILDING_ON_WINDOWS.md index 304f2d2d0..6832581f2 100644 --- a/BUILDING_ON_WINDOWS.md +++ b/BUILDING_ON_WINDOWS.md @@ -132,3 +132,59 @@ Open up your terminal with the Visual Studio environment variables, then enter t 2. `cd build` 3. `cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_CONAN=ON ..` 4. `nmake` + +## Building/Running in CLion + +_Note:_ We're using `build` instead of the CLion default `cmake-build-debug` folder. + +Install [conan](https://conan.io/downloads.html) and make sure it's in your `PATH` (default setting). + +Clone the repository as described in the readme. Open a terminal in the cloned folder and enter the following commands: + +1. `mkdir build && cd build` +2. `conan install .. -s build_type=Debug` + +Now open the project in CLion. You will be greeted with the _Open Project Wizard_. Set the _CMake Options_ to + +``` +-DCMAKE_PREFIX_PATH=C:\Qt\5.15.2\msvc2019_64\lib\cmake\Qt5 +-DUSE_CONAN=ON +-DCMAKE_CXX_FLAGS=/bigobj +``` + +and the _Build Directory_ to `build`. + +
+Screenshot of CMake configuration + +![Screenshot CMake configuration](https://user-images.githubusercontent.com/41973452/160240561-26ec205c-20af-4aa5-a6a3-b87a27fc16eb.png) + +
+ +After the CMake project is loaded, open the _Run/Debug Configurations_. + +Select the `CMake Applications > chatterino` configuration and add a new _Run External tool_ task to _Before launch_. + +- Set the _Program_ to `C:\Qt\5.15.2\msvc2019_64\bin\windeployqt.exe` +- Set the _Arguments_ + to `$CMakeCurrentProductFile$ --debug --no-compiler-runtime --no-translations --no-opengl-sw --dir bin/` +- Set the _Working directory_ to `$ProjectFileDir$\build` + +
+Screenshot of External tool + +![Screenshot of External Tool](https://user-images.githubusercontent.com/41973452/160240818-f4b41525-3de9-4e3d-8228-98beab2a3ead.png) + +
+ +
+Screenshot of chatterino configuration + +![Screenshot of chatterino configuration](https://user-images.githubusercontent.com/41973452/160240843-dc0c603c-227f-4f56-98ca-57f03989dfb4.png) + +
+ +Now you can run the `chatterino | Debug` configuration. + +If you want to run the portable version of Chatterino, create a file called `modes` inside of `build/bin` and +write `portable` into it.