Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract a list of node executables from a given CMakeLists.txt #461

Open
ChrisTimperley opened this issue Jul 21, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@ChrisTimperley
Copy link
Member

This component should take a CMakeLists.txt file and return a list of NodeExecutable instances. Each NodeExecutable should describe:

  • the type of executable (i.e., Python/C++)
  • the name of the executable
  • a list of sources for the executable

The easiest and most robust way to implement the above is by using a visitor over the CMake AST [https://github.com/polysquare/cmake-ast]. The visitor need only visit two sorts of AST nodes:

  • those that define node executables (e.g., catkin_add_executable)
  • set(...) commands, which define CMake variables

The visitor can use a dictionary to maintain the state of all CMake variables. Upon visiting a set command, we write to the dictionary. Upon encountering a variable access (e.g., {SOURCES}), we use the dictionary to obtain the value for that variable.

To allow maximum code reuse (e.g., for ros-anatomy), it would be great if this code wasn't coupled to a running container (e.g., by running over the text contents of a CMakeLists.txt file).

@ChrisTimperley ChrisTimperley added the enhancement New feature or request label Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant