Skip to content

Commit 7dc750c

Browse files
committed
Explain the release build. And also how-to install Cppcheck
1 parent 4031d17 commit 7dc750c

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

readme.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,17 @@ cmake -S . -B build
5959
cmake --build build
6060
```
6161

62-
If you want to compile the GUI you can use the flag.
63-
-DBUILD_GUI=ON
62+
The default build type is `Debug` if you want a `Release` build you can use the flag (on the first `cmake` command above): `-DCMAKE_BUILD_TYPE=Release`
6463

65-
For rules support (requires pcre) use the flag.
66-
-DHAVE_RULES=ON
64+
For release builds it is recommended that you use: `-DUSE_MATCHCOMPILER=ON`
6765

68-
For release builds it is recommended that you use:
69-
-DUSE_MATCHCOMPILER=ON
66+
If you want to compile the GUI you can use the flag: `-DBUILD_GUI=ON`
7067

71-
For building the tests use the flag.
72-
-DBUILD_TESTS=ON
68+
For rules support (requires pcre) use the flag: `-DHAVE_RULES=ON`
7369

74-
Using cmake you can generate project files for Visual Studio,XCode,etc.
70+
For building the tests use the flag: `-DBUILD_TESTS=ON`
71+
72+
By using cmake you can generate project files for Visual Studio, XCode, etc.
7573

7674
#### Building a specific configuration
7775

@@ -89,6 +87,14 @@ cmake -S . -B build
8987
cmake --build build --config RelWithDebInfo
9088
```
9189

90+
#### Installation
91+
92+
After you compiled your binary you can run the followning cmake command to install Cppcheck:
93+
94+
```shell
95+
sudo cmake --install build
96+
```
97+
9298
### Visual Studio
9399

94100
Use the cppcheck.sln file. The file is configured for Visual Studio 2019, but the platform toolset can be changed easily to older or newer versions. The solution contains platform targets for both x86 and x64.

readmeja.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,32 @@ GUIも利用する場合、Qtライブラリが必要です。
3535
cmakeでCppcheckをコンパイルする例
3636

3737
```shell
38-
mkdir build
39-
cd build
40-
cmake ..
41-
cmake --build .
38+
cmake -S . -B build
39+
cmake --build build
4240
```
4341

42+
デフォルトのビルドタイプは `Debug` です。`Release` ビルドが必要な場合は、ビルドフラグ (上記の最初の `cmake` コマンドで) を使用できます。
43+
`-DCMAKE_BUILD_TYPE=Release`
44+
45+
リリース ビルドの場合は以下を使用することをお勧めします。
46+
`-DUSE_MATCHCOMPILER=ON`
47+
4448
C++標準を指定する必要がある場合次のオプションを指定します。
45-
-DCMAKE_CXX_STANDARD=11
49+
`-DCMAKE_CXX_STANDARD=11`
4650

4751
CppcheckのGUIが必要な場合次のフラグを指定します。
48-
-DBUILD_GUI=ON
52+
`-DBUILD_GUI=ON`
4953

5054
pcreが必要になりますが、正規表現のルールサポートが必要な場合次のフラグを指定します。
51-
-DHAVE_RULES=ON
55+
`-DHAVE_RULES=ON`
56+
57+
#### インストール
58+
59+
バイナリをコンパイルしたら、以下の cmake コマンドを実行して Cppcheck をインストールできます。
60+
61+
```shell
62+
sudo cmake --install build
63+
```
5264

5365
### Visual Studio
5466

0 commit comments

Comments
 (0)