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
Post a Comment