Skip to content

Commit 06d62a7

Browse files
Update README.md
With more references to the examples project and a separate section of using this project with CMake from a top-level project.
1 parent 52f84d3 commit 06d62a7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ Benefits of this approach to unit testing active objects include:
4141
system. Run all the tests with every commit. No surprises when
4242
it is time to generate a target release.
4343

44+
**An example project demonstrating the features of this library and
45+
how to import and use from with a CMake build environment is available
46+
here: https://github.com/covemountainsoftware/cpputest-for-qpc-examples**
47+
4448
# Environment
4549

4650
This project was developed and proven in Ubuntu 20.04 and 22.04. In theory any
@@ -84,6 +88,24 @@ environment, as exceptions are frequently disabled in firmware build targets.
8488
Care was taken to avoid the above in any source code that may ultimately be
8589
re-used in an embedded project's target build.
8690

91+
## Using with CMake
92+
93+
If a top-level project adds this repository via `add_subdirectory(cpputest-for-qpc)`
94+
then the library larget `cpputest-for-qpc-lib` will be available for linking with
95+
your CppUTest enabled host based unit-tests. Additionally, the project
96+
exports a CMake variable `CMS_CMAKE_DIR` with the path to the internal cmake
97+
folder with various helper cmake files. For example, a unit test target may simply
98+
add: `include(${CMS_CMAKE_DIR}/cpputestCMake.cmake)` to pull in various CppUTest
99+
behavior and build variables.
100+
101+
Additionally, the top-level project may set the CMake variable `CMS_QPC_TOP_DIR`
102+
to the project's QP/C directory. This prevents `cpputest-for-qpc-lib` from fetching
103+
its own copy of QP/C and ensures that both the unit testing environment and the
104+
target microcontroller build are each using the same version of QP/C.
105+
106+
See the examples project for further details:
107+
https://github.com/covemountainsoftware/cpputest-for-qpc-examples
108+
87109
## Active object interfaces
88110

89111
A typical active object within the QP/C framework may expose the following

0 commit comments

Comments
 (0)