cginternals / cginternals/cppfs
GoogleTest should be included as ExternalProject
- Vorherrschende Sprache
- C++
- Sterne
- 514
- Forks
- 73
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hi!
First off, thanks for providing and maintaining this library!
I noticed that GoogleTests is checked in as a part of the source and I'd like to suggest that CMake's `ExternalProject` feature could be used instead. It would allow `cppfs` to checkout and include it in the configure process. Additionally, this could become optional based on if `find_package()` cannot find an already installed GTest library on the host.
Please see GoogleTest readme for more information: Incorporating Into An Existing CMake Project (https://github.com/google/googletest/blob/4f4c01d8c86659f587ea0bc27c815ffa94fc9f72/googletest/README.md)
Main benefits include
1. 3rd party code is not checked in
2. `cppfs` no longer need to update `GoogleTest` them self.
3. `cppfs` could easily point to specific git tag or branch of `GoogleTest`
4. `GoogleTests` source is not included if `OPTION_` for tests is ON
5. If installed on host, Linking is easy as `find_package(GTest WANTED_VERSION EXACT)` and `target_link_libraries` with `GTest::GTest` and `GTest::Main`
6. If GoogleTests is downloaded and added to the project like suggested, just call `target_link_libraries` with `gtest` and `gtest_main`
If this sounds reasonable I would be happy to help out by sending a PR or further instructions.
Best regards
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne mit der CMake-Konfiguration, die derzeit den eingecheckten GoogleTest-Quellcode einbindet, und vergleiche sie mit CMake's ExternalProject und GoogleTests Anleitung „Incorporating Into An Existing CMake Project“. Als erledigt gilt, wenn ein installiertes GTest mit find_package gefunden werden kann; andernfalls wird GoogleTest bei Bedarf abgerufen und die bestehenden Testziele über die entsprechenden GTest-Ziele verknüpft.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cmake, cpp
- Bereich
- build-system, testing-qa
- Issue-Typ
- Refactoring
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100