Open JamesPei opened 5 days ago
Hi @JamesPei
Some quick preliminary feedback:
conan-center-index
repo.package_type = "application"
seems incorrect. You shouldn't have this type for something that is a library, and the package_info
is defining all the library information. Better use package_type = "library"
, even if it contains one executable, the main use case is a library.git.clone(url="git@github.com:FFmpeg/FFmpeg.git", target=".")
this is broken. A Conan recipe shouldn't be just fetching code at head, without a specific tag or commit. See the comments and warnings in https://docs.conan.io/2/tutorial/creating_packages/handle_sources_in_packages.htmlpackage()
method, I'd encourage to use a for
loop that iterates over the libs to do the copy()
. That way is more difficult to have typos or mistakes that would skip copying some library.I will be trying the package_type
change, it can be the reason.
I confirm, changing package_type = "library"
works.
@memsharded thank you sir, it works after changing the package_type to library. so,does the package_type application mean that the -l option will not be generated? And, only projects that contain only executable and no any library files set to application?
Package-type affects how information is propagated to consumers. If you have an application
that requires
a static-library
, and someone does a requires to the application
(in most cases it should be a tool_requires
if intended to be used in the build), then the library information will not be propagated to the downstream consumers, only to the application.
Yes, in general, packages containing headers and libraries should be set to library
if using options.shared
or static-library/shared-library
, even if they contain executables too. Packages that contain an executable only can be set to application
.
help! I'm using conan2 to create FFmpeg package, and this is package_info:
and then I tried to use it to build another project,here is some information:
it reports undefined reference to
xxx' error, like undefined reference to
avcodec_open2'; so I check generated cmake by CMakeDeps generator, and in ffmpeg-release-x86_64-data.cmake I found all xxx_LIBS_RELEASE is not setted, for exampleso why ffmpeg_avutil_LIBS_RELEASE is not setted? Did I miss some configuration item? If I manually add a value, it works