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
See the [examples directory](https://github.com/cpm-cmake/CPM.cmake/tree/master/examples) for complete examples with source code and check [below](#snippets) or in the [wiki](https://github.com/cpm-cmake/CPM.cmake/wiki/More-Snippets) for example snippets.
47
+
24
48
## Usage
25
49
26
50
After `CPM.cmake` has been [added](#adding-cpm) to your project, the function `CPMAddPackage` can be used to fetch and configure a dependency.
@@ -78,27 +102,6 @@ For using CPM.cmake projects with external package managers, such as conan or vc
78
102
79
103
In rare cases, this behaviour may be desirable by default. The function `CPMFindPackage` will try to find a local dependency via CMake's `find_package` and fallback to `CPMAddPackage`, if the dependency is not found.
80
104
81
-
## Full CMakeLists Example
82
-
83
-
```cmake
84
-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
85
-
86
-
# create project
87
-
project(MyProject)
88
-
89
-
# add executable
90
-
add_executable(tests tests.cpp)
91
-
92
-
# add dependencies
93
-
include(cmake/CPM.cmake)
94
-
CPMAddPackage("gh:catchorg/Catch2@2.5.0")
95
-
96
-
# link dependencies
97
-
target_link_libraries(tests Catch2)
98
-
```
99
-
100
-
See the [examples directory](https://github.com/cpm-cmake/CPM.cmake/tree/master/examples) for complete examples with source code and check [below](#snippets) or in the [wiki](https://github.com/cpm-cmake/CPM.cmake/wiki/More-Snippets) for example snippets.
101
-
102
105
## Adding CPM
103
106
104
107
To add CPM to your current project, simply add the [latest release](https://github.com/cpm-cmake/CPM.cmake/releases/latest) of `CPM.cmake` or `get_cpm.cmake` to your project's `cmake` directory.
0 commit comments