You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,19 +171,17 @@ Instead, create a new directory or project with a CMakeLists that adds the libra
171
171
Depending type it might make sense move these components into a separate repositories and reference a specific commit or version of the library.
172
172
This has the advantage that individual libraries and components can be improved and updated independently.
173
173
174
-
> You recommend to add external dependencies using CPM.cmake. Will this force users of my library to use CPM as well?
174
+
> You recommend to add external dependencies using CPM.cmake. Will this force users of my library to use CPM.cmake as well?
175
175
176
176
[CPM.cmake](https://github.com/TheLartians/CPM.cmake) should be invisible to library users as it's a self-contained CMake Script.
177
-
If problems do arise, users can always opt-out by defining `CPM_USE_LOCAL_PACKAGES`, which will override all calls to `CPMAddPackage` with `find_package`.
178
-
Alternatively, you could use `CPMFindPackage` instead of `CPMAddPackage`, which will try to use `find_package` before calling `CPMAddPackage` as a fallback.
179
-
Both approaches should be compatible with common C++ package managers without modifications, however come with the cost of reproducible builds.
177
+
If problems do arise, users can always opt-out by defining the CMake or env variable [`CPM_USE_LOCAL_PACKAGES`](https://github.com/cpm-cmake/CPM.cmake#options), which will override all calls to `CPMAddPackage` with the according `find_package` call.
178
+
This should also enable users to use the project with their favorite external C++ dependency manager, such as vcpkg or Conan.
180
179
181
180
> Can I configure and build my project offline?
182
181
183
-
Using CPM, all missing dependencies are downloaded at configure time.
184
-
To avoid redundant downloads, it's recommended to set a CPM cache directory, e.g.: `export CPM_SOURCE_CACHE=$HOME/.cache/CPM`.
185
-
This will also allow offline configurations if all dependencies are present.
186
-
No internet connection is required for building.
182
+
No internet connection is required for building the project, however when using CPM missing dependencies are downloaded at configure time.
183
+
To avoid redundant downloads, it's highly recommended to set a CPM.cmake cache directory, e.g.: `export CPM_SOURCE_CACHE=$HOME/.cache/CPM`.
184
+
This will enable shallow clones and allow offline configurations dependencies are already available in the cache.
187
185
188
186
> Can I use CPack to create a package installer for my project?
0 commit comments