Skip to content

Commit c94c4e6

Browse files
Update CLion and MSVC6 build instructions for new CMake configuration (#37)
1 parent 15987d9 commit c94c4e6

File tree

2 files changed

+31
-39
lines changed

2 files changed

+31
-39
lines changed

SourceCode/Builds/build_with_clion_vc6_toolchain.md

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
1. **CLion** installed and configured.
66
2. **Microsoft Visual C++ 6.0 (VC6)** installed (assuming it’s installed in the
77
default directory).
8-
3. **CMake** installed and configured.
9-
4. **Source code** of the project cloned from the TheSuperHackers repository.
8+
3. **Source code** of the project cloned from the TheSuperHackers repository.
109

1110
## Step 1: Setting Up the Toolchain in CLion
1211

13-
1. Open **CLion** and go to **File** -> **Settings** -> **Build, Execution,
12+
1. Open the cloned folder in **CLion** and go to **File** -> **Settings** -> **Build, Execution,
1413
Deployment** -> **Toolchains**.
1514
2. Add a new **Toolchain** by clicking the **+** button.
1615
3. Select **System** as the Type (not Visual Studio).
17-
4. Next to the toolchain name, add the **environment** file by clicking the
16+
4. Rename the toolchain to **Visual Studio 6**
17+
5. Next to the toolchain name, add the **environment** file by clicking the
1818
**+** button and pointing to the following file:
1919

2020
```text
2121
C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT
2222
```
2323

24-
5. Set the paths for the tools:
24+
6. Set the paths for the tools:
2525
- **Build Tool**: Choose the `NMAKE.EXE` file from VC6. For example:
2626

2727
```text
@@ -39,39 +39,31 @@
3939
4040
## Step 2: Configuring the CMake Profile
4141
42-
1. Go to **File** -> **Settings** -> **Build, Execution, Deployment** -> **CMake**.
43-
2. In this window, select the CMake profile you want to configure (if there
44-
isn’t one, create a new one).
45-
3. Choose the **Toolchain** you created in the previous step (VC6 Toolchain).
46-
4. Choose the **Generator** as `NMake Makefiles`.
47-
5. Under **CMake options**, add the following generate settings:
42+
1. In Cmake profiles, enable the profiles you want to use, like vc6, vc6dgb, vc6int, vc6prof.
4843
49-
```text
50-
-G "NMake Makefiles"
51-
```
44+
## step 3: Configuring the installation path
5245
53-
Be careful not to set `Preset`, as it will override the generator settings.
54-
6. Add the build directory path under **CMake Build Directory**:
46+
1. In the target application options, do the following:
5547
56-
```text
57-
C:\Users\User\Documents\CLion\CnC_Generals_Zero_Hour\build\vc6
58-
```
48+
- Set Program arguments with your favorite arguments,like `-win, -quickstart, -nologo`.
49+
- Set Working directory to the game directory.
50+
- Check the run as administrator option.
51+
- In 'Before launch' section, add a new 'install' step.
52+
- To avoid duplication build, remove the 'Build' step.
53+
- Save the configuration, and you are ready to build and run the project.
5954
60-
## Step 3: Compiling and Running the Project
55+
## Step 4: Compiling and Running the Project
6156
62-
1. Now, click the **Build** button in CLion.
63-
2. CLion will start the build process using the VC6 (x86) toolchain.
64-
3. Once the build is successfully completed, a **zerohour.exe** file will be generated.
65-
4. You need to copy the **zerohour.exe** file to the appropriate game directory in order to run the game.
57+
1. Now, click the **Build** button in CLion, or click **Install** in build menu.
58+
2. CLion will start the build/install process using the VC6 (x86) toolchain.
59+
3. Once the build is successfully completed, a executable file will be generated (and installed in the game directory).
6660
6761
---
6862
6963
## Notes
7064
71-
- **Visual C++ 6.0 (VC6)** only supports C++98, so avoid using modern C++ features.
7265
- Working with VC6 requires some adjustments, so it’s always a good idea to check
73-
that the toolchain is working
74-
properly.
66+
that the toolchain is working properly.
7567
- You can add Release and Debug profiles in CLion to build the project in
7668
different configurations.
77-
- Admin rights might be required to run VC6 tools, so make sure to run CLion as an administrator.
69+
- Admin rights might be required to run VC6 tools, so make sure to run CLion as an administrator if needed.

SourceCode/Builds/build_with_msvc6.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This steps you need to repeat every time after a reboot of your computer.
6464

6565
### Option 1: Activate your VS6 Compiler Environment
6666

67-
Execute the setup build environment script. In your cmd type this.
67+
Execute the setup build environment script. In your cmd type this. (assuming default installation path)
6868

6969
`"C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.bat"`
7070

@@ -102,21 +102,21 @@ set CXX=C:\<VS6_INSTALL_PATH>\VC98\Bin\CL.exe
102102
set MSVCDir=C:\<VS6_INSTALL_PATH>\VC98
103103
```
104104

105-
### Compiling
105+
### Build the project
106106

107-
`cmake --preset vc6`
107+
Run the following command by the type of build you want to create.
108108

109-
`cd build\vc6`
109+
- `cmake --workflow --preset vc6` for a release build.
110+
- `cmake --workflow --preset vc6dgb` for a debug build.
111+
- `cmake --workflow --preset vc6int` for an internal build.
112+
- `cmake --workflow --preset vc6prof` for a profile build.
110113

111-
`nmake`
114+
You will find a bunch of files in `build\vc6\<game name>` and a file called `generalszh.exe` or `generalsv.exe`.
112115

113-
You will find a bunch of files in `build\vc6` and a file called `zerohour.exe`
116+
### Install the game executable
114117

115-
Copy `zerohour.exe` of the build folder to your game path.
116-
117-
## Start the game
118-
119-
Double click `zerohour.exe` inside the Zero Hour path.
118+
Run `cmake --install build\<vc6 build type>`, this will copy the executable to the retail game directory, or you can
119+
copy it manually.
120120

121121
## Troubleshooting
122122

0 commit comments

Comments
 (0)