Skip to content

Commit 2ac9f55

Browse files
committed
doc: Improve cmake instructions in README
1 parent 8deef00 commit 2ac9f55

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ Implementation details
6464
Building with Autotools
6565
-----------------------
6666

67-
$ ./autogen.sh
68-
$ ./configure
69-
$ make
70-
$ make check # run the test suite
71-
$ sudo make install # optional
67+
$ ./autogen.sh # Generate a ./configure script
68+
$ ./configure # Generate a build system
69+
$ make # Run the actual build process
70+
$ make check # Run the test suite
71+
$ sudo make install # Install the library into the system (optional)
7272

7373
To compile optional modules (such as Schnorr signatures), you need to run `./configure` with additional flags (such as `--enable-module-schnorrsig`). Run `./configure --help` to see the full list of available flags.
7474

@@ -79,24 +79,23 @@ To maintain a pristine source tree, CMake encourages to perform an out-of-source
7979

8080
### Building on POSIX systems
8181

82-
$ mkdir build && cd build
83-
$ cmake ..
84-
$ cmake --build .
85-
$ ctest # run the test suite
86-
$ sudo cmake --install . # optional
82+
$ cmake -B build # Generate a build system in subdirectory "build"
83+
$ cmake --build build # Run the actual build process
84+
$ ctest --test-dir build # Run the test suite
85+
$ sudo cmake --install build # Install the library into the system (optional)
8786

88-
To compile optional modules (such as Schnorr signatures), you need to run `cmake` with additional flags (such as `-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON`). Run `cmake .. -LH` to see the full list of available flags.
87+
To compile optional modules (such as Schnorr signatures), you need to run `cmake` with additional flags (such as `-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON`). Run `cmake -B build -LH` or `ccmake -B build` to see the full list of available flags.
8988

9089
### Cross compiling
9190

9291
To alleviate issues with cross compiling, preconfigured toolchain files are available in the `cmake` directory.
9392
For example, to cross compile for Windows:
9493

95-
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/x86_64-w64-mingw32.toolchain.cmake
94+
$ cmake -B build -DCMAKE_TOOLCHAIN_FILE=cmake/x86_64-w64-mingw32.toolchain.cmake
9695

9796
To cross compile for Android with [NDK](https://developer.android.com/ndk/guides/cmake) (using NDK's toolchain file, and assuming the `ANDROID_NDK_ROOT` environment variable has been set):
9897

99-
$ cmake .. -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=28
98+
$ cmake -B build -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=28
10099

101100
### Building on Windows
102101

@@ -106,7 +105,7 @@ The following example assumes using of Visual Studio 2022 and CMake v3.21+.
106105

107106
In "Developer Command Prompt for VS 2022":
108107

109-
>cmake -G "Visual Studio 17 2022" -A x64 -S . -B build
108+
>cmake -G "Visual Studio 17 2022" -A x64 -B build
110109
>cmake --build build --config RelWithDebInfo
111110

112111
Usage examples

0 commit comments

Comments
 (0)