[CMake] How to invoke 64 bit cmd.exe from cmake script on Windows 7 (x64).

David Cole david.cole at kitware.com
Sun Aug 22 16:30:25 EDT 2010


I do something like this in a batch file to guarantee running 32-bit from a
64-bit command prompt:

@rem  Workaround allows msys/cygwin rxvt to run on Windows x64

@rem    (SysWOW64\cmd.exe runs as 32-bit)

@rem

@if "%PROCESSOR_ARCHITECTURE%" equ "AMD64" (

  @"%WINDIR%\SysWOW64\cmd.exe" /c ""%~f0" %*"

  @exit /b 0

)

What you're asking for is the inverse: running a 64-bit program from a
32-bit program. I'm not sure what the right file reference to use is to do
this, but I'm sure you can do it..... If nobody else replies again to this
thread sooner, I'll try to figure out the right invocation and pass it
along.

Good luck,
David


On Sun, Aug 22, 2010 at 2:36 PM, Alexander Tarnopolsky <
Alexander.Tarnopolsky at pdgm.com> wrote:

>
> Hi,
>
> I'm trying to invoke an interactive shell from a cmake script using the
> following:
>
> execute_process (COMMAND ${SHELL} ${ARGS})
>
> And the 32bit cmd.exe is invoked on "Windows 7 x64" (since the cmake
> itself runs in 32bit environment).
> But I'm interested in 64bit cmd.exe.
> Is there a way to invoke it from cmake?
>
> Thanks in advance for your comments.
>
> Regards,
> Alexander Tarnopolsky
> Build Manager, Epos
>
> Alexander.Tarnopolsky at PDGM.com
> www.pdgm.com
>
> -----Original Message-----
> From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf
> Of Arnaud GELAS
> Sent: Friday, August 20, 2010 7:19 PM
> To: cmake at cmake.org
> Subject: [CMake] TRY_COMPILE and -Werror
>
>
>  Hi all,
>
> I would like to check if one piece of code generates a warning or not
> (about a deprecated method). I want to use TRY_COMPILE and adds -Werror
> to gcc flags.
>
> I have tried the following:
>
> TRY_COMPILE(VTK_FFMPEG_GUESSFORMAT
>          ${VTK_BINARY_DIR}/CMakeTmp
>          ${VTK_CMAKE_DIR}/vtkFFMPEGTestGuessFormat.cxx
>          CMAKE_FLAGS
> "-DINCLUDE_DIRECTORIES:STRING=${FFMPEG_INCLUDE_DIR}"
>            -DCOMPILE_DEFINITIONS:STRING=-D${VTK_FFMPEG_CDEFS}
>            -DCOMPILE_DEFINITIONS:STRING=-D__STDC_CONSTANT_MACROS
>           "-DLINK_LIBRARIES:STRING=${FFMPEG_avformat_LIBRARY}"
>           "-DCMAKE_CXX_FLAGS:STRING=-Werror"
>          OUTPUT_VARIABLE OUTPUT)
>
> But VTK_FFMPEG_GUESSFORMAT is still true...
>
> Any idea?
>
> Thanks,
> Arnaud
> _______________________________________________
> 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
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100822/497e1d4b/attachment-0001.htm>


More information about the CMake mailing list