Skip to content

Commit 5f91708

Browse files
committed
Simplify build instructions
1 parent 456cee0 commit 5f91708

File tree

3 files changed

+18
-27
lines changed

3 files changed

+18
-27
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,16 @@ jobs:
7777
- name: CMake Configure
7878
run: |
7979
set -x
80-
rm -rf .build
81-
mkdir -p .build
82-
cd .build
8380
echo ${{ matrix.config.cmake_args }}
8481
echo ${{ matrix.config.toolchain }}
85-
cmake ${{ matrix.config.cmake_args }} -DCMAKE_TOOLCHAIN_FILE="etc/${{ matrix.config.toolchain }}-toolchain.cmake" -B . -S ..
82+
rm -rf .build
83+
cmake ${{ matrix.config.cmake_args }} -DCMAKE_TOOLCHAIN_FILE="etc/${{ matrix.config.toolchain }}-toolchain.cmake" -B .build -S .
8684
- name: CMake Build
8785
run: |
8886
set -x
8987
cmake --build .build --config Asan --target all -- -k 0
9088
- name: CMake Test
9189
run: |
9290
set -x
93-
cd .build
9491
[[ ! -z "${{ matrix.config.asan_options }}" ]] && export ASAN_OPTIONS="${{ matrix.config.asan_options }}"
95-
ctest --build-config Asan --output-on-failure
92+
ctest --build-config Asan --output-on-failure --test-dir .build

README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -204,24 +204,20 @@ CI current build and test flows:
204204

205205
```shell
206206
# Configure build: default build production code + tests (BUILD_TESTING=ON by default).
207-
$ rm -rf .build/
208-
$ mkdir -p .build
209-
$ cd .build
210-
$ cmake -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo;Asan" -DCMAKE_TOOLCHAIN_FILE=etc/clang-19-toolchain.cmake -B . -S ..
207+
$ cmake -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo;Asan" -DCMAKE_TOOLCHAIN_FILE=etc/clang-19-toolchain.cmake -B .build -S .
211208
-- The CXX compiler identification is Clang 19.0.0
212209
...
213-
-- Build files have been written to: /home/dariusn/git/Beman/Beman.Optional26/.build
210+
-- Build files have been written to: /path/to/Optional26/.build
214211

215212
# Build.
216-
$ cd ..
217213
$ cmake --build .build --config Asan --target all -- -k 0
218214
...
219-
[30/30] Linking CXX executable examples/Asan/sample
215+
[30/30] Linking CXX executable ...
220216

221217
# Run tests.
222-
$ cd .build
223-
$ ctest --build-config Asan --output-on-failure
224-
Test project /home/dariusn/git/Beman/Beman.Optional26/.build
218+
$ ctest --build-config Asan --output-on-failure --test-dir .build
219+
Internal ctest changing into directory: /path/to/Optional26/.build
220+
Test project /path/to/Optional26/.build
225221
...
226222
100% tests passed, 0 tests failed out of 82
227223

@@ -234,23 +230,19 @@ By default, we build and run tests. You can provide `-DBUILD_TESTING=OFF` and co
234230

235231
```shell
236232
# Configure build: build production code, skip tests (BUILD_TESTING=OFF).
237-
$ rm -rf .build/
238-
$ mkdir -p .build
239-
$ cd .build
240-
$ cmake -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo;Asan" -DCMAKE_TOOLCHAIN_FILE=etc/clang-19-toolchain.cmake -DBUILD_TESTING=OFF -B . -S ..
233+
$ cmake -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo;Asan" -DCMAKE_TOOLCHAIN_FILE=etc/clang-19-toolchain.cmake -DBUILD_TESTING=OFF -B .build -S .
241234
-- The CXX compiler identification is Clang 19.0.0
242235
...
243-
-- Build files have been written to: /home/dariusn/git/Beman/Beman.Optional26/.build
236+
-- Build files have been written to: /path/to/Optional26/.build
244237

245238
# Build.
246-
$ cd ..
247239
$ cmake --build .build --config Asan --target all -- -k 0
248240
...
249241
[15/15] Linking CXX executable examples/Asan/sample
250242

251243
# Check that tests are not built/installed.
252-
$ cd .build
253-
$ ctest --build-config Asan --output-on-failure
244+
$ ctest --build-config Asan --output-on-failure --test-dir .build
245+
Internal ctest changing into directory: /home/dariusn/git/Beman/Beman.Optional26/.build
254246
Test project /home/dariusn/git/Beman/Beman.Optional26/.build
255247
No tests were found!!!
256248
```

src/Beman/Optional26/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ target_include_directories(
2020

2121
install(
2222
TARGETS beman_optional26
23-
EXPORT ${TARGETS_EXPORT_NAME}1
24-
DESTINATION ${CMAKE_INSTALL_LIBDIR})
23+
EXPORT ${TARGETS_EXPORT_NAME}
24+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
25+
)
2526

2627
string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_LOWER_PROJECT_NAME)
2728

2829
install(
2930
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
3031
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME}
3132
FILES_MATCHING
32-
PATTERN "*.hpp")
33+
PATTERN "*.hpp"
34+
)
3335

3436
target_link_libraries(beman_optional26)
3537

0 commit comments

Comments
 (0)