Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 234
vico Avatar asked Sep 06 '15 16:09

vico


People also ask

Where is CMake-gui?

Run cmake-gui.exe, which should be in your Start menu under Program Files, there may also be a shortcut on your desktop, or if you built from source, it will be in the build directory.

What is CMake-gui?

CMake is a cross-platform build system generator. Projects specify their build process with platform-independent CMake listfiles included in each directory of a source tree with the name CMakeLists. txt . Users build a project by using CMake to generate a build system for a native tool on their platform.

Where is CMake in Linux?

The installation directory is usually left at its default, which is /usr/local . Installing software here ensures that it is automatically available to users. It is possible to specify a different installation directory by adding -DCMAKE_INSTALL_PREFIX=/path/to/install/dir to the CMake command line.

How do I invoke CMake-gui?

Running cmake-gui To use it, run cmake-gui , fill in the source and binary folder paths, then click Configure. If the binary folder doesn't exist, CMake will prompt you to create it. It will then ask you to select a generator.


2 Answers

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.

like image 196
mark sabido Avatar answered Oct 14 '22 21:10

mark sabido


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).

like image 30
Basile Starynkevitch Avatar answered Oct 14 '22 21:10

Basile Starynkevitch