vico
vico

Reputation: 18221

Where is the CMake GUI for Linux?

I have CMake installed on my Ubuntu Linux. Trying to run CMake GUI in Linux. I found it works in Windows, but where to get it and how to run in Linux?

Upvotes: 31

Views: 99930

Answers (6)

cmake is documented (type man cmake and see also cmake.org) as being a command, so it should not have any GUI interface:

DESCRIPTION

  The  "cmake" executable is the CMake command-line interface.  It may be
   used to configure projects in scripts.  Project configuration  settings
   may be specified on the command line with the -D option.

And it is just generating a Makefile (to be used by the make command). I don't understand what kind of GUI are you expecting.

On Debian and derivatives like Ubuntu, you might install the cmake-gui or cmake-qt-gui package then run the cmake-gui command.

And make is often running GCC. Try make -p to understand the default rules of GNU make... So read documentation of GNU make and of GCC (and probably of GDB).

Upvotes: 16

Elliptical view
Elliptical view

Reputation: 3812

If you're building the latest from source, this is a lot harder than anyone else here suggests. I finally found this that got it working:

First, download the source from: https://cmake.org/download/

More specifically for Ubuntu 14.04 or higher, 64 bit get: https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz

Download it to the following directory (or any directory you like!): /opt/dev-tools-sources

Unzip it there, using GUI archive manager or $ tar -zxvf cmake-3.5.2.tar.gz

You should have now a folder like this: /opt/dev-tools-sources/cmake-3.5.2


Go to this folder: $ cd /opt/dev-tools-sources/cmake-3.5.2

Install openssl to allow CMAKE have access to ssl protected websites if it needs to download extra files $ sudo apt install openssl libssl-dev

Edit the bootstrap file and change the line: cmake_options="-DCMAKE_BOOTSTRAP=1"

To this cmake_options="-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=ON"

If you want cmake-gui, you will need qt4 libs an ncurses $ sudo apt install libqt4-dev qt4-dev-tools libncurses5-dev

Run the configuration (you need to have gcc and g++ 4.7 or higher installed. I recommend 4.8.4 or higher actually!) $ ./configure --qt-gui


Make sure in the generated CMakeCache.txt, GUI is set to TRUE, open CMakeCache.txt with any editor and check the following line: BUILD_QtDialog:BOOL=ON

If it was OFF or 0, make it ON or 1


It is time to build executables and libraries from source: $ make -j2

Now, install: $ sudo make install

Confirm you also got GUI version with $ cmake-gui

Upvotes: 4

ccmake curses UI

sudo apt-get install cmake-curses-gui
cd build
ccmake ..

Then:

  • edit your options
  • hit c to update the cache
  • q to exit

And now you can make again with the new variables.

Tested in Ubuntu 16.10, cmake 3.5.2.

Upvotes: 8

mark sabido
mark sabido

Reputation: 440

Update: As of CMake 3.7.2, cmake-gui is still not built by default, but can easily be added to the build by specifying one additional flag. Qt is still required, I am using 4.8 but I'm sure other versions will work fine.

Download the source from the website, extract to a directory of your choosing, then run the following at the commmand line:

  • ./bootstrap --qt-gui
  • gmake
  • gmake install (optional - don't forget sudo if you need it)

Hey presto! cmake-gui is now present in the bin directory along with the other tools.

Note: if the build process fails in some way, just check the error message and work with it! There are too many pre-requisites and variables, attempting to detail them all would make the post tl;dr and would be out of date before being submitted (see one of the other posts for an example of this).


Basic installation for CMake

Under linux it comes with the default installation from the cmake website (at least for version 3.5.1)

It is installed in the same place as cmake, which on my machine is:

/usr/local/bin/cmake-gui

I built my cmake from source and by default, cmake-gui does not get built. To add as a target, the following variable must be set:

BUILD_QtDialog

eg. SET(BUILD_QtDialog TRUE) should do it

Note: cmake-gui is based on Qt so you must have Qt installed if you want to build it.

Upvotes: 20

Anonymous
Anonymous

Reputation: 4757

For Ubuntu (and I guess for more linux versions):

 sudo apt-get install cmake-qt-gui

Can be started after installation as cmake-gui or by using the ubuntu GUI (just type cmake and it will show the typical cmake-gui-icon)

Upvotes: 13

Muhammad Aqeel
Muhammad Aqeel

Reputation: 101

I also faced a similar problem. I did something like:

  1. Open https://apps.ubuntu.com/cat/applications/precise/cmake-qt-gui/ and click available on the software centre.
  2. new window opens and click install
  3. write cmake-gui on terminal

and it solved my problem.

Upvotes: 0

Related Questions