Last active
November 24, 2021 17:09
-
-
Save neogeogre/4bef87d096c8e3056a50eb1dd7f99b0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install globally a lib with cmake to make it avaiable for C++ project | |
Easiest way to add a lib to c++ project. | |
Download source code under `Downloads`: | |
```sh | |
cd /home/geoffrey/Downloads/mylib | |
cmake -DBUILD_SHARED_LIBS=ON . | |
make install | |
``` | |
- `mylib` should be visible under `/usr/local/lib/cmake/`. | |
- Then in `CMakeLists.txt` use: | |
```cmake | |
find_package(mylib) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment