Skip to content

Conversation

hoffmann-stefan
Copy link
Member

@hoffmann-stefan hoffmann-stefan commented Apr 23, 2023

upstream PR for this internal one: schiller-de#1

New variants of add_dotnet_*

This PR adds the posibility to use your own *.csproj files instead of generating one with cmake.
This makes it easier to use advanced *.csproj features needed for ASP.NET as the developer can directly manipulate the .csproj file.

This is how the new commands corespond to the existing ones:

add_dotnet_executable -> add_dotnet_executable_project
add_dotnet_library -> add_dotnet_library_project
add_dotnet_test -> add_dotnet_test_project

Example:

...
set(_assemblies_dep_dlls
    ${rcldotnet_common_ASSEMBLIES_DLL}
    ${rcldotnet_ASSEMBLIES_DLL}
    ${std_msgs_ASSEMBLIES_DLL}
    ${std_srvs_ASSEMBLIES_DLL}
)

add_dotnet_executable_project(RosBlazorExample
  PROJ
  src/RosBlazorExample/RosBlazorExample.csproj
  INCLUDE_DLLS
  ${_assemblies_dep_dlls}
)

install_dotnet(RosBlazorExample
  CD_TO_EXECUTABLE
  ENTRY_POINT_NAME
  ros_blazor_example
  DESTINATION
  lib/${PROJECT_NAME}/dotnet
)
...

RosBlazorExample.csproj needs to import a generated file for this to work:

  <Import Project="obj/CMake.g.props"/>

@hoffmann-stefan hoffmann-stefan force-pushed the feature/add-dotnet-project branch from f784e1e to a416560 Compare May 3, 2023 20:04
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.

2 participants