-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
adding new package cvplot #8167
Conversation
This comment has been minimized.
This comment has been minimized.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This comment has been minimized.
This comment has been minimized.
Header-only is sufficient. The library is very small and we can avoid all possible problems coming from the heavy opencv requirement. |
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.
Thank you for bringing your project to Conan Center!
I have question about the CMake target ...
Conan will generate cvplot as target name, but your project doesn't export a target, however, it uses CvPlot (CamelCase) as internal target name. So my question is, which one is the correct to be exported?
Co-authored-by: Uilian Ries <uilianries@gmail.com>
Co-authored-by: Uilian Ries <uilianries@gmail.com>
Good question! I dont know. The CMake target (and c++ namespace) is |
This comment has been minimized.
This comment has been minimized.
@wpalfi Conan tries to follow the upstream as most important rule, we don't try to customize target names. When a project doesn't specify a target, we usually get the project name, or what's most popular on the internet, like official Findxxx.cmake or projects consuming. Otherwise, we just use lower cased name. Said that, we should use |
Co-authored-by: Uilian Ries <uilianries@gmail.com>
This comment has been minimized.
This comment has been minimized.
|
||
def package_info(self): | ||
self.cpp_info.defines.append("CVPLOT_HEADER_ONLY") | ||
self.cpp_info.set_property("cmake_find_mode", "both") |
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 was not able to find any modules being installed 🤔
self.cpp_info.set_property("cmake_find_mode", "both") |
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 sure about that. I thought both
means, that we support both find_package(CvPlot CONFIG)
and find_package(CvPlot MODULE)
?
I tried the MODULE
version. Conan creates a Findcvplot.cmake
then but cmake does not find opencv:
-- Found cvplot: 1.2.2 (found version "1.2.2")
-- Conan: Target declared 'cvplot::cvplot'
CMake Error at /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
No "Findopencv.cmake" found in CMAKE_MODULE_PATH.
Call Stack (most recent call first):
build/7e3f3c9f8b0319ca5c01315759aeda2f877da74f/FindCvPlot.cmake:25 (find_dependency)
CMakeLists.txt:7 (find_package)
So I guess we should stick to the default config
mode?
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.
have to add
self.cpp_info.set_property("cmake_file_name", "CvPlot")
self.cpp_info.set_property("cmake_target_name", "CvPlot::CvPlot")
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.
That solves the CvPlot
spelling, but I still dont know how to consume the FindCvPlot.cmake
. Always getting No "Findopencv.cmake"
.
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.
hmm, Conan generates OpenCV.cmake not opencv.cmake. Do you have a log? The CI is working for the test package.
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 some consumers may use find_package(cvplot CONFIG)
and some may use find_package(cvplot MODULE)
, right? is there any reason not to support both use-cases?
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.
@SSE4 as I said above:
find_package(cvplot MODULE)
already works withgenerators = "cmake", "cmake_find_package"
and does not needself.cpp_info.set_property("cmake_find_mode", "both")
- The only problem is with
generators = "cmake", "CMakeDeps"
(No "Findopencv.cmake" found
)
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.
According to the CMake docs https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html#find-modules find_package(cvplot MODULE)
does not exist ... to my knowledge. I do not expect it to work
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.
this list built-in CMake modules only, but someone can use the custom Find module in his own project, right? I've seen it in a lot of OSS projects in the wild, it's pretty common practice
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.
Sadly theres been a lot of misuse... downstream project can write their own (which is fairly common) then this setting makes sense
https://cmake.org/cmake/help/latest/command/find_package.html#id4
The file CMake searches for in module mode should not be provided by the package itself.
Looking in the github repo I dont see any custom files... but it's not easy to search all projects
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
All green in build 6 (
|
* added cvplot * using del self.options.shared * c++11 std in test_package added * header-only only * Use MIT short name Co-authored-by: Uilian Ries <uilianries@gmail.com> * more topics Co-authored-by: Uilian Ries <uilianries@gmail.com> * CvPlot as target name Co-authored-by: Uilian Ries <uilianries@gmail.com> * dont need cmake in package recipe Co-authored-by: Chris Mc <prince.chrismc@gmail.com> Co-authored-by: Uilian Ries <uilianries@gmail.com> Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
Specify library name and version: cvplot/1.2.2
Hi, I am the author of cvplot. We provided cvplot conan packages on bintray until sunset. Would be great to have them in conan center now.
There is a header_only option in the recipe, I am not sure if I used it correctly. E.g.
conan search cvplot/1.2.2@ -q header_only=True
does not find the package, but I guess that is by design.conan-center hook activated.