Skip to content

Commit 93363fa

Browse files
committed
doc: Improve cmake instructions in README
1 parent 8deef00 commit 93363fa

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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
83+
$ cmake --build build
84+
$ ctest --test-dir build # run the test suite
85+
$ sudo cmake --install build # 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 --build 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 --build 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

0 commit comments

Comments
 (0)