Commit 90f6109
committed
Clean up install logic
Problem
-------
Using the parameters to describe the project in
`project()` is misleading. It happens to be that the name
`beman.exemplar` is used as the name of the project and as
the CMake export name, but those are two different concepts that
do not necessarily align.
Also, the variable dereferencing in CMakeLists.txt is no less
error prone than typing beman.exemplar. That's because it is not
difficult to type things like ${PROJET_SOURCE_DIR}, which CMake
will expand to an empty string.
Instead, the readability of the install logic improves because it
looks like a file with a specific name is being specifically
created and referenced, which is the intention of the relevant
installation logic.
Solution
--------
* Remove references to PROJECT_NAME, PROJECT_SOURCE_DIR,
and PROJECT_BINARY_DIR. Prefer relative paths to
CMAKE_CURRENT_SOUCE_DIR and CMAKE_CURRENT_BINARY_DIR
instead.
* Rename the install COMPONENT for beman.exemplar to
"beman.exemplar" instead of "development".
* Add the install COMPONENT to the installation of the
beman.exemplar library target itself.
* Move FetchContent include to use-fetch-content.cmake.1 parent 1144f5e commit 90f6109
2 files changed
+2
-7
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
0 commit comments