问题
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?
回答1:
cmake
is documented (type man cmake
) 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.
回答2:
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.
回答3:
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)
回答4:
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 of all download the source from here: https://cmake.org/download/
More specificly for Ubuntu 14.04 or higher, 64 bit: 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 or command line $tar -zxvf cmake-3.5.2.tar.gz 1 $tar -zxvf cmake-3.5.2.tar.gz
You should have now a folder like this /opt/dev-tools-sources/cmake-3.5.2 1
/opt/dev-tools-sources/cmake-3.5.2Go to this folder $cd /opt/dev-tools-sources/cmake-3.5.2 1 $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 1 $sudo apt install openssl libssl-dev
Edit the bootstrap file and change the line: cmake_options="-DCMAKE_BOOTSTRAP=1" 1
cmake_options="-DCMAKE_BOOTSTRAP=1"To this cmake_options="-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=ON" 1
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 1 $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 1 $./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 1 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 1 $make -j2
Now, install: $sudo make install 1 $sudo make install
Confirm you got gui version also $cmake-gui 1 $cmake-gui
ENJOY!
回答5:
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.
回答6:
I also faced a similar problem. I did something like:
- Open https://apps.ubuntu.com/cat/applications/precise/cmake-qt-gui/ and click available on the software centre.
- new window opens and click install
- write cmake-gui on terminal
and it solved my problem.
来源:https://stackoverflow.com/questions/32425599/where-is-the-cmake-gui-for-linux