MantisBT - CMake
View Issue Details
0014693CMakeCMakepublic2014-01-11 07:512015-05-04 09:05
philrosenberg 
 
normalmajoralways
closedsuspended 
PCWindows8
CMake 2.8.12.1 
 
0014693: CMake fails when x64 tools are used
When building a 64 bit application/library with CMake it would seem logical that the VC++ x64 Tools command Prompt should be used. However, when this is performed using VC++ 2012 all tests for headers and functions fail. This obviously messes up the config.h file
download plplot 5.9.11
open VC++ 2012 x64 command tools
run cmake for plplot using the visual studio 11 x64 generator
check the newly created config.h
all entries are ifdefed out
No tags attached.
related to 0014642closed Kitware Robot CMAKE does not find the 64 bit versions of wxWidgets on Windows 
Issue History
2014-01-11 07:51philrosenbergNew Issue
2014-01-11 09:50Nils GladitzNote Added: 0034927
2014-01-13 09:23Brad KingNote Added: 0034929
2014-03-03 08:57Brad KingRelationship addedrelated to 0014642
2014-03-03 09:31Brad KingNote Added: 0035231
2014-03-04 15:43Brad KingNote Added: 0035249
2014-03-04 18:31philrosenbergNote Added: 0035251
2014-03-05 13:35Brad KingNote Added: 0035313
2014-12-15 09:09Brad KingStatusnew => resolved
2014-12-15 09:09Brad KingResolutionopen => suspended
2015-05-04 09:05Robert MaynardNote Added: 0038697
2015-05-04 09:05Robert MaynardStatusresolved => closed

Notes
(0034927)
Nils Gladitz   
2014-01-11 09:50   
The visual studio generators do not require the visual studio developer command prompt environments.
They are only required when using the "NMake Makefiles" or similar generators.

I tried the "NMake Makefiles" and the "Visual Studio 11" generators with both 32 and 64 bit and seem to be getting identical "config.h"s.

They all contain e.g. "#define HAVE_CMATH 1".

Is that entry missing for you as well or are you missing other specific entries?
(0034929)
Brad King   
2014-01-13 09:23   
To use the VS IDE with x64 tools use the "Visual Studio 11 Win64" generator in cmake-gui or at any prompt. To use NMake at the x64 tools command prompt use the "NMake Makefiles" generator.
(0035231)
Brad King   
2014-03-03 09:31   
I suspect that this issue is also the cause of the problems in 0014642.

What happens if you run CMake from a generic prompt with no VS environment configured to create a fresh build tree from a fresh source tree?
(0035249)
Brad King   
2014-03-04 15:43   
Re 0014693:0035231: Let's start with the simplest case rather than involving plplot or wxWidgets. Create a fresh source tree containing just the file:

>type CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(Issue14693 C)

foreach(v
    CMAKE_CL_64
    CMAKE_C_COMPILER
  )
  message(STATUS "${v}=${${v}}")
endforeach()

Then try building as follows:

>mkdir b
>cd b
>cmake .. -G "Visual Studio 11 Win64"

What is the output?
(0035251)
philrosenberg   
2014-03-04 18:31   
Hi Brad
So when I test this simple example all seems as it should. Output below

-- The C compiler identification is MSVC 17.0.61030.0
-- Check for working C compiler using: Visual Studio 11 2012 Win64
-- Check for working C compiler using: Visual Studio 11 2012 Win64 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- CMAKE_CL_64=1
-- CMAKE_C_COMPILER=C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/x
86_amd64/cl.exe
-- Configuring done
-- Generating done
-- Build files have been written to: D:/usr/local/src/cmake test/b
(0035313)
Brad King   
2014-03-05 13:35   
Re 0014693:0035251: Since the simple case works then it may be something plplot is doing. I think they have some custom platform information files to support extra languages and such. Please ask them for help running CMake on their project.
(0038697)
Robert Maynard   
2015-05-04 09:05   
Closing resolved issues that have not been updated in more than 4 months.