如何从CMAKELIST正确设置visual studio平台工具集到v100?

时间:2014-07-02 12:03:54

标签: visual-studio-2010 visual-studio-2012 cmake

****大家好,

由于错误消息,我会在这里粘贴,帖子可能看起来很长但是它真的很短!! 我正在开发一个Windows 7(64位),我必须生成一个c ++ visual studio IDE,其中cmake使用visual studio 10编译的库。但我想使用visual studio 12!我的电脑上有视觉工作室10和12!

When I try to compile using the CMAKE-Gui setting Visual Studio 10 (Win64) as compiler:****

...

testCCompiler.c
1> 
1> testCCompiler.c
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.84

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:16 (project) Configuring incomplete, errors occurred! See also ...

当我尝试使用CMAKE-Gui设置Visual Studio 10(这个可能是32位)作为编译器进行编译时:

 testCCompiler.c


LINK : fatal error LNK1123: failure during conversion to COFF: file
invalid or corrupt





1>Build FAILED.
...

当我使用Visual Studio 12(Win64)编译时,出现此错误:

CMake Error: CMake was unable to find a build program corresponding to "Visual Studio 12 Win64". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Could not find cmake module file: U:/Develop/CMAKE Builds/ADTF_PLUGINS_DATAFUSION111/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake
CMake Error: Could not find cmake module file: U:/Develop/CMAKE Builds/ADTF_PLUGINS_DATAFUSION111/CMakeFiles/2.8.12.2/CMakeCXXCompiler.cmake
Configuring incomplete, errors occurred!

    只有当我使用cmake设置时,Visual Studio 11(Win64)才能正常工作,但是当我在visual studio 12中打开解决方案并且comlpiled时,编译器发生了冲突:

error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in cBaseFusionViewer.obj   U:\Develop\CMAKE Builds\[…]

我可以在visual studio中手动将TOOLSET属性从v110更改为v100,但我想从cmake自动执行此操作。我尝试了以下几行但没有成功:

set compiler visual studio 10

set(PLATFORM_WIN32_MSVC_TOOLSET v100 CACHE STRING "MSVC Platform toolset" FORCE)

set(PLATFORM_SUFFIX "-v100" CACHE STRING "" FORCE)

因此我有以下两个问题: - 当我安装Visual Studio 12时,为什么在cmake中有一个列出的工作编译器Visual Studio 11(win64),并且通过cmake生成解决方案失败了! - 如何在cmake中正确设置工具集编译器v100!???

感谢您的支持!!

0 个答案:

没有答案