[CMake] crosscompilation and source generation via add_custom_command

Jędrzej Dudkiewicz jedrzej.dudkiewicz at gmail.com
Mon Feb 3 16:20:16 EST 2020


On Mon, Feb 3, 2020 at 9:22 PM Hendrik Sattler <post at hendrik-sattler.de> wrote:
> Am 3. Februar 2020 20:48:50 MEZ schrieb "Jędrzej Dudkiewicz" <jedrzej.dudkiewicz at gmail.com>:
> >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.
>
> You can compile the tool using ExternalProject. This needs a separate directory with a its own CMakeLists.txt file for the tool.

Thank you, I will look into it, although I'm not sure if this isn't a
massive overkill in my case.

Thanks!
-- 
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