Using newer `cmake` from snap

How to force plugin: cmake to use the snap version of the cmake?

I specify build-snaps: [cmake] for the part, then run snapcraft --debug, and the build shows You are running version 3.10.2, but running cmake --version in the debug console afterwards outputs cmake version 3.16.4.

1 Like

I am running snapcraft 3.9.8 with --use-lxd.

1 Like

You may have luck using build-environment to insert /snap/bin to the front of PATH.

Example:

parts:
   cmake-project:
     plugin: cmake
     source: .
     build-environment:
      - PATH: /snap/bin:$PATH
1 Like