SiegeLord /
RustCMake
An example project showing usage of CMake with Rust
33/100 healthLoading repository data…
acarg / repository
An example showing how to handle dependencies with CMake, here using Proxygen.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
An example showing how to handle dependencies with CMake, here using Proxygen. It goes with this blog post.
Warning: This is not trying to do anything useful with Proxygen! I just chose it as an example because it is not trivial to build its dependencies.
This project depends on Proxygen, which has a few dependencies (listed here).
It turns out that Proxygen is available in the Arch AUR repo.
That means that it can be installed e.g. using yay.
It can be done like this:
Install the dependencies:
yay -S proxygen
Build the project
cmake -Bbuild -S.
cmake --build build
The limitation here is that your package manager may not have Proxygen. For instance, it was outdated when I first tried it, and therefore unavailable.
Build the dependencies and install them into ./dependencies/install:
cmake -DCMAKE_INSTALL_PREFIX=dependencies/install -DCMAKE_PREFIX_PATH=$(pwd)/dependencies/install -Bdependencies/build -Sdependencies
cmake --build dependencies/build
Have a look into dependencies/install, and see that they were installed
locally. Now we can tell CMake to look there when using find_package,
by providing the path: -DCMAKE_PREFIX_PATH=/path/to/dependencies/install.
Build the project using the dependencies installed in step 1:
cmake -DCMAKE_PREFIX_PATH=$(pwd)/dependencies/install -Bbuild -S.
cmake --build build
The CI runs the helper script. That's very convenient because as a result, it does not result in a custom package manager. Also it gets very useful for cross-compiling.
Finally, because the dependencies are installed locally, it's extremely easy to cache them:
- uses: actions/cache@v2
id: cache
with:
path: ./install
key: ${{ github.job }}-${{ hashFiles('./dependencies/**') }}
Here we tell the CI to cache all the files that are in ./install at the
end of a successful build (note that ./install is where the CI installs
them, instead of ./dependencies/install above).
Then we can just tell the CI to not build the dependencies if they are already in the cache:
if: steps.cache.outputs.cache-hit != 'true'
Selected from shared topics, language and repository description—not editorial ratings.
SiegeLord /
An example project showing usage of CMake with Rust
33/100 healthcyeksan /
An example Android project showing how to protect API keys or some other secret variables from decompilation
23/100 healthmattgodbolt /
An example showing how I use CMake and Conan
30/100 healthrodolfoap /
Dense optical flow detection using OpenCV's Gunnar Farneback’s algorithm. An example is included: taking a video showing a crowd in movement, the people movement can be described with a set of vectors.
44/100 healthacarg /
An example showing how to handle dependencies with CMake, here using gRPC.
39/100 healthAn example showing a superbuild with CMake.
37/100 health