userdoc_cmake.dox
来自「一个语言识别引擎」· DOX 代码 · 共 106 行
DOX
106 行
/**
@page cmake Using CMake
YARP is for programmers. We'd like every YARP user all to use the
development environment you are used to, and not force you to switch
to something else -- no Linux/g++/emacs vs Windows/DevStudio vs
Mac/... fights please!
To achieve this without complete chaos, we ask you to install
"CMake". CMake lets us describe our programs and libraries in a
cross-platform way. CMake takes care of building the makefiles or
workspaces needed by whatever development environment you like to work
in.
Read about and install CMake from here: http://www.cmake.org/
@section cmake_install Tips for CMake Installation
Install CMake from here: http://www.cmake.org/HTML/Download.html
\li Windows: http://www.cmake.org/files/v2.4/cmake-2.4.2-win32-x86.exe
\li OSX Tiger: http://www.cmake.org/files/v2.4/cmake-2.4.2-2-Darwin-universal.dmg
\li Generic Linux: http://www.cmake.org/files/v2.4/cmake-2.4.2-Linux-i386.sh
\li Debian Linux: apt-get install cmake
\li SUSE Linux: add the GURU YAST repository and use YAST for installing CMake or download directly the rpm from GURU website access
@section cmake_windows CMake in Windows
On Windows, the easiest way to use CMake is via its GUI. After
installing, you should have an icon for CMake in your START
menu. Click that, then fill in the path to your code, and the path you
want CMake to build in (that can be the same if you want). Click
"configure". Depending on the project, configuration may involve
several steps -- you may have to answer new questions and click
"configure" again. When the "OK" button becomes clickable, then CMake
has enough information to set up your project. Click "OK" and you're
done. Project files of the type you specified should exist in the
build path you gave.
If you want to start over from the beginning with CMake, it is
important to press the "delete cache" button to make it forget
everything you've told it.
@section cmake_unix CMake in UNIX
On UNIX CMake can be used conveniently in two ways:
\li From the command line : type "cmake ."
\li Interactively: type "ccmake ."
If you are running CMake while in a directory different to where your code is, replace "." with the path to your code.
"ccmake" is very much like the Windows GUI, and you may need to iterate "configure" a few times before the option to "generate" appears.
"cmake" doesn't ask questions, and just uses defaults. You can pass it values on the command line:
\code
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .
\endcode
The generated file "CMakeCache.txt" contains all settings stored by CMake. It can be useful to delete this if you want to start over completely.
@section cmake_example CMake Example
Create a new directory, something like "$HOME/cmake/example" or "C:\cmake\example".
Inside that directory, create a file called "CMakeLists.txt". In it place the following:
\code
PROJECT(example)
ADD_EXECUTABLE(example main.cpp)
\endcode
In the same directory, create a file called "main.cpp". In it place the following:
\code
#include <stdio.h>
int main() {
printf("CMake the world a better place!\n");
return 0;
}
\endcode
In UNIX, type "cmake ." in that directory, and then "make", and then
"./example". Easy!
On Windows, run the CMake GUI, fill in the path to the example, click
"configure", say what compiler you use, click "configure" again if
needed, then click "ok". Then run your compiler, and finally the
program. Easy!
Notice that the abstract description of our project above can be
shared by developers on Windows, Linux, OSX, ...
\li There's another example you can try here: http://www.cmake.org/HTML/Examples.html
\li For more examples, and details, see: http://www.linuxjournal.com/article/6700
*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?