(new issue as requested by https://github.com/conan-io/conan/issues/4438#issuecomment-461341370)
https://docs.conan.io/en/latest/reference/build_helpers/cmake.html#example shows the current best practice when using cmake.install() within the package() method is desired. This works quite nicely for in-source builds (as soon as #4438 is fixed).
However, when following also cmake's best practice to build code out of source, results are sub optimal at the moment. In particular, using conan's no_copy_source = True recipe attribute causes that the package() method gets called twice which also leads to duplicated calls to cmake.configure() and cmake.install().
Any good approach to fix this would be highly appreciated.
As commented there, I think the solution could be:
package() twice.FileCopier.FileCopier will iterate internally those origins.As reported in https://github.com/conan-io/conan/issues/4561, this also happens for conan export-pkg.
The problem is the same, package() is called twice to account for multiple origins of files to be copied.
This will be released in Conan 1.14. Also cc @DmitrySokolov because #4561, that should be fixed too.
Most helpful comment
As commented there, I think the solution could be:
package()twice.FileCopier.FileCopierwill iterate internally those origins.