[CMake] Visual Studio Cross Compile

Nils Gladitz nilsgladitz at gmail.com
Mon Nov 2 07:16:01 EST 2015


On 11/02/2015 12:41 PM, Michael Jäntsch wrote:
> Hi again,
>
> Is there nobody who can help me? I thought it would be a common thing 
> to use cmake to cross compile!? Has nobody ever used visual studio to 
> do so?

Visual Studio itself does not have compiler selection in the same sense 
as is available with e.g. Makefiles or Ninja.
It can not be directly told to use specific compiler paths (you will not 
find any compiler paths in the generated solutions/projects).

It does support "Platform Toolset"s which in manually created projects 
can be set/seen in the "General" project settings and in CMake generated 
projects can be set via the -T option [1].

I'd stick to Ninja or Makefiles for cross-compiles unless you are 
targeting something with pre-existing toolset support.
I think e.g. Android is supported via CMAKE_SYSTEM_NAME "Android" and 
NVIDIA Nsight Tegra integration [2].

Nils

[1] https://cmake.org/cmake/help/v3.3/variable/CMAKE_GENERATOR_TOOLSET.html
[2] https://cmake.org/cmake/help/v3.3/release/3.1.html#nvidia-nsight-tegra


More information about the CMake mailing list