Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,17 @@ cmake -S . -B build
cmake --build build
```

If you want to compile the GUI you can use the flag.
-DBUILD_GUI=ON
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`

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

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

For building the tests use the flag.
-DBUILD_TESTS=ON
For rules support (requires pcre) use the flag: `-DHAVE_RULES=ON`
Copy link
Contributor

@autoantwort autoantwort Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use this change to explain what rules are and if one should enable it or not.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for information my idea is to get rid of pcre and use std::regex instead. the pcre library we use is end of life. there is work in progress..


Using cmake you can generate project files for Visual Studio,XCode,etc.
For building the tests use the flag: `-DBUILD_TESTS=ON`

By using cmake you can generate project files for Visual Studio, XCode, etc.

#### Building a specific configuration

Expand All @@ -89,6 +87,14 @@ cmake -S . -B build
cmake --build build --config RelWithDebInfo
```

#### Installation

After you compiled your binary you can run the followning cmake command to install Cppcheck:

```shell
sudo cmake --install build
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo only applies to linux (and mac?)

this is a "rough" installation in my humble opinion. a package should be used.

Copy link
Author

@melroy89 melroy89 Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for installing the compiled source code. That's why it's under compile. Currently you don't explain it.

This is not meant for users who just download and install the package. But again this is part under the Compile section.

Copy link
Owner

@danmar danmar Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think that users also read this readme sometimes. and I fear that some users might think it's officially supported approach to run cmake --install because we talk about it here. Imho a proper installation package should be created instead.

I'd rather discourage that cmake --install is used. I'm not sure if we actively maintain and test at all. @firewave do you have any feeling about how robust it is?

As a developer I want to know how to compile Cppcheck. I feel that it makes sense to tell users/developers how to compile their own copy of cppcheck in this readme.

Copy link
Author

@melroy89 melroy89 Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fully understand you. I thought about that already. Hence I start my sentence again repeating it's about compiling: "After you compiled your binary"

```

### Visual Studio

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.
Expand Down
26 changes: 19 additions & 7 deletions readmeja.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,32 @@ GUIも利用する場合、Qtライブラリが必要です。
cmakeでCppcheckをコンパイルする例

```shell
mkdir build
cd build
cmake ..
cmake --build .
cmake -S . -B build
cmake --build build
```

デフォルトのビルドタイプは `Debug` です。`Release` ビルドが必要な場合は、ビルドフラグ (上記の最初の `cmake` コマンドで) を使用できます。
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know japanese well?

Copy link
Author

@melroy89 melroy89 Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I'm wondering why you have a japense readme if you don't speak it 🤣? The Japanese readme is very outdated actually.

Copy link
Owner

@danmar danmar Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know any japanese.

It has been updated now and then by a japanese guy. I don't want to have some auto translations that we don't know if they are proper or not. So the choice should be either to:

  • find somebody that really speaks japanese that wants to maintain this
  • remove it

@fu7mu4 are you interested to review/update the file?

`-DCMAKE_BUILD_TYPE=Release`

リリース ビルドの場合は以下を使用することをお勧めします。
`-DUSE_MATCHCOMPILER=ON`

C++標準を指定する必要がある場合次のオプションを指定します。
-DCMAKE_CXX_STANDARD=11
`-DCMAKE_CXX_STANDARD=11`

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

pcreが必要になりますが、正規表現のルールサポートが必要な場合次のフラグを指定します。
-DHAVE_RULES=ON
`-DHAVE_RULES=ON`

#### インストール

バイナリをコンパイルしたら、以下の cmake コマンドを実行して Cppcheck をインストールできます。

```shell
sudo cmake --install build
```

### Visual Studio

Expand Down
Loading