Is there a way to configure CMake such that a single make
command will launch both host and target builds? I have a project that is meant to be run on a target platform but requires some generated data from a generator
that needs to run on the host platform (PC). From CMake's documentation and looking around, I need a 2 pass build - first host to create the generator then the target crosscompiling build. My question is specifically how to launch the 2-pass build with a single make
command through CMake configurations (not using an external bash or python script).
Things I know
- CMake doesn't allow changing toolchain within a single build
- Almost solutions like: How to instruct CMake to use the build architecture compiler? Which is fine except I need to skip the 2nd step of using an external script
- How to separate what's run during crosscompiling or not cmake - compile natively and crosscompile the same code
- It is supposedly possible to launch multiple CMake builds using CMake How to make CMake targeting multiple plattforms in a single build