https://github.com/dbrgn/cmake-demo-project
https://github.com/dbrgn/cmake-demo-project
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dbrgn/cmake-demo-project
- Owner: dbrgn
- Created: 2020-10-19T18:55:44.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-25T22:32:29.000Z (over 5 years ago)
- Last Synced: 2026-01-11T12:59:47.282Z (6 months ago)
- Language: CMake
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cmake demo lib

This is a demo project that uses qt + cmake. Its intention is to be used as a
playground for a potential LibrePCB build system migration.
## Structure
The most important file is `CMakeLists.txt`.
In order for `find_package(cmark)` to work, there's a find-file at
`cmake/Findcmark.cmake`.
Submodules are located in the `3rdparty` directory.
## Building
To build the project, either:
# Configure
mkdir build
cd build
cmake ..
# Build
make
...or:
# Configure
cmake -S . -B build
# Build
cmake --build build
## Linking
For third party libraries, linking should happen as follows:
- If the submodule is found, then that version is used and the library is
linked statically, unless `UNBUNDLE_` or `UNBUNDLE_ALL` is set
- Otherwise, try to find the library as a shared library on the system, link
against that one
This means that to unbundle a vendored library, you simply delete the
directory, or alternatively set `UNBUNDLE_` or `UNBUNDLE_ALL`.
## Resources
This was the most useful "modern cmake" resource I found so far:
https://cliutils.gitlab.io/modern-cmake/
The `Findcmark.cmake` module was based on this one I found on GitHub:
https://github.com/mujx/nheko/blob/master/cmake/Findcmark.cmake