HelloWorld with CMake
Leopold Palomo-Avellaneda
leo at alaxarxa.net
Tue Dec 4 14:51:32 CET 2018
El 4/12/18 a les 12:40, Evandro Sestrem via Xenomai ha escrit:
> Hello,
>
> Is it possible to use CMake to compile a Xenomai program?
Yes
> I want to use Xenomai in a ROS 2 node. To do this, I need to be able to
> compile it with CMake.
However I don't know if amend is able to do it.
> I'm trying to compile a HelloWorld Xenomai program using CMake.
>
> I put this project in https://github.com/sestrem/xenomai_helloworld_cmake
>
> The main files are:
> helloWorld.c
> CMakeLists.txt
>
> When I execute "cmake .", everything is fine:
>
> -- The C compiler identification is GNU 6.3.0
> -- The CXX compiler identification is GNU 6.3.0
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/pi/testes/xenomai/helloWorld
>
>
> But, after this, when I execute "make":
>
> Scanning dependencies of target helloWorld
> [ 50%] Building C object CMakeFiles/helloWorld.dir/helloWorld.c.o
> In file included from /usr/xenomai/include/copperplate/threadobj.h:28:0,
> from /usr/xenomai/include/alchemy/task.h:25,
> from /home/pi/testes/xenomai/helloWorld/helloWorld.c:5:
> /usr/xenomai/include/boilerplate/lock.h:23:34: fatal error:
> boilerplate/wrappers.h: file or directory not found
> #include <boilerplate/wrappers.h>
if fails with the includes.
> ^
> compilation terminated.
> CMakeFiles/helloWorld.dir/build.make:62: recipe for target
> 'CMakeFiles/helloWorld.dir/helloWorld.c.o' failed
> make[2]: *** [CMakeFiles/helloWorld.dir/helloWorld.c.o] Error 1
> CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/helloWorld.dir/all'
> failed
> make[1]: *** [CMakeFiles/helloWorld.dir/all] Error 2
> Makefile:83: recipe for target 'all' failed
> make: *** [all] Error 2
>
>
> ** cmake_xenomai attempt **
> ---------------------
> I also tried to use the cmake_xenomai github project:
> git clone https://github.com/nolange/cmake_xenomai
>
> But when I check the patch:
> git apply --check
> /home/pi/cmake_xenomai/patchset/0001-add-an-flexible-bootstrap-template-header.patch
>
> I got these errors, so I didn't applied it:
> error: include/xenomai/Makefile.am: no such file or directory
> error: include/xenomai/init.h: no such file or directory
> error: lib/boilerplate/init/Makefile.am: no such file or directory
> error: lib/boilerplate/init/bootstrap.c: no such file or directory
>
>
> Evandro Sestrem
>
if you want, could you try to use:
https://github.com/iocroblab/xenomai-cmake
Cheers,
Leopold
--
--
Linux User 152692 GPG: 05F4A7A949A2D9AA
Catalonia
-------------------------------------
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://xenomai.org/pipermail/xenomai/attachments/20181204/1c4a86b1/attachment.sig>
More information about the Xenomai
mailing list