Multiple files in one add_executable
I refer to this CMakeLists.txt
I am confused with the add_executable there. For example:
add_executable(drone_stateestimation ${STATEESTIMATION_SOURCE_FILES} ${STATEESTIMATION_HEADER_FILES})
The STATEESTIMATION_SOURCE_FILES and STATEESTIMATION_HEADER_FILES refers to multiple files:
set(STATEESTIMATION_SOURCE_FILES
src/stateestimation/GLWindow2.cc
src/stateestimation/GLWindowMenu.cc
src/stateestimation/main_stateestimation.cpp
....
and
set(STATEESTIMATION_HEADER_FILES
src/stateestimation/GLWindow2.h
src/stateestimation/GLWindowMenu.h
src/stateestimation/MouseKeyHandler.h
src/HelperFunctions.h
....
My QUESTIONS:
I don't understand how they work. The case that I know (from my limited experience) so far is just add_executable( node_name file.cpp).
If there are multiple files referring to one node, which code is executed when we run that node?
Why do we add the header files to the add_executable? I never saw this before.
Please help to explain.
-----.
PS: I saw from the catkin wiki page here as well on point 7.4 "This will build a target executable called myProgram which is built from 3 source files: src/main.cpp, src/some_file.cpp and src/another_file.cpp."
But I don't understand. Like when we call that node , which file is executed? are they all executed? which order?