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
define layout folders for package and export-pkg commands #9674
Conversation
conan/tools/cmake/cmake.py
Outdated
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] |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
Merged and unified in #9668, as it is almost the same issue. Closing this. |
Changelog: Fix: Command
conan package
now works for newlayout()
with generators folder.Docs: Omit
conan export-pkg
is still brokenpackage
,export-pkg
flows.