> -----Original Message----- > From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On > Behalf Of John Drescher > Sent: Monday, October 15, 2012 7:49 AM > To: Yuri Timenkov > Cc: cmake@cmake.org > Subject: Re: [CMake] cmake on Windows x64 > > > Except that you have CMAKE_SYSTEM_PROCESSOR == "x86" (event for > "Win64" > > generators) in your CMake files along with all search paths which > > sometimes very inconvenient. > > I am not sure that has ever caused me a problem on any of the 64 bit > applications I have written. The only problem I had with CMake was for > a while my x64 applications were being installed (by nsis) in "Program > Files (x86)" instead of "Program Files". I have since fixed my settings > for NSIS and this has worked for over a year for me.. > > John
Having CMAKE_SYSTEM_PROCESSOR be "x86" for a 64-bit build is very inconvenient when detecting machine-dependent compiler flags, constructing directory names for outputs based on configuration, configuring third party search directories, etc. It's always possible to work around (among other things, one can consult the generator string for Visual Studio builds, though not for MinGW builds) but that doesn't mean it shouldn't be better behaved - it's entirely reasonable to assume that CMAKE_SYSTEM_PROCESSOR should be the target processor for the build, especially so that you can have similar behavior on Windows, Linux, and Mac. Though as previously discussed I also have the opposite problem on Linux when compiling for 32-bit CPU on 64-bit OS. My workaround is to have my wrapper build scripts always set CMAKE_SYSTEM_PROCESSOR to the intended target (I also do lots of cross-compiling for ARM and MIPS) but this results in surprises for anyone who uses the CMake GUI directly, and makes CMake think it's cross compiling when it's not. Gregory Peele, Jr. Staff Software Engineer Virtual Heroes - Orlando Applied Research Associates, Inc. +1 (407) 823-9121 x 840013 -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake