Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexbuccheri/cmake-externalproject-example
An example of CMake's ExternalProject
https://github.com/alexbuccheri/cmake-externalproject-example
Last synced: about 2 months ago
JSON representation
An example of CMake's ExternalProject
- Host: GitHub
- URL: https://github.com/alexbuccheri/cmake-externalproject-example
- Owner: AlexBuccheri
- Created: 2023-02-10T18:08:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-10T18:09:06.000Z (almost 2 years ago)
- Last Synced: 2024-10-28T10:28:31.087Z (3 months ago)
- Language: CMake
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
This repository demos how to build an external library with CMake's `ExternalProject_add`.
As a specific example, it clones, builds and installs [LibXC](https://tddft.org/programs/libxc/).Note, cloning LIBXC is quite slow.
`ExternalProject_ad`d runs at build time (make), not configure time. For configure time, see [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html)
## Instructions
In this project's root directory:
```bash
mkdir build && cd build
# Configure build
cmake ../
# Only build the target
cmake --build . --target INTERNAL_LIBXC5
# Note, one can run this from the project root with:
# cmake --build build/ --target INTERNAL_LIBXC5
```LIBXC is cloned into `external/`, built in CMake's binary directort (set to `build/` in this example), but installed
in a folder that CMake adds to `external/`. This might not be best-practice, but is appropriate for the context