Commit 6adbb1d
committed
cmake: Support being included with add_subdirectory
Make changes needed to make the cmake project work well when it is not the top
level project and has been included with add_subdirectory:
- Avoid defining "tests" and "check" targets when project is not at the top
level to avoid clashes. Add new "mptests" and "mpcheck" alternatives instead.
- Rename "example" target to "mpexamples"
- Rename "util" target to "mputil"
- Export MP_INCLUDE_DIR variable to parent scope so target_capnp_sources()
function can work well there.
- Replace uses of CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR
- Reset INCLUDE_DIRECTORIES property so include_directories calls in the parent
project do not affect this project. This was causing errors because the
bitcoin core build was adding global include directories and causing its init.h
file to take precedence over local one.1 parent 1103f86 commit 6adbb1d
3 files changed
+30
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
30 | 43 | | |
31 | 44 | | |
32 | 45 | | |
| |||
35 | 48 | | |
36 | 49 | | |
37 | 50 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
42 | 55 | | |
43 | 56 | | |
44 | 57 | | |
| |||
52 | 65 | | |
53 | 66 | | |
54 | 67 | | |
55 | | - | |
| 68 | + | |
56 | 69 | | |
57 | 70 | | |
58 | 71 | | |
| |||
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
73 | | - | |
| 86 | + | |
74 | 87 | | |
75 | 88 | | |
76 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
0 commit comments