MantisBT - CMake
View Issue Details
0009981CMakeCMakepublic2009-11-30 17:332011-01-12 07:13
Dain 
Brad King 
normalmajoralways
closedfixed 
CMake-2-8 
CMake 2.8.4CMake 2.8.4 
0009981: refering to 0009746: Visual Studio 2010 generator does not work with VS2010 Beta2
As in Issue 0009746, When trying to use Visual Studio 2010 32 and 64 generator with the latest VS2010 Beta2, using the lines in CMakeVS10FindMake.cmake:

"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
 "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"

cmake would report error in "Detecting C compiler ABI info":


-------------------------------------------------------------------------
CMake Error: Could not COPY_FILE.
  OutputFile: ''
    copyFile: 'D:/programming/libs/vtkbin/CMakeFiles/CMakeDetermineCompilerABI_C.bin'

Unable to find executable for try_compile: tried "D:/programming/libs/vtkbin/CMakeFiles/CMakeTmp/cmTryCompileExec.exe" and "D:/programming/libs/vtkbin/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.exe" and "D:/programming/libs/vtkbin/CMakeFiles/CMakeTmp/Development/cmTryCompileExec.exe".

Detecting C compiler ABI info - done
---------------------------------------------------------------------


As indicated in Issue 0009746 the lines


< "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/v4.0.20506/"
< c:/WINDOWS/Microsoft.NET/Framework/v4.0.20506/
< "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/v4.0.21006/"
< c:/WINDOWS/Microsoft.NET/Framework/v4.0.21006/

fixed the problem, but only for the 32 bit generator. The 64 generator gives the following error:


----------------------------------------------------------------------
Check for working C compiler: cl
Check for working C compiler: cl -- broken
CMake Error at C:/Programme/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE):
  The C compiler "cl" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: D:/programming/libs/vtkbin/CMakeFiles/CMakeTmp

  

  Run Build Command:C:\Windows\Microsoft.NET\Framework\v4.0.21006\MSBuild.exe
  cmTryCompileExec.vcxproj /p:Configuration=Debug

  Microsoft (R) Build Engine Version 4.0.21006.1

  [Microsoft .NET Framework, Version 4.0.21006.1]

  Copyright (C) Microsoft Corporation 2007. All rights reserved.

  

  Build started 30.11.2009 17:34:37.

  Project
  "D:\programming\libs\vtkbin\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj"
  on node 1 (default targets).

  C:\Program Files
  (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7):
  error MSB8007: The Platform for project 'cmTryCompileExec.vcxproj' is
  invalid. Platform='x64'. You may be seeing this message because you are
  trying to build a project without a solution file, and have specified a
  non-default Platform that doesn't exist for this project.
  [D:\programming\libs\vtkbin\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj]

  Done Building Project
  "D:\programming\libs\vtkbin\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj"
  (default targets) -- FAILED.

  

  Build FAILED.

  

  "D:\programming\libs\vtkbin\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj"
  (default target) (1) ->

  (InvalidPlatformError target) ->

    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'cmTryCompileExec.vcxproj' is invalid. Platform='x64'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Platform that doesn't exist for this project. [D:\programming\libs\vtkbin\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj]

  

      0 Warning(s)
      1 Error(s)

  

  Time Elapsed 00:00:00.65

  

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:5 (PROJECT)


Configuring incomplete, errors occurred!
----------------------------------------------------------------------


The cl check worked before exchanging the lines and it still works in the visual studio 2010 beta2 32 generator.
No tags attached.
related to 0010722closed Brad King Add PlatformToolset support to Visual Studio 2010 generator 
Issue History
2009-11-30 17:33DainNew Issue
2009-11-30 19:45Bill HoffmanStatusnew => assigned
2009-11-30 19:45Bill HoffmanAssigned To => Brad King
2009-11-30 19:49Bill HoffmanNote Added: 0018619
2009-11-30 21:55DainNote Added: 0018620
2009-11-30 23:32Bill HoffmanNote Added: 0018621
2009-11-30 23:32Bill HoffmanAssigned ToBrad King => Bill Hoffman
2009-12-01 13:30DainNote Added: 0018624
2009-12-01 16:06Bill HoffmanNote Added: 0018628
2009-12-01 16:07Bill HoffmanNote Added: 0018629
2010-12-01 13:46Brad KingRelationship addedrelated to 0010722
2010-12-01 13:48Brad KingNote Added: 0023644
2010-12-01 13:48Brad KingStatusassigned => closed
2010-12-01 13:48Brad KingAssigned ToBill Hoffman => Brad King
2010-12-01 13:48Brad KingResolutionopen => fixed
2011-01-12 07:13David ColeFixed in Version => CMake 2.8.4
2011-01-12 07:13David ColeTarget Version => CMake 2.8.4

Notes
(0018619)
Bill Hoffman   
2009-11-30 19:49   
I don't think these bugs are related at all. In the first case it can not find MSBuild. In this case it does find MSBuild but it does not like the platform target x86. What version of CMake are you using for this?
(0018620)
Dain   
2009-11-30 21:55   
I am using the cmake 2.8.0 binaries from cmake.org.
When I use these lines in CMakeVs10FindMake.cmake

 "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
 "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"

the 64 b error looks like this:

-----------------------------------------------------------------------------

Check for working C compiler: cl
Check for working C compiler: cl -- works
Detecting C compiler ABI info
CMake Error: Could not COPY_FILE.
  OutputFile: ''
    copyFile: 'D:/programming/libs/vtkbin/CMakeFiles/CMakeDetermineCompilerABI_C.bin'

Unable to find executable for try_compile:
-------------------------------------------------------------------------------

The 32 bit has no error at all anymore. Unfortunately I don't have much experience with 64 bit systems, but how do you think can changing this line changes alter both errors, if they are not connected to each other?
(0018621)
Bill Hoffman   
2009-11-30 23:32   
That is not what you said in the first message. You said you had this message:
"
  C:\Program Files
  (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7):
  error MSB8007: The Platform for project 'cmTryCompileExec.vcxproj' is
  invalid. Platform='x64'. You may be seeing this message because you are
  trying to build a project without a solution file, and have specified a
  non-default Platform that doesn't exist for this project.
  [D:\programming\libs\vtkbin\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj]"


I am now thinking that you did not install the 64 bit part of your compiler. Can you compile a 64 bit program on your machine without CMake?
(0018624)
Dain   
2009-12-01 13:30   
Yes I can compile, but I use Visual Studio Expressin combination with the SDK compiler. That should be the problem??... Is there any way to use the SDK compiler?
(0018628)
Bill Hoffman   
2009-12-01 16:06   
You might want to try NMake Makefiles. I am not sure how to configure Visual Studio Express to use a different compiler by default. I am pretty sure the Visual Studio Express IDE can not do 64 bit out of the box as it is telling you...

Looks like it is possible, but not easy:

http://en.wikipedia.org/wiki/Microsoft_Visual_Studio_Express [^]

I am going to close this bug for CMake if that is OK with you?
(0018629)
Bill Hoffman   
2009-12-01 16:07   
Here is a how to link:

http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/ [^]
(0023644)
Brad King   
2010-12-01 13:48   
CMake 2.8.3 has full support for VS 2010 Professional 32-bit and 64-bit compilers. It also supports VS 2010 Express 32-bit tools. Only VS 2010 Express 64-bit builds remain, which are discussed in issue 0010722.

I'm closing this issue.