How to specify target platform for CMake? For instance x86, x64, amd64.
I've tried set TARGET_CPU=x64 but not sure does it works or not.
How to specify target platform for CMake? For instance x86, x64, amd64.
I've tried set TARGET_CPU=x64 but not sure does it works or not.
To specify it in the CMakeLists.txt use:
set(CMAKE_GENERATOR_PLATFORM x64)
and
set(CMAKE_GENERATOR_PLATFORM win32)
before calling the project() command
A little update for Cmake 3.17 and Visual Studio 2019.
In this case, even if you specify genertator with -G, you have to use -A option with either Win32 or Win64.