Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
See this example from the wiki. This one tries to use unofficial vcpkg package nd targets, then falls back to pkg config, then falls back to find_* commands. This is probably more than what you are asking, but you can put anything in the find module, even code that vendors projects, although I highly recommend against any form of vendoring (manual, git, FetchContent, etc). Vendoring only causes problems for packagers.
Have you considered integrating cmake-format? It requires an extra dependency of course, but you can make it optional.
This came up somewhere else, but I created an example repo that idiomatically uses find_package and an opt-in find module to FetchContent a dependency from GitHub: https://github.com/friendlyanon/cmake-init-fetchcontent