Windows上的MinGW32 make命令 [英] MinGW32 make command on windows

查看:1092
本文介绍了Windows上的MinGW32 make命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用MingW32和cmake在Windows上安装模拟软件。

I am trying to install a simulation software on windows using MingW32 and cmake.

我遇到的问题是使用后:

The problem I have is after I use :

cmake .. -DCMAKE_INSTALL_PREFIX="/cygdrive/c/Gromacs467" -DGMX_X11=OFF -DGMX_GPU=OFF -DGMX_MPI=OFF -DGMX_PREFER_STATIC_LIBS=ON -DGMX_CPU_ACCELERATION=SSE2 -DBUILD_SHARED_LIBS=NO -DGMX_BUILD_OWN_FFTW=ON -VMDDIR="C:\Program Files (x86)\University of Illinois\VMD"  -G "MinGW Makefiles"

从Microsoft视觉工作室(否则,我会在其他问题上跑过)。

From a Microsoft visual studio, (Otherwise I ran in other issue).

然后我启动一个MinGW控制台并转到创建我的Makefile的库,然后输入命令make,这就是我得到的:

I then start a MinGW console and go to the repertory where my Makefile was created, and enter the command make, and here is what I get :

c:\Temp\gromacs-4.6.7\cmake_build>make
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

很自然,make命令实际上不会执行。为什么我得到Windows版本?不知道。...

And naturally the make command does not actually execute. Why do I get the windows version ? No idea....

有趣的是,如果我多次输入MniGW32控制台的名称,则在最后添加make,然后继续这样做以后。

Interestingly enough, the name of the MniGW32 console change to add make at the end if I enter it more than once, and keeps on doing it later.

make --version提供正常的输出,所以我不知道问题出在哪里。

make --version gives the normal output, so I do not understand where the problem comes from.

c:\Temp\gromacs-4.6.7\cmake_build>make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-msys


推荐答案

而不是直接调用 make ,您可以让CMake使用以下语法为您调用该构建:

Instead of calling make directly, you can let CMake invoke the build for you with the following syntax:

cmake --build <build-dir> --target <target-name> --config <build-type>

-目标-config 参数是可选的,< build-dir> 必须指向您的CMake项目的生成目录。以这种方式调用构建的主要优点是CMake已经确定了构建工具,并且知道在哪里可以找到它以及如何正确调用它。以这种方式通过CMake调用构建可能会更健壮。

The --target and --config arguments are optional and <build-dir> must point to your CMake project's build directory. The main advantage to invoking your build this way is that CMake has already determined the build tool and knows where to find it and how to invoke it correctly. Invoking your build via CMake in this manner is likely to be more robust.

-build 在此处可用的选项,一些相关材料可以在< a href = https://crascit.com/2016/04/03/scripting-cmake-builds/ rel = nofollow>此博客文章,尤其是抽象化构建工具部分(披露:我写了博客文章)。

Basic CMake documentation for the --build option available here and some related material can be found in this blog post, particularly the section "Abstracting away the build tool" (disclosure: I wrote the blog article).

这篇关于Windows上的MinGW32 make命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆