cross platform - How to make CMake targeting multiple plattforms in a single build -


i'd configure cmake project in way, single build execution targets multiple platforms (in case i'd build linux , windows, x86_32 , x86_64 targets each). have cross compiler toolchains installed , working, , building each individual target works.

so challenge setting cmake in way, toolchain , cmake_system_… variables set appropriately each sub-build. how can that?

this not possible, in general.

cmake allows configuring single target platform @ once. if want target different platform, need re-run cmake scratch. true switching architectures when rest of toolchain remains same (for instance, cannot build x86 , x64 binaries @ same time).

the proper way automate have enclosing build script invokes cmake once each target platform , performs several out-of-source builds distinct binary directories. enclosing script written in cmake (the externalproject module works quite this), although general purpose scripting language python or bash might better fit.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -