Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1656fd7
Add code of conduct
aedart Jan 24, 2025
c18c2a8
Add link to code of conduct
aedart Jan 24, 2025
afd7ad9
Add security policy
aedart Jan 27, 2025
4a8453c
Add link to security policy
aedart Jan 27, 2025
307db11
Change release notes
aedart Jan 27, 2025
138092a
Replace TODO
aedart Jan 27, 2025
e99cad7
Add defect report issue template
aedart Jan 27, 2025
e310db5
Add feature request issue template
aedart Jan 27, 2025
20b379f
Add contribution guide
aedart Jan 27, 2025
a739c3d
Change release notes
aedart Jan 27, 2025
13f0959
Add link to contribution guide
aedart Jan 27, 2025
d2841ee
Add initial support policy
aedart Jan 27, 2025
3a66ba9
Improve sentence
aedart Jan 27, 2025
8a3f986
Add pull request template
aedart Jan 27, 2025
3085f88
Change release notes
aedart Jan 27, 2025
a40fbcf
Adjust table styles
aedart Jan 27, 2025
4c97490
Add introduction and how to include
aedart Jan 27, 2025
42afd39
Add requirements for using git module
aedart Jan 27, 2025
e11e1c0
Add doc for git_find_version_tag()
aedart Jan 27, 2025
8fe0030
Change top-level example, add include()
aedart Jan 27, 2025
7f20481
Add requirements for version module
aedart Jan 27, 2025
2955e87
Add docs for semver parse
aedart Jan 27, 2025
5928711
Fix missing include() in top-level example
aedart Jan 27, 2025
84ff2c4
Remove link text decoration
aedart Jan 27, 2025
4ecaa84
Fix SEMVER output variable example
aedart Jan 27, 2025
2ca08ff
Add guide for "version file" utils
aedart Jan 27, 2025
2ce5b7a
Add docs for cache module
aedart Jan 27, 2025
8453417
Add doc for test assert functions (incomplete)
aedart Jan 27, 2025
4de029d
Add docs for tests (incomplete)
aedart Jan 27, 2025
2ecf1a3
Add introduction / getting started with testing (incomplete)
aedart Jan 27, 2025
ababbf4
Add content for "build & run", and for "Caveats"
aedart Jan 28, 2025
030bb8b
Cleanup
aedart Jan 28, 2025
10429d9
Add guide for how to use define_test_suite()
aedart Jan 28, 2025
b2f17d9
Add TOC and add heading for parameters section
aedart Jan 28, 2025
f99ac34
Add guide for defining a test-case
aedart Jan 28, 2025
8c1e9fa
Fix anchor links
aedart Jan 28, 2025
b82952b
Add guide for define_test()
aedart Jan 28, 2025
9482b3c
Add "quick" guide for how to execute tests
aedart Jan 28, 2025
c7a2676
Add info about test executor and how to use a custom executor
aedart Jan 28, 2025
3633352
Move asserts doc one level up
aedart Jan 28, 2025
427c00b
Fix descriptions for in / not in list asserts
aedart Jan 28, 2025
ed5477b
Add assert reference documentation
aedart Jan 28, 2025
130844f
Change support policy
aedart Jan 28, 2025
da69ade
Remove features section
aedart Jan 28, 2025
2833d16
Remove warning
aedart Jan 28, 2025
5ae2cb7
Add v0.x highlights
aedart Jan 28, 2025
221402b
Fix sentence
aedart Jan 28, 2025
cb00fef
Improve sentences
aedart Jan 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CMake Scripts Code of Conduct

You can find the code of conduct in the [official documentation](https://rsps.github.io/cmake-scripts/current/code_of_conduct.html).
3 changes: 3 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CMake Scripts Contribution Guide

The contribution guide is located in the [official documentation](https://rsps.github.io/cmake-scripts/current/contribution_guide.html).
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/defect-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug or Defect report
about: Report a bug or defect
---

## Describe the bug

A clear and concise description of what the bug is.

## To Reproduce**

_Steps to reproduce the behavior:_
1. Import module xyz...
2. Call function with parameters ...
4. See error

## Expected behavior

_A clear and concise description of what you expected to happen._

## Possible solution

_How could this defect be resolved (if you are able to provide such)_

## Affected version(s)
_The affected version(s) of this project._
- Version [e.g. 1.1.0]

## CMake Version
_The CMake version used, in which the bug or defect was encountered_
- Version [e.g. 3.30.0]

## OS

_The operating system you used._
- E.g. Ubuntu 24.04

## Additional context

_Add any other context about the bug or defect..._

12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Feature Request
about: Ask for a new or change of an existing feature
---

## Description

_What is the main purpose of the requested feature or change, e.g. what problem or challenge should to solve?... and why?_

## Possible solution

_How should the feature be implemented?_
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
_A short summary of what does this PR fixes, changes or adds..._

## Details

_More details about the PR... Delete this section, if not need!_

## References

* [Reference to issue(s)](www.google.com)
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `tests.yaml` and `deploy-docs.yaml` GitHub Actions workflows.
* `composer.json` to install [Daux.io](https://daux.io) dev-dependency (_documentation generator_).
* "rsp" theme for Daux (_placed in `resources/daux/themes/rsp`_).
* Support Policy, Code of Conduct, Contribution Guide and Security Policy in the docs.
* Defect and Feature Request issue templates (_for GitHub_).
* Pull request template (_for GitHub_).

[Unreleased]: https://github.com/rsps/cmake-scripts/compare/develop
3 changes: 3 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

The security policy can be found in the [official documentation](https://rsps.github.io/cmake-scripts/current/security_policy.html).
2 changes: 1 addition & 1 deletion cmake/rsp/testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if (NOT COMMAND "define_test_suite")
#
# @see end_test_case()
#
# @param <string> name Human readable name of test suite TODO: Can this be used for ctest labels / groups?
# @param <string> name Human readable name of test suite
# @param DIRECTORY <path> Path to directory that contains test-cases
# @param [MATCH <glob>] Glob used to match test-case files.
# Defaults to "*_test.cmake".
Expand Down
4 changes: 2 additions & 2 deletions cmake/rsp/testing/asserts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ endif ()

if (NOT COMMAND "assert_in_list")

#! assert_in_list : Assert key (value) to be inlist
#! assert_in_list : Assert key (value) to be in given list
#
# @see https://cmake.org/cmake/help/latest/command/if.html#in-list
#
Expand All @@ -196,7 +196,7 @@ endif ()

if (NOT COMMAND "assert_not_in_list")

#! assert_not_in_list : Assert key (value) not to be inlist
#! assert_not_in_list : Assert key (value) not to be in given list
#
# @see https://cmake.org/cmake/help/latest/command/if.html#in-list
#
Expand Down
90 changes: 88 additions & 2 deletions docs/+current/01_release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,95 @@ author: RSP Systems A/S

## Support Policy

_TODO: ...incomplete, please review documentation at a later point_
The following shows the supported versions of the "CMake Scripts" project.

| Version | CMake | Release | Security Fixes Until |
|---------|-------------|---------|----------------------|
| `1.x` | `3.30 - ?` | _TBD_ | _TBD_ |
| `0.x`* | `3.30 - ? ` | _TBD_ | _N/A_ |

_* - current supported version._ \
_TBD - "To be decided"._ \
_N/A - "Not available"._

## `v0.x` Highlights

_TODO: ...incomplete, please review documentation at a later point_
### "Mini" Testing Framework

(_available since `v0.1`_)

A "mini" testing framework for testing your CMake modules and scripts.

```cmake
define_test("has built assets" "has_built_assets")
function(has_built_assets)
assert_file_exists("resources/images/menu_bg.png" MESSAGE "No menu bg")
assert_file_exists("resources/images/bg.png" MESSAGE "No background")

# ...etc
endfunction()
```

See [testing module](./modules/testing/cmake/index.md) for additional information.

### Git

(_available since `v0.1`_)

Git related utilities.

```cmake
git_find_version_tag(
OUTPUT version
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

message("${version}") # 1.15.2
```

See [git module](./modules/git/index.md) for additional information.

### Version

(_available since `v0.1`_)

Helpers for dealing with a project’s versioning

```cmake
version_from_file(
FILE "version"
OUTPUT my_package
)

message("${my_package}_SEMVER") # 2.0.0-beta.3+AF1004
```

See [version module](./modules/version/index.md) for additional information.

### Cache

(_available since `v0.1`_)

Module that offers additional caching functionality (_via CMake’s Cache Entry mechanism_).

```cmake
cache_set(
KEY foo
VALUE "bar"
TTL 5
)

# ... Elsewhere in your cmake scripts, 5 seconds later...

cache_get(KEY foo)

message("${foo}") # (empty string)
```

See [cache module](./modules/cache/index.md) for additional information.

## Changelog

For additional information about the latest release, new features, changes or defect fixes, please review the
[Changelog](https://github.com/rsps/cmake-scripts/blob/main/CHANGELOG.md).

2 changes: 1 addition & 1 deletion docs/+current/02_upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ author: RSP Systems A/S

# Upgrade Guide

_TODO: ...incomplete, please review documentation at a later point_
_There is no upgrade guide for this version!_

## Onward

Expand Down
42 changes: 41 additions & 1 deletion docs/+current/03_contribution-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,44 @@ author: RSP Systems A/S

# Contribution Guide

_TODO: ...incomplete, please review documentation at a later point_
We appreciate all the help that we can get to improve this project. In this section, you will find useful information
on how you can contribute.

[TOC]

## Bug Report

If you have encountered a bug, feel free to [report it](https://github.com/aedart/athenaeum/issues).
When reporting the bug, please consider the following:

* Where is the defect located?
* A good, short and precise description of the defect (_Why is it a defect?_)
* How can the defect be replicated?
* (_A possible solution for how to resolve the defect_)

Once we have received the bug or defect report, we will address it as reasonably as we can.

## Security Vulnerability

See the [Security Policy](./04_security-policy.md) for details.

## Feature Request

If you have an idea for a new feature or perhaps changing an existing one, please feel free to create a
[feature request](https://github.com/aedart/athenaeum/issues).

## Pull Requests

If you are able to fix a bug or defect, or perhaps add new features, then you can send us a pull request.
Please follow this guideline:

* Fork this project
* Create a new local branch for the given fix, addition or change
* Write your changes
* Create executable test-cases (_prove that your changes are solid!_)
* Commit and push your changes to your fork
* Send a pull-request with your changes (**_please ensure to check "Allow edits from maintainers"_**)

We will review your pull request, as soon as time permits. If your changes are accepted, then they will be merged into
this project and released in an upcoming version. Should your pull request not be accepted, then you will be informed
about it.
24 changes: 23 additions & 1 deletion docs/+current/04_security-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,26 @@ author: RSP Systems A/S

# Security Policy

_TODO: ...incomplete, please review documentation at a later point_
!!! warning "Warning"
Please do NOT disclose security related issues publicly! Use GitHub's "Security Advisories >
[Report Vulnerability](https://github.com/rsps/cmake-scripts/security/advisories/new)" mechanism instead.

_For additional details, please read the "How to report a vulnerability" for instructions._

[TOC]

## How to report a vulnerability

To report a security related issue, please use GitHub's vulnerability reporting mechanism. Follow the
on-screen instructions.

* [Report new Vulnerability](https://github.com/rsps/cmake-scripts/security/advisories/new)

For additional help, please consider reading ["Best practices for writing repository security advisories"](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/best-practices-for-writing-repository-security-advisories).

Once we have received the security related issue, we will address it to the best of our ability, as soon as
possible.

## Supported Versions

Please review the [Support Policy](./01_release-notes.md#support-policy) before reporting security related issues.
16 changes: 15 additions & 1 deletion docs/+current/05_code-of-conduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,18 @@ author: RSP Systems A/S

# Code of Conduct

_TODO: ...incomplete, please review documentation at a later point_
The following constitutes the code of conduct for the "CMake Scripts" project.

* Participants must be helpful and constructive.
* Participants must be tolerant and respectful towards the opinions of other participants.
* Participants must ensure their conduct is free from harassment, harmful deeds, inappropriate language or behaviour, and malicious intent.
* Efforts towards the benefit of the overall community must always be favoured, rather than individual needs.

## Consequences

Participants are subject to reasonable consequences, if the code of conduct is not upheld. Such consequences can
include banning from further participation.

## Reporting

Any violations of the code of conduct can be reported to [RSP Systems](mailto:alin@rspsystems.com).
51 changes: 51 additions & 0 deletions docs/+current/modules/cache/01_set.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Set
description: Cache a variable
keywords: cache, cmake
author: RSP Systems A/S
---

# Set

Use `cache_set()` to cache a variable. The function accepts the following parameters:

* `KEY`: _The variable to assign and cache._
* `VALUE`: _Value to assign and cache._
* `TTL`: (_optional_), _Time-To-Live of cache entry in seconds (see [TTL](#ttl) for details)._
* `TYPE`: (_optional_), _Cmake cache entry type, BOOL, STRING,...etc. Defaults to `STRING` if not specified._
* `DESCRIPTION`: (_optional_), _Description of cache entry._

!!! warning "Caution"
Invoking the `cache_set()` function, is the equivalent to using CMake's
[`set(... CACHE FORCE)`](https://cmake.org/cmake/help/latest/command/set.html#set-cache-entry).

**Example**

```cmake
cache_set(
KEY foo
VALUE "bar"
)

message("${foo}") # bar
```

## TTL

You can optionally specify a time-to-live (_ttl_) duration (_in seconds_), for the cache entry.
Whenever the cached variable is queried (_via [`has`](./03_has.md) or [`get`](./02_get.md)_), the entry will
automatically be removed, if it has expired.

```cmake
cache_set(
KEY foo
VALUE "bar"
TTL 5
)

# ... Elsewhere in your cmake scripts, 5 seconds later...

cache_get(KEY foo)

message("${foo}") # (empty string)
```
Loading
Loading