Conan: Don't call ``package()`` twice.

Created on 7 Feb 2019  路  3Comments  路  Source: conan-io/conan

(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.

low medium feature

Most helpful comment

As commented there, I think the solution could be:

  • Don't call package() twice.
  • Pass 2 (or a list) folders as origins to FileCopier.
  • FileCopier will iterate internally those origins.

All 3 comments

As commented there, I think the solution could be:

  • Don't call package() twice.
  • Pass 2 (or a list) folders as origins to 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uilianries picture uilianries  路  3Comments

theodelrieu picture theodelrieu  路  3Comments

claasd picture claasd  路  3Comments

uilianries picture uilianries  路  3Comments

tonka3000 picture tonka3000  路  3Comments