Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
让cmake在Windows 7上的Cygwin下工作_Windows_Cmake_Cygwin - Fatal编程技术网

让cmake在Windows 7上的Cygwin下工作

让cmake在Windows 7上的Cygwin下工作,windows,cmake,cygwin,Windows,Cmake,Cygwin,我在我的Windows7机器上安装了最新的Cygwin:Version2.893(64位)。我确保我包含了cmake,也就是说,在完成第一次安装后,我可以通过再次运行Cygwin net release安装程序来添加几个软件包。然后我尝试使用cmake并确保从bin目录调用它: user008@L0147816 /bin $ ./cmake CMake Error: Could not find CMAKE_ROOT !!! CMake has most likely not been inst

我在我的Windows7机器上安装了最新的Cygwin:Version2.893(64位)。我确保我包含了cmake,也就是说,在完成第一次安装后,我可以通过再次运行Cygwin net release安装程序来添加几个软件包。然后我尝试使用cmake并确保从bin目录调用它:

user008@L0147816 /bin
$ ./cmake
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
//share/cmake-3.6.2
Usage

cmake [options] <path-to-source>
cmake [options] <path-to-existing-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.
user008@L0147816/bin
美元/克马克
CMake错误:找不到CMake_根!!!
CMake很可能未正确安装。
在中找不到模块目录
//共享/cmake-3.6.2
用法
cmake[选项]
cmake[选项]
在中指定源目录以(重新)为其生成生成系统
当前工作目录。指定要创建的现有生成目录
重新生成其构建系统。
有关详细信息,请运行“cmake--help”。
我不知道构建目录可能在哪里。我对Cygwin比较陌生。我希望有人能找到一个解决方案,让cmake在Cygwin下安装并正常工作。

这看起来像cmake 101

假设您只想从某个地方下载一个软件 例如gl2ps:

# choosing a test area
$ cd /tmp
# downloading source
$ wget http://geuz.org/gl2ps/src/gl2ps-1.4.0.tgz
# expanding source code
$ tar -xf gl2ps-1.4.0.tgz
$ ls gl2ps-1.4.0-source/
CMakeLists.txt  COPYING.LGPL  gl2ps.h    gl2ps.tex    gl2psTestSimple.c
COPYING.GL2PS   gl2ps.c       gl2ps.pdf  gl2psTest.c  README.txt
# preparing a build area
$ mkdir build
$ cd build
# invoking cmake and pointing to the source directory 
$ cmake ../gl2ps-1.4.0-source/
-- The C compiler identification is GNU 7.3.0
[cut ...]
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build

# running the build 
$ make
Scanning dependencies of target shared
[ 11%] Building C object CMakeFiles/shared.dir/gl2ps.o
...
[ 88%] Building C object CMakeFiles/gl2psTestSimple.dir/gl2psTestSimple.o
[100%] Linking C executable gl2psTestSimple.exe
[100%] Built target gl2psTestSimple
要学习如何使用cmake进行构建,请转到

好的,我试过这个例子:但是我得到了同样的错误。此外,模块未在//share/cmake-3.6.2中找到。然后还有一行:“CMake错误:执行CMake::LoadCache()时出错。正在中止”。西格温!=Linux发行版。再次检查是否为101…好的,我的Windows机器上有几个cmake版本,我担心调用不同的版本-而不是与cygwin一起安装的版本。这就是为什么我从bin目录中选择“./cmake”。然而,现在我意识到,当我打开cygwin提示符时,无论如何都会调用正确的cmake可执行文件。无需在命令cmake前面添加点和斜线!因此,我尝试从一个新的“build”目录中使用cmake来构建最小的cmake示例——就像matzeri展示的那样。因此我走得更远了。我现在偶然发现了另一个问题:“找不到请求的Boost库”……您安装了Boost-devel软件包吗?是的,我下载了Boost软件包和gtest(或googletest)。我将它们放在/usr/local/中的两个单独文件夹中,并在文件CMakeCache.txt中填写路径。我现在能够编译这个示例,只有两个警告。