Ask Your Question
0

How to create an executable in the $package/bin directory ?

asked 2011-02-26 03:08:45 -0500

Willy Lambert gravatar image

updated 2011-02-26 03:13:01 -0500

I tried to use this in my CMakefile :

rosbuild_add_executable(arp_core.arp arp_core_main.c) INSTALL(TARGETS arp_core.arp RUNTIME DESTINATION bin)

but the exe does go into the bin directory, it stays in the root of the package folder.

I also defined theses : set( CMAKE_INSTALL_PREFIX ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2011-02-26 06:47:32 -0500

Straszheim gravatar image

updated 2011-02-26 06:48:16 -0500

You're not doing any installing so the install command doesn't come in to play. This should do it:

set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

see the docs at

cmake --help-full | less

You'd need to post your whole cmakelists for me to be sure.

edit flag offensive delete link more
0

answered 2011-02-26 10:13:45 -0500

Willy Lambert gravatar image

After reading what a roscreate-pkg (didn't thougth about this because I am using orocos create macros) produces it seems that the necessary line is :

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

My problem was that this line was before the rosbuild_init() line in the CMakeList !

thanks for answering anyway.

edit flag offensive delete link more

Comments

That makes sense... and Ouch.
Straszheim gravatar image Straszheim  ( 2011-03-13 15:14:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-02-26 03:08:45 -0500

Seen: 396 times

Last updated: Feb 26 '11