Giter Site home page Giter Site logo

Comments (4)

cdecompilador avatar cdecompilador commented on May 13, 2024

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.

friendlyanon avatar friendlyanon commented on May 13, 2024

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.

cdecompilador avatar cdecompilador commented on May 13, 2024

Yeah, thinking about it, linking this tool to the project structure would remove cmake potential.

from cmake-init.

friendlyanon avatar friendlyanon commented on May 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.