diff --git a/readme.md b/readme.md index a902f9fd2ef..196a8d8bb1c 100644 --- a/readme.md +++ b/readme.md @@ -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` -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 @@ -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 +``` + ### 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. diff --git a/readmeja.md b/readmeja.md index 6d9dae60c95..1efcd722552 100644 --- a/readmeja.md +++ b/readmeja.md @@ -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` コマンドで) を使用できます。 +`-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