Building CMAKE for cygwin

早过忘川 提交于 2021-02-08 10:13:01

问题


This is my first time using both Cygwin and cmake, I'm trying to build a project but keep getting errors.

-bash: /usr/local/bin/cmake: cannot execute binary file

The questions I have are, where should cmake be installed and how do I run it?

Where should my source code be?

Do I need anything extra to get cmake to work in Cygwin?

Here is a link to the project I am trying to run: (https://github.com/erinaceous/shadows)


回答1:


cmake is available in the Cygwin net distribution. You can install it with setup-x86*.exe; you should find it under the Devel category.




回答2:


Cygwin's mirrors are not always up-to-date. To build your own from source for Cygwin (these instructions assume some version of cmake is already installed on your system, as is a compiler (eg. g++):

  1. Download the latest (v3.4.1 at the time of this writing) source from CMake.org/files. Be sure to enter the folder and also enter the cygwin folder within, and download the latest version (eg. https://cmake.org/files/v3.4/cygwin/cmake-3.4.1-1.tar.bz2)
  2. From cygwin, cd to the folder where you downloaded the tar.bz2 file and type:

    tar xvjf cmake-{x.y.z}.tar.bz2 #for me, the actual filename was cmake-3.4.1-1.tar.bz2
    cd cmake-{x.y.z}
    ./configure
    make
    

from there, you'll find your binaries in the ./bin folder.



来源:https://stackoverflow.com/questions/28410889/building-cmake-for-cygwin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!