Comments (4)
I think this would be a good idea using the FetchContent
feature in cmake by default (also having the option to select (vcpkg, etc, ...)
For example:
# --- External dependencies ---
FetchContent_Declare(
Cli
GIT_REPOSITORY "https://github.com/daniele77/cli.git"
GIT_TAG "63eb02970fc19c2ba182be4c30d5dcd79e63f438"
)
FetchContent_MakeAvailable(Cli)
set(EXTERNAL_DEPS "cli")
I though that having a cmake-add
command would also be great but that would be harder to implement, for example doing a cmake-add fmtlib/fmt
would look in the common remote git repository providers for user fmtlib
with repository fmt
and add the respective FetchContent
with the last commit, also a cmake-rm
or cmake-update
but these are just ideas.
from cmake-init.
FetchContent
is a form of vendoring and I heavily recommend against vendoring. For some things, it's just fine, like fetching m.css
to generate docs. It's a purely developer process and it is opt-in even in developer mode.
For dependencies, it absolutely should not be used. add_subdirectory
is not a package manager. a4a86d8 implements a tiny template engine for more complex templates, which will allow me to add PM code to generated projects.
I though that having a cmake-add command would also be great but that would be harder to implement, for example doing a cmake-add fmtlib/fmt would look in the common remote git repository providers for user fmtlib with repository fmt and add the respective FetchContent with the last commit, also a cmake-rm or cmake-update but these are just ideas.
Not feasible. Once the project is generated, it is in an unknown state and can't be safely edited programmatically. cmake-init --vcpkg
is already pushing it a bit and I'm not sure that one is useful either, since I can just add examples to the wiki for what it does (and there is already one such entry in the wiki).
I also want the generated projects to be completely independent of this project, since its goal is to set people on the right track when dealing with CMake and related processes, meaning I don't want this to be another thing people have to learn in addition to existing, established tools.
from cmake-init.
Yeah, thinking about it, linking this tool to the project structure would remove cmake potential.
from cmake-init.
C projects have https://github.com/json-c/json-c as a dependency and https://github.com/catchorg/Catch2 as a dev dependency. I couldn't find a nice C testing library with the necessary CMake integration. See 05bfbfb
from cmake-init.
Related Issues (20)
- cmake does not detect some vcpkg installed libraries when using cmake-init HOT 8
- Web cmake-init HOT 2
- Not Compatible with Conan 1.51.x HOT 2
- Build failure on the dev branch
- How to link additional libraries HOT 1
- Thin mode
- `sanitize` job fails in new project HOT 3
- `fmt/core.h` not found HOT 6
- Spell and grammar checking
- Add sanitizer option to user presets HOT 5
- Why is the template generate a CMakeUserPresets, should not those be outside of git and local to the dev own setup?
- Showcase insertion of CMake variables via `configure_file()` HOT 3
- Conan v2 template HOT 3
- Mingw support in cmake-init HOT 1
- MSVC's /analyze is erroneous and slow
- It seems that my previous installation of Visual Studio 2022 edited my configurations HOT 2
- Rethink flags presets HOT 3
- Errors with `-fcf-protection=full` on darwin (CMakePresets.json, "flags-darwin" preset) HOT 2
- Runtime error (Error code: 0xc0000135) when building shared libraries on Windows using MSVC HOT 3
- Setting `-D<project>_INSTALL_CMAKEDIR=something` produces unexpected results HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmake-init.