Cmake plugin help - no install target

I am trying to figure out how to use the cmake plugin when no Install target exists in the CMakeLists.txt. The result is a single binary, is there a way to just pass the binary name so the cmake plugin skips the install and instead picks up the binary of specified name?

Because I don’t have a install target specified in the CMakeLists.txt, I get:

make: *** No rule to make target 'install'.  Stop.

What I would like is the cmake plugin not do the make install and instead let me specify the binaries.

Do you have any install() calls in your CMakeLists.txt file(s)? Perhaps CMake only creates the install target if the project has something to install.

Sorry, I should have specified better, I don’t have a install target in the CMakeLists.txt I am using but the actual CMakeLists.txt is not REALLY mine. I can sed modify it to insert one with an override pull but I wanted to know if there was some alternative in the cmake plugin if the CMakeLists.txt is not under my control.

If the plugin did not automatically try to invoke a make install I could pick the binary to stage it or manually copy it to parts install for. But right now, the plugin fails because it automatically tries to invoke a make install that doesn’t exist.

One option would be to use plugin: nil, and specify your own build logic in override-build. Something like this might do (I haven’t tested it):

parts:
  foo:
    plugin: nil
    source: ...
    build-packages:
     - cmake
    override-build: |
      mkdir build
      cd build
      cmake .. # plus any other configuration options you need
      make
      # add further commands to copy assets to $SNAPCRAFT_PART_INSTALL