<div dir="ltr">We're trying to convert a project from using a very old hand-built makefile (the original version was written over 20 years ago!) to using cmake. We want to do the builds using command line nmake, not using Visual Studio project files. <div>
<br></div><div>With our existing setup, to switch between 32- and 64- bit builds, we only need to change the option specified on the vcvarsall batch file and do a clean build. The tools figure out from the environment variables which build we're doing any everything works great. </div>
<div><br></div><div>We've started our conversion by converting one of our smaller library files. All of the source files appear to compile correctly, but when we get to the link, we're getting the following error: </div>
<div><br></div><div><div>Linking CXX shared library CMakeFiles\bin\rexxapi.dll</div><div>msvcprtd.lib(MSVCP120D.dll) : fatal error LNK1112: module machine type 'x64' con</div><div>flicts with target machine type 'X86'</div>
<div>LINK Pass 1 failed. with 1112</div><div>NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe"' :</div><div>return code '0xffffffff'</div><div>Stop.</div><div>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0</div>
<div>\VC\BIN\amd64\nmake.exe"' : return code '0x2'</div><div>Stop.</div><div>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0</div><div>\VC\BIN\amd64\nmake.exe"' : return code '0x2'</div>
<div>Stop.</div></div><div><br></div><div>looking at the generated build.make file, I see that the option /machine:X86 appears on the link command. I tried manually deleting that option, but the error persisted. What do I need to do for cmake to generate the correct 64-bit logic...and equally as important, how do we switch between doing 32-bit and 64-bit builds when needed?</div>
<div><br></div><div>And let me repeat, we do not want to use the Visual Studio generators...we want the nmake version. </div><div><br></div><div>Rick</div></div>