| 1 |
# TribitsOldSimpleExampleApp |
| 2 |
|
| 3 |
This simple example project `TribitsOldSimpleExampleApp` is a raw CMake |
| 4 |
project that pulls in libraries from a few packages from |
| 5 |
[`TribitsExampleProject`](../TribitsExampleProject/README.md) using just |
| 6 |
`find_package(TribitsExProj REQUIRED COMPONENTS ...)` but uses the old |
| 7 |
specification for using an installed TriBITS project (i.e. through CMake |
| 8 |
variables `<Project>_LIBRARIES`, `<Project>_INCLUDE_DIRS`, and |
| 9 |
`<Project>_TPL_INCLUDE_DIRS`). |
| 10 |
|
| 11 |
After building and installing TribitsExampleProject under |
| 12 |
`<upstreamInstallDir>`, then configure, build, and test |
| 13 |
`TribitsOldSimpleExampleApp` with: |
| 14 |
|
| 15 |
``` |
| 16 |
cmake \ |
| 17 |
-DCMAKE_PREFIX_PATH=<upstreamInstallDir> \ |
| 18 |
<base-dir>/TribitsOldSimpleExampleApp |
| 19 |
|
| 20 |
make |
| 21 |
|
| 22 |
ctest |
| 23 |
``` |
| 24 |
|
| 25 |
This project can be instructed to use the non-namespaced old deprecated |
| 26 |
targets by adding the CMake cache var: |
| 27 |
|
| 28 |
``` |
| 29 |
-D TribitsOldSimpleExApp_USE_DEPRECATED_TARGETS=ON |
| 30 |
``` |
| 31 |
|
| 32 |
This will generated deprecated warnings with newer versions of TriBITS. (This |
| 33 |
is to demonstrate and test these deprecated non-namespaced targets and to |
| 34 |
demonstrate how to remove the deprecated warnings in a downstream customer |
| 35 |
CMake project.) |
| 36 |
|
| 37 |
NOTE: The modern version of this project using the modern CMake targets |
| 38 |
produced by `TribitsExampleProject` is |
| 39 |
[`TribitsSimpleExampleApp`](../TribitsSimpleExampleApp/README.md). Comparing |
| 40 |
the `CMakeLists.txt` files in these two projects (e.g. [here](CMakeLists.txt) |
| 41 |
and [here](../TribitsSimpleExampleApp/CMakeLists.txt)) demonstrates the |
| 42 |
simplifications afforded by the namespaced modern CMake targets. |