[CMake] crosscompilation and source generation via add_custom_command

Jędrzej Dudkiewicz jedrzej.dudkiewicz at gmail.com
Mon Feb 3 14:48:50 EST 2020


Hello,

I cross-compile a project from x86_64-linux-gnu to
arm-linux-gnueabihf. Currently this is done using hand-written
Makefiles, but I"m moving it to cmake. This project uses custom
version of `lemon` parser generator. Aforementioned lemon is included
as a source - this is single .c file that is compiled during build. Is
there a way to build and run this binary on x86_64-linux-gnu while
cross-compiling to arm-linux-gnuabihf? I suppose I could
add_custom_command that would compile using hardcoded compiler
version, but it doesn't seem very nice.

Thanks in advance,
-- 
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.


More information about the CMake mailing list