cpack -G NuGet : how does one generate the targets file?

Hi All

First time poster

Quick question: what’s the recommended way to add a build/native/some_pkg_name.targets file to a NuGet package with CPack?

I can certainly use something like the following:
install(FILES project_name.targets DESTINATION build/native)
but then the file will get added to all kinds of packages, aven when not relevant.

Thanks for any advice on the matter

1 Like

Cc: @zaufi

Hi @masariello,

You can use CPACK_INSTALL_SCRIPTS to check the current generator and perform install() conditionally for the desired one.