Skip to content

Commit 556253a

Browse files
committed
0.17.0 [skip ci]
1 parent aea7c41 commit 556253a

File tree

2 files changed

+25
-28
lines changed

2 files changed

+25
-28
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
Test:
11+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
1112
runs-on: ${{ matrix.os }}
1213
strategy:
1314
fail-fast: false

README.md

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# project_options
22

3-
A general-purpose CMake library that makes using CMake easier
3+
A general-purpose CMake library that provides functions that improve the CMake experience.
4+
5+
It provdes different functions such as `project_options`, `package_project`, `dynamic_project_options`, `run_vcpkg`, `target_link_system_libraries`, etc.
46

57
## Usage
68

@@ -9,29 +11,26 @@ Here is a full example:
911
```cmake
1012
cmake_minimum_required(VERSION 3.16)
1113
12-
# uncomment to set a default CXX standard for the external tools like clang-tidy and cppcheck
13-
# and the targets that do not specify a standard.
14-
# If not set, the latest supported standard for your compiler is used
15-
# You can later set fine-grained standards for each target using `target_compile_features`
16-
# set(CMAKE_CXX_STANDARD 17)
14+
# set a default CXX standard for the tools and targets that do not specify them.
15+
# If commented, the latest supported standard for your compiler is automatically set.
16+
# set(CMAKE_CXX_STANDARD 20)
1717
18-
# Add project_options v0.16.0
18+
# Add project_options v0.17.0
1919
# https://github.com/cpp-best-practices/project_options
2020
include(FetchContent)
21-
FetchContent_Declare(_project_options URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.16.0.zip)
21+
FetchContent_Declare(_project_options URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.17.0.zip)
2222
FetchContent_MakeAvailable(_project_options)
2323
include(${_project_options_SOURCE_DIR}/Index.cmake)
2424
25-
# uncomment to enable vcpkg:
26-
# # Setup vcpkg - should be called before defining project()
25+
# install vcpkg dependencies: - should be called before defining project()
2726
# run_vcpkg()
2827
2928
# Set the project name and language
3029
project(myproject LANGUAGES CXX C)
3130
3231
# Initialize project_options variable related to this project
3332
# This overwrites `project_options` and sets `project_warnings`
34-
# uncomment the options to enable them:
33+
# uncomment to enable the options. Some of them accept one or more inputs:
3534
project_options(
3635
ENABLE_CACHE
3736
ENABLE_CPPCHECK
@@ -40,15 +39,15 @@ project_options(
4039
# ENABLE_IPO
4140
# ENABLE_DOXYGEN
4241
# ENABLE_COVERAGE
43-
# WARNINGS_AS_ERRORS
4442
# ENABLE_SANITIZER_ADDRESS
4543
# ENABLE_SANITIZER_LEAK
4644
# ENABLE_SANITIZER_UNDEFINED_BEHAVIOR
4745
# ENABLE_SANITIZER_THREAD
4846
# ENABLE_SANITIZER_MEMORY
49-
# ENABLE_INCLUDE_WHAT_YOU_USE
5047
# ENABLE_PCH
5148
# PCH_HEADERS
49+
# WARNINGS_AS_ERRORS
50+
# ENABLE_INCLUDE_WHAT_YOU_USE
5251
# ENABLE_USER_LINKER
5352
# ENABLE_BUILD_WITH_TIME_TRACE
5453
# ENABLE_UNITY
@@ -160,7 +159,7 @@ It accepts the following named flags:
160159
- `ENABLE_CONAN`: Use Conan for dependency management
161160
- `ENABLE_IPO`: Enable Interprocedural Optimization (Link Time Optimization, LTO) in the release build
162161
- `ENABLE_COVERAGE`: Enable coverage reporting for gcc/clang
163-
- `ENABLE_DOXYGEN`: Enable Doxygen doc builds of source
162+
- `ENABLE_DOXYGEN`: Enable Doxygen documentation. The added `doxygen-docs` target can be built via `cmake --build ./build --target doxygen-docs`.
164163
- `WARNINGS_AS_ERRORS`: Treat compiler and static code analyzer warnings as errors. This also affects CMake warnings related to those.
165164
- `ENABLE_SANITIZER_ADDRESS`: Enable address sanitizer
166165
- `ENABLE_SANITIZER_LEAK`: Enable leak sanitizer
@@ -228,7 +227,8 @@ The following arguments specify the package:
228227
- `TARGETS`: the targets you want to package. It is recursively found for the current folder if not specified
229228

230229
- `PUBLIC_INCLUDES`: a list of public/interface include directories or files.
231-
_the given include directories are directly installed to the install destination. To have an `include` folder in the install destination with the content of your include directory, name your directory `include`._
230+
231+
<sub>NOTE: The given include directories are directly installed to the install destination. To have an `include` folder in the install destination with the content of your include directory, name your directory `include`.</sub>
232232

233233
- `PUBLIC_DEPENDENCIES_CONFIGURED`: the names of the INTERFACE/PUBLIC dependencies that are found using `CONFIG`.
234234

@@ -276,39 +276,35 @@ cmake -DOPT_<featurename>:BOOL=value
276276
```cmake
277277
cmake_minimum_required(VERSION 3.16)
278278
279-
# uncomment to set a default CXX standard for the external tools like clang-tidy and cppcheck
280-
# and the targets that do not specify a standard.
281-
# If not set, the latest supported standard for your compiler is used
282-
# You can later set fine-grained standards for each target using `target_compile_features`
283-
# set(CMAKE_CXX_STANDARD 17)
279+
# set a default CXX standard for the tools and targets that do not specify them.
280+
# If commented, the latest supported standard for your compiler is automatically set.
281+
# set(CMAKE_CXX_STANDARD 20)
284282
285-
# Add project_options v0.16.0
283+
# Add project_options v0.17.0
286284
# https://github.com/cpp-best-practices/project_options
287285
include(FetchContent)
288-
FetchContent_Declare(_project_options URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.16.0.zip)
286+
FetchContent_Declare(_project_options URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.17.0.zip)
289287
FetchContent_MakeAvailable(_project_options)
290288
include(${_project_options_SOURCE_DIR}/Index.cmake)
291289
292290
# ❗ Add dynamic CMake options
293291
include(${_project_options_SOURCE_DIR}/src/DynamicOptions.cmake)
294292
295-
# uncomment to enable vcpkg:
296-
# # Setup vcpkg - should be called before defining project()
293+
# install vcpkg dependencies: - should be called before defining project()
297294
# run_vcpkg()
298295
299296
# Set the project name and language
300297
project(myproject LANGUAGES CXX C)
301298
302299
# Set PCH to be on by default for all non-Developer Mode Builds
303-
# (this is just intended as an example of what is possible)
304300
set(ENABLE_PCH_USER_DEFAULT ON)
305301
306302
# Initialize project_options variable related to this project
307303
# This overwrites `project_options` and sets `project_warnings`
308-
# uncomment the options to enable them:
304+
# This also accepts the same arguments as `project_options`.
309305
dynamic_project_options(
310-
# set PCH headers you want enabled. Format can be slow, so this might be helpful
311-
PCH_HEADERS <vector> <string> <fmt/format.h>
306+
# set the common headers you want to precompile
307+
PCH_HEADERS <vector> <string> <fmt/format.h> <Eigen/Dense>
312308
)
313309
```
314310

0 commit comments

Comments
 (0)