Skip to content

Don't put the extension modules in a per-config subdirectory - #272

Open
baszalmstra wants to merge 1 commit into
ros2:rollingfrom
baszalmstra:bas/no-generated-sources-in-install
Open

baszalmstra wants to merge 1 commit into
ros2:rollingfrom
baszalmstra:bas/no-generated-sources-in-install

Conversation

@baszalmstra

Copy link
Copy Markdown

Description

With Visual Studio, the extension modules are built into <pkg>/Release/, so a second copy of each is installed in site-packages/<pkg>/Release/. This builds them directly into the package directory.

Is this user-facing behavior change?

Did you use Generative AI?

Yes. The change, the commit message and this description were written with Claude Opus 5.5 (Anthropic, claude-opus-5-5), used through a coding agent.

With a multi-config generator such as Visual Studio, the
LIBRARY_OUTPUT_DIRECTORY and RUNTIME_OUTPUT_DIRECTORY of the
<pkg>_s__<typesupport> extension modules get a per-configuration
subdirectory appended, so the modules are built into
rosidl_generator_py/<pkg>/Release/. That directory is the Python
package that ament_python_install_package installs as a whole, so
every package ships a second copy of each module in
site-packages/<pkg>/Release/, next to the one installed by
install(TARGETS).

Wrap the output directory in a generator expression, which tells
CMake not to append the subdirectory. The modules now end up directly
in the package directory, which is where they are imported from.

Signed-off-by: Bas Zalmstra <4995967+baszalmstra@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant