Hotfix CMake & ETL #604
No reviewers
Labels
No Label
API Change
Breaking API Change
bug
build
cosmetics
Documentation
duplicate
feature
help wanted
hotfix
invalid
question
Refactor
Tests
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Blocks
Reference: fsfw/fsfw#604
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "mueller/hotfix-etl"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If
find_package
is used to find the ETL package, the target will be namedetl::etl
. This is what I have seen in most installed packages.If
etl
is linked in that case, CMake will assume this is a system library and add-letl
, which of course does not work as etl is a header-only library.It would be better if the ETL version fetched by
FetchContent
would be locatedinside the
etl
namespace as well but I have not found a way to do this. This is due to the nature target names work ifadd_subdirectory
orFetchContent
are used. I think there is an ongoing effort to improveCMake
in the context of mixingFetchContent
andfind_package
anyway:For now, the cleanest solution I found to have the same target name is to simply introduce a new alias target.
I also bumped the revision to https://github.com/ETLCPP/etl/tree/20.27.3 .
The CMake install support in the ETL is new and another bump might be good soon (maybe for next major version 21, and then try to remain stable)
Hotfix ETLto Hotfix CMake & ETLLGTM
@ -124,3 +125,3 @@
)
FetchContent_MakeAvailable(etl)
FetchContent_MakeAvailable(${FSFW_ETL_LIB_NAME})
If I read this correct, we should only call FetchContent_MakeAvailable once:
This ensures dependency collection works correct for dependencies of the dependency (which we might not have ATM)
The Catch2 dependency only needs to be loaded for unit tests I think
This could be solved with an if clause which either makes etl available or makes both available depending on whether Catch2 was loaded.
Or maybe MakeAvailable can deal with undeclared dependencies.. maybe I will test this
LGTM