Che: How to add CMake to C/C++ stack?

Created on 7 Oct 2017  路  4Comments  路  Source: eclipse/che

Description

I cannot determine how to add CMake to the default C++ stack.

Reproduction Steps

I go to the "Stacks" page in the browser.

I find the "C++" stack.

I copy it.

I open the copy (note that I run into issue #6571 and cannot change the name).

I scroll down to the "Components" part.

I add a component "cmake" and put in a version "3.2.0"

I save the new stack.

I create a new workspace using the new stack.

I enter "cmake" in the Terminal.

user@34735d068b6e:/projects$ cmake
bash: cmake: command not found
user@34735d068b6e:/projects$

OS and version:

Host is Ubuntu 17.04. Che is release 5.18.0.

I am doing all this remotely off of a Chromebook and I cannot figure out how to make screen shots...

kinquestion

Most helpful comment

@kyle-github "Components" don't install any software. It's apply information in the stack description. You need create custom stack with really installed cmake. There are few ways to do it in the our IDE. I describe one of them (main idea of this way: create custom stack which extends base cpp docker image by installation cmake):

  1. In the dashboard click "Stacks";
  2. Click "Build Stack From Recipe" ;
  3. In the window "Build stack from recipe" Copy and paste:
FROM eclipse/cpp_gcc
RUN sudo apt-get update -y && sudo apt-get install -y cmake
  1. Set normal stack name ("Cpp with cmake" for example) and normal description. Edit some another info if you want.
  2. Click save button.
  3. Stack will be created and you can tested it or create new workspace from this stack.

All 4 comments

@kyle-github "Components" don't install any software. It's apply information in the stack description. You need create custom stack with really installed cmake. There are few ways to do it in the our IDE. I describe one of them (main idea of this way: create custom stack which extends base cpp docker image by installation cmake):

  1. In the dashboard click "Stacks";
  2. Click "Build Stack From Recipe" ;
  3. In the window "Build stack from recipe" Copy and paste:
FROM eclipse/cpp_gcc
RUN sudo apt-get update -y && sudo apt-get install -y cmake
  1. Set normal stack name ("Cpp with cmake" for example) and normal description. Edit some another info if you want.
  2. Click save button.
  3. Stack will be created and you can tested it or create new workspace from this stack.

@kyle-github alternatively, you may build your own image based on the recipe @AndrienkoAleksandr has shared and push it to DockerHub, and then your custom recipe will be much simpler:

FROM namespace/repo

Thank, both of you. I will try this.

This works. Thanks!

Was this page helpful?
0 / 5 - 0 ratings