Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

define layout folders for package and export-pkg commands #9674

Closed

Conversation

memsharded
Copy link
Member

Changelog: Fix: Command conan package now works for new layout() with generators folder.
Docs: Omit

  • conan export-pkg is still broken
  • It is possible that we need to discuss plans for 2.0 regarding package, export-pkg flows.

@memsharded memsharded added this to the 1.41 milestone Sep 26, 2021
build_config = "--config {}".format(bt) if bt and is_multi else ""

pkg_folder = self._conanfile.package_folder.replace("\\", "/")
arg_list = ["--install", self._conanfile.build_folder, build_config, "--prefix", pkg_folder]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the --install feature avoids needing an extra cmake.configure() in package() before cmake.install() to change the CMAKE_INSTALL_PREFIX that was already defined previously, and this allows conan export-pkg to work.

conanfile.folders.set_base_source(conanfile_folder)
conanfile.folders.set_base_package(dest_package_folder)
conanfile.folders.set_base_install(conanfile_folder)
conanfile.folders.set_base_generators(conanfile_folder)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to #9668:

  • I need to know the location of the generators_folder.
  • I prefer not needing an extra --build-folder cli argument

@@ -800,6 +801,7 @@ def package(self, path, build_folder, package_folder, source_folder=None, instal
conanfile.folders.set_base_source(source_folder)
conanfile.folders.set_base_package(package_folder)
conanfile.folders.set_base_install(install_folder)
conanfile.folders.set_base_generators(conanfile_dir)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, if conan package is removed in Conan 2.0, but this also relies on the conanfile location, not an extra --build-folder location.

@memsharded memsharded changed the title define generators_folder for package command define layout folders for package and export-pkg commands Sep 27, 2021
@memsharded
Copy link
Member Author

Merged and unified in #9668, as it is almost the same issue. Closing this.

@memsharded memsharded closed this Sep 29, 2021
@memsharded memsharded deleted the fix/package_command_layout branch September 29, 2021 12:35
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.

None yet

1 participant