-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Conan v2 #2805
Conan v2 #2805
Conversation
updated the test_package to be updated to conan 2 and fixed missing cmake. Still need to check that the license file is packaged up and that the packages look identical before the changes
…rt by checking the version of conan https://docs.conan.io/1/migrating_to_2.0/properties.html
…re no longer supported" This reverts commit a606d1d.
Adding a package build yaml to ensure conan keeps building on 1 and 2
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #2805 +/- ##
==========================================
+ Coverage 91.36% 91.37% +0.01%
==========================================
Files 197 197
Lines 8285 8285
==========================================
+ Hits 7569 7570 +1
+ Misses 716 715 -1 |
conanfile.py
Outdated
self.cpp_info.components["catch2base"].builddirs.append("lib/cmake/Catch2") | ||
|
||
# Catch2WithMain | ||
self.cpp_info.components["catch2main"].set_property("cmake_file_name", "Catch2WithMain") |
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.
Please do specify cmake_target_name
similar to
https://github.com/conan-io/conan-center-index/blob/master/recipes/catch2/3.x.x/conanfile.py#L168
That way you would be able to correctly use Catch2::Catch2WithMain
target instead of the lowercase.
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.
I think i did this. I kept the cmake_file_name
but not sure if that matters.
I also didn't realize that the conan file for conan.io is separate from this repo. So will this close the issue in reference? Maybe if it is maintained over there we just drop the conan files here
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.
The Conan Center policy is to maintain recipes for the default repo so in-source conanfiles are only needed for project-specific development. I'm not sure how many people require it so it's up to the maintainer in here to decide if it's still needed.
Regarding this specific PR - cmake_target_name
is used for the target name. It needs to be specified with namespace because of the different filename to namespace to target to component conventions different projects have. cmake_file_name
is needed only for the find_package
syntax, it's not useful for components and it doesn't make sense to specify the target name in there. The global level cmake_target_name
I think refers to the target which is wired on Conan-level global component dependencies, it's not actually used in CMake.
Additionally, prefer os.path.join
over the /
directory separator for cross-environment compatibility.
Thanks |
Description
This is to address the warnings and upcoming Conan 1 deprecation.
I compared the changes of the package before and after. I took a snapshot of the directory using conan 1 before changes. Then one with conan 2 after.
See the text files:
I added a build yaml for conan versions i tested against. I didn't do any c++ versioning or gcc testing since that is done with the other builds. I simply wanted to ensure that conan ran and could build against the test package. I kept backwards compatibility with v1.
There is a
.conan/build.py
file i was debating about removing. I don't think it is used but if it is how? The conan-package-tools don't work with conan 2.0. There aren't plans to support so not sure if that changes things as well.GitHub Issues
#2700