ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

If your concern are the header files I recommend you to use this simple pattern:

FILE(GLOB_RECURSE HEADER_FILES include *.h)

add_executable(executable_name mysourcefile.cpp ${HEADER_FILES} )

If your concern are the header files I recommend you to use this simple pattern:

FILE(GLOB_RECURSE HEADER_FILES include *.h)

add_executable(executable_name mysourcefile.cpp ${HEADER_FILES} )

It is also possible to create a different target (this may be better) to avoid adding the new files to the executable target.

FILE(GLOB_RECURSE HeadFiles "include/*.h") add_custom_target(headers SOURCES ${HeadFiles})

It is possible to do this with other files, like msg files, config files, launch files, etc.

The only issue here, is that you are introducing some code in CMake that has no too much sense and it is only useful for qtcreator (while the CMake philosophy is making the development independent to any IDE)

If your concern are the header files I recommend you to use this simple pattern:

FILE(GLOB_RECURSE HEADER_FILES include *.h)

add_executable(executable_name mysourcefile.cpp ${HEADER_FILES} )

It is also possible to create a different target (this may be better) to avoid adding the new files to the executable target.

FILE(GLOB_RECURSE HeadFiles "include/*.h") "include/*.h")

add_custom_target(headers SOURCES ${HeadFiles})

It is possible to do this with other files, like msg files, config files, launch files, etc.

The only issue here, is that you are introducing some code in CMake that has no too much sense and it is only useful for qtcreator (while the CMake philosophy is making the development independent to any IDE)