crosscompilation and source generation via add_custom_command

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

crosscompilation and source generation via add_custom_command

Jędrzej Dudkiewicz
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.
--

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org
Reply | Threaded
Open this post in threaded view
|

Re: crosscompilation and source generation via add_custom_command

Hendrik Sattler


Am 3. Februar 2020 20:48:50 MEZ schrieb "Jędrzej Dudkiewicz" <[hidden email]>:

>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.

>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.
>--
>
>Powered by kitware.com/cmake
>
>Kitware offers various services to support the CMake community. For
>more information on each offering, please visit
>https://cmake.org/services
>
>Visit other Kitware open-source projects at
>https://www.kitware.com/platforms
>
>Follow this link to subscribe/unsubscribe:
>https://cmake.org/mailman/listinfo/cmake
>
>This mailing list is deprecated in favor of https://discourse.cmake.org
--

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org
Reply | Threaded
Open this post in threaded view
|

Re: crosscompilation and source generation via add_custom_command

Jędrzej Dudkiewicz
On Mon, Feb 3, 2020 at 9:22 PM Hendrik Sattler <[hidden email]> wrote:

> Am 3. Februar 2020 20:48:50 MEZ schrieb "Jędrzej Dudkiewicz" <[hidden email]>:
> >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.
--

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org