Giter Club home page Giter Club logo

Comments (5)

TheLartians avatar TheLartians commented on May 19, 2024

Hm I don't think it's possible for CMake to "cache" a subdirectory, as it needs to run all dependency's CMakeLists to ensure that all contained targets and functions etc are defined and in the correct order.
One thing you could do is to pre-build and install the dependency "normally" and then use CPMFindPackage instead of CPMAddPackage too add it. That way CPM should pick up the installed version and will use the pre-built libraries and headers (assuming the CMake Module path is set up correctly).
Another way to speed up configure time is setting a generator such as ninja, which is noticeably faster than make in configuration and build times.

from cpm.cmake.

bolu-atx avatar bolu-atx commented on May 19, 2024

Thanks, good suggestion, I'll try precompiling and use CPMFindPackage. I thought you added an option for CPMAddPackage to prefer to find_package first, is this correct?

from cpm.cmake.

TheLartians avatar TheLartians commented on May 19, 2024

Yeah, you could also get this behaviour globally for CPMAddPackage by defining CPM_USE_LOCAL_PACKAGES=1 as a CMake option or environmental variable.

from cpm.cmake.

TheLartians avatar TheLartians commented on May 19, 2024

Closing as there is nothing that CPM can really do against slow dependency configure times.
Did installing and CPMFindPackage work for you?

from cpm.cmake.

TheLartians avatar TheLartians commented on May 19, 2024

As it turns out the largest bottleneck for us was CMake's FetchContent doing essentially nothing. Therefore the most recent release bypasses FetchContent for previously cached dependencies. For us this reduced configuration time from minutes to seconds. @bolu-atx perhaps you could try updating CPM.cmake to at least 0.28.0 and see if it reduces configuration time for your projects as well.

from cpm.cmake.

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.