@@ -135,24 +135,28 @@ The script **automatically detects** the target architecture from this line in `
135135- **All other expansion levels** → Generates x64 (64-bit) solution
136136
137137To switch architectures:
138+
1381391. Edit `BuildType.h` and change `MQ_EXPANSION_LEVEL` (usually by pulling the emu eqlib branch)
1391402. Run `.\gen_solution.ps1` (automatically detects change and cleans build directory)
140141
141142### Custom Plugin Management
142143
143144**Auto-detection (default):**
145+
144146```powershell
145147# Automatically includes all plugins in plugins/*/
146148.\gen_solution.ps1
147149```
148150
149151**Generate a plugin configuration file:**
152+
150153```powershell
151154# Scan plugins/ and write detected plugins to a file
152155.\gen_solution.ps1 -WritePluginsFile my_plugins.cmake.custom
153156```
154157
155158This creates ` my_plugins.cmake.custom ` (anything with a .custom postfix is ignored by git) with contents like:
159+
156160``` cmake
157161# Auto-generated plugin configuration file
158162# Generated by plugins.cmake
@@ -164,17 +168,20 @@ add_subdirectory("C:/dev/MyCustomPlugin")
164168```
165169
166170** Use a custom plugin list:**
171+
167172``` powershell
168173# Override auto-detection with a custom file
169174.\gen_solution.ps1 -CustomPluginsFile my_plugins.cmake.custom
170175```
171176
172177This allows you to:
178+
173179- Maintain a specific set of plugins across reconfigures
174180- Check in a team plugin list to version control
175181- Easily switch between different plugin sets
176182
177183** Add MQ2Main dependency to custom plugins:**
184+
178185``` powershell
179186# Automatically modify .vcxproj files to add MQ2Main dependency
180187.\gen_solution.ps1 -AddMQ2MainDependency
@@ -285,8 +292,9 @@ JetBrains CLion is a cross-platform IDE with excellent CMake support. Here's how
285292### Step 1: Install Prerequisites
286293
2872941 . ** Install Visual Studio 2022** with C++ desktop development workload (CLion uses MSVC compiler)
288- 2 . ** Install CLion** from https://www.jetbrains.com/clion/
295+ 2 . ** Install CLion** from < https://www.jetbrains.com/clion/ >
2892963 . ** Install Git** and initialize submodules:
297+
290298 ``` powershell
291299 git submodule update --init --recursive
292300 ```
@@ -323,6 +331,7 @@ CLion will open the **CMake tool window** at the bottom. Configure the build:
323331 - Build directory: ` build/solution `
324332
3253333 . ** Add CMake Options** (optional):
334+
326335 ```
327336 -DMQ_BUILD_TESTS=ON
328337 ```
@@ -365,19 +374,23 @@ Attach the debugger by running this configuration.
365374### Step 7: Working with the Project
366375
367376** Building:**
377+
368378- ** Build → Build Project** (Ctrl+F9) - Builds current configuration
369379- ** Build → Rebuild Project** - Clean build
370380
371381** CMake Reload:**
382+
372383- ** Tools → CMake → Reload CMake Project** - Refresh after editing CMakeLists.txt
373384- ** Tools → CMake → Reset Cache and Reload Project** - Clean CMake cache
374385
375386** Finding Files:**
387+
376388- ** Navigate → File** (Ctrl+Shift+N) - Fast file search
377389- ** Navigate → Class** (Ctrl+N) - Search for classes
378390- ** Navigate → Symbol** (Ctrl+Alt+Shift+N) - Search for functions
379391
380392** Code Navigation:**
393+
381394- ** Ctrl+Click** on symbol - Go to definition
382395- ** Ctrl+Alt+B** - Go to implementation
383396- ** Alt+F7** - Find usages
@@ -386,16 +399,19 @@ Attach the debugger by running this configuration.
386399### CLion Tips
387400
388401** Performance Optimization:**
402+
389403- Exclude build directories from indexing:
390404 - ** Right-click ` build/ ` folder** → ** Mark Directory as** → ** Excluded**
391405
392406** Custom Plugin Development:**
407+
393408- Place your plugin in ` plugins/MQ2YourPlugin/ `
394409- Add source files
395410- Reload CMake project
396411- Your plugin appears as a build target automatically
397412
398413** Switching Architectures:**
414+
3994151 . Edit/Pull ` src/eqlib/include/eqlib/BuildType.h `
4004162 . Change ` MQ_EXPANSION_LEVEL `
4014173 . ** Tools → CMake → Reset Cache and Reload Project**
@@ -409,11 +425,13 @@ Attach the debugger by running this configuration.
409425The simplest way to add custom plugins:
410426
4114271 . ** Create plugin directory:**
428+
412429 ```
413430 plugins/MQ2YourPlugin/
414431 ```
415432
4164332 . ** Add source files:**
434+
417435 ```
418436 plugins/MQ2YourPlugin/
419437 ├── MQ2YourPlugin.cpp
@@ -423,6 +441,7 @@ The simplest way to add custom plugins:
423441 ```
424442
4254433 . ** Regenerate solution:**
444+
426445 ``` powershell
427446 .\gen_solution.ps1
428447 ```
@@ -456,6 +475,7 @@ set_target_properties(MQ2YourPlugin PROPERTIES
456475If you have an existing ` .vcxproj ` file:
457476
4584771 . ** Place .vcxproj in plugin directory:**
478+
459479 ```
460480 plugins/MQ2YourPlugin/MQ2YourPlugin.vcxproj
461481 ```
@@ -465,11 +485,13 @@ If you have an existing `.vcxproj` file:
465485 - Toolset: Must be ` v143 ` (Visual Studio 2022)
466486
4674873 . ** Regenerate solution:**
488+
468489 ``` powershell
469490 .\gen_solution.ps1
470491 ```
471492
4724934 . ** Optionally add MQ2Main dependency:**
494+
473495 ``` powershell
474496 .\gen_solution.ps1 -AddMQ2MainDependency
475497 ```
@@ -479,11 +501,13 @@ If you have an existing `.vcxproj` file:
479501For precise control over which plugins are included:
480502
4815031 . ** Generate initial plugin list:**
504+
482505 ``` powershell
483506 .\gen_solution.ps1 -WritePluginsFile my_plugins.cmake.custom
484507 ```
485508
4865092 . ** Edit ` my_plugins.cmake.custom ` :**
510+
487511 ``` cmake
488512 # Custom plugin configuration
489513
@@ -498,11 +522,13 @@ For precise control over which plugins are included:
498522 ```
499523
5005243 . ** Use the custom list:**
525+
501526 ``` powershell
502527 .\gen_solution.ps1 -CustomPluginsFile my_plugins.cmake.custom
503528 ```
504529
5055304 . ** Check in to version control (optional):**
531+
506532 ```
507533 # Team plugin configuration
508534 git add my_plugins.cmake
@@ -518,7 +544,8 @@ For precise control over which plugins are included:
518544** Problem** : Script fails with "CMake is not installed or not in PATH"
519545
520546** Solution** :
521- 1 . Install CMake from https://cmake.org/download/
547+
548+ 1 . Install CMake from < https://cmake.org/download/ >
5225492 . During installation, select "Add CMake to system PATH"
5235503 . Or manually add to PATH: ` C:\Program Files\CMake\bin `
524551
@@ -527,7 +554,8 @@ For precise control over which plugins are included:
527554** Problem** : Script fails with "Git is not installed or not in PATH"
528555
529556** Solution** :
530- 1 . Install Git from https://git-scm.com/
557+
558+ 1 . Install Git from < https://git-scm.com/ >
5315592 . Restart PowerShell
5325603 . Verify: ` git --version `
533561
@@ -536,6 +564,7 @@ For precise control over which plugins are included:
536564** Problem** : ` src/eqlib ` or ` contrib/vcpkg ` directories are empty
537565
538566** Solution** :
567+
539568``` powershell
540569.\gen_solution.ps1 -SyncSubmodules
541570```
@@ -545,6 +574,7 @@ For precise control over which plugins are included:
545574** Problem** : Custom plugin shows "incompatible platform" message
546575
547576** Solution** :
577+
548578- Check plugin ` .vcxproj ` contains the correct platform configuration
549579- For x64 build, must have: ` <ProjectConfiguration Include="Release|x64"> `
550580- For Win32 build, must have: ` <ProjectConfiguration Include="Release|Win32"> `
@@ -554,6 +584,7 @@ For precise control over which plugins are included:
554584** Problem** : Custom plugin shows "incompatible toolset" message
555585
556586** Solution** :
587+
557588- Edit plugin ` .vcxproj `
558589- Find: ` <PlatformToolset>v142</PlatformToolset> ` (or v141, v140, etc.)
559590- Change to: ` <PlatformToolset>v143</PlatformToolset> `
@@ -563,6 +594,7 @@ For precise control over which plugins are included:
563594** Problem** : Changes to CMakeLists.txt not reflected in solution
564595
565596** Solution** :
597+
566598``` powershell
567599# Clear cache and regenerate
568600.\gen_solution.ps1 -Clean
@@ -574,6 +606,7 @@ For precise control over which plugins are included:
574606** Problem** : Building for x64 when you need Win32 (or vice versa)
575607
576608** Solution** :
609+
5776101 . Check ` src/eqlib/include/eqlib/BuildType.h `
5786112 . Verify ` MQ_EXPANSION_LEVEL ` is set correctly
579612 - ROF = Win32
@@ -586,6 +619,7 @@ For precise control over which plugins are included:
586619** "Cannot find Visual Studio"**
587620
588621** Solution** :
622+
589623- Install Visual Studio 2022 with C++ Desktop Development
590624- CLion → Settings → Build, Execution, Deployment → Toolchains
591625- Verify "Visual Studio" toolchain is detected
@@ -594,13 +628,15 @@ For precise control over which plugins are included:
594628** "CMake project not loaded"**
595629
596630** Solution** :
631+
597632- File → Reload CMake Project
598633- Or: Tools → CMake → Reload CMake Project
599634- Check CMake tool window for errors
600635
601636** "Indexing takes forever"**
602637
603638** Solution** :
639+
604640- Right-click ` build/ ` → Mark Directory as → Excluded
605641- Right-click ` contrib/vcpkg/ ` → Mark Directory as → Excluded
606642- File → Invalidate Caches / Restart
@@ -612,6 +648,7 @@ For precise control over which plugins are included:
612648### For Developers
613649
6146501 . ** Always regenerate after pulling upstream changes:**
651+
615652 ``` powershell
616653 git pull
617654 .\gen_solution.ps1
@@ -643,12 +680,14 @@ For precise control over which plugins are included:
643680 - Let CMake handle integration
644681
6456823 . ** Test both Debug and Release builds:**
683+
646684 ``` powershell
647685 cmake --build build --config Debug
648686 cmake --build build --config Release
649687 ```
650688
6516894 . ** Link against MQ2Main and pluginapi, not eqlib:**
690+
652691 ``` cmake
653692 target_link_libraries(YourPlugin PRIVATE MQ2Main)
654693 target_link_libraries(YourPlugin PRIVATE pluginapi)
@@ -658,6 +697,7 @@ For precise control over which plugins are included:
658697### For Teams
659698
6606991 . ** Use custom plugin list for shared configuration:**
700+
661701 ``` powershell
662702 # Generate team plugin list
663703 .\gen_solution.ps1 -WritePluginsFile team_plugins.cmake
@@ -673,6 +713,7 @@ For precise control over which plugins are included:
6737132 . ** Document team-specific CMake options in README**
674714
6757153 . ** Consider Using CI/CD with CMake command-line builds:**
716+
676717 ``` yaml
677718 # GitHub Actions example
678719 - run : cmake -B build -G "Visual Studio 17 2022" -A x64
@@ -681,16 +722,6 @@ For precise control over which plugins are included:
681722
682723---
683724
684- ## Next Steps
685-
686- - **Detailed CMake documentation**: See [CMAKE_BUILD.md](CMAKE_BUILD.md)
687- - **Build workflow documentation**: See [BUILD_WORKFLOWS.md](BUILD_WORKFLOWS.md)
688- - **Plugin development guide**: See [PLUGIN_TEMPLATE.md](PLUGIN_TEMPLATE.md)
689- - **Migration from .vcxproj**: See [MIGRATION_GUIDE.md](MIGRATION_GUIDE.md)
690- - **Full MacroQuest docs**: https://docs.macroquest.org
691-
692- ---
693-
694725## Summary
695726
696727- **Use ` gen_solution.ps1`** for convenient, automated builds
0 commit comments