-
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
libxml2: fix include dirs in CMake config file #24649
Conversation
If libxml2_INCLUDE_DIRS is defined, it should be used to set the variables related to the preprocessor's include directories, rather than the variables related to the linker.
This comment has been minimized.
This comment has been minimized.
The custom CMake module can be made considerably simpler altogether and copied from the recipe dir instead of generating it: set(LibXml2_FOUND TRUE)
set(LIBXML2_FOUND TRUE)
set(LIBXML2_INCLUDE_DIR "${${CMAKE_FIND_PACKAGE_NAME}_INCLUDE_DIRS}")
set(LIBXML2_INCLUDE_DIRS "${${CMAKE_FIND_PACKAGE_NAME}_INCLUDE_DIRS}")
set(LIBXML2_LIBRARIES "${${CMAKE_FIND_PACKAGE_NAME}_INCLUDE_DIRS}")
set(LIBXML2_LIBRARY "${${CMAKE_FIND_PACKAGE_NAME}_INCLUDE_DIRS}")
set(LIBXML2_DEFINITIONS "${${CMAKE_FIND_PACKAGE_NAME}_DEFINITIONS}")
set(LIBXML2_VERSION_STRING "${${CMAKE_FIND_PACKAGE_NAME}_VERSION}") |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Conan v1 pipeline ✔️All green in build 8 (
Conan v2 pipeline ✔️
All green in build 7 (
|
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.
Thanks a lot!
Summary
Changes to recipe: libxml2/2.12.7
Motivation
The recipe creates its own CMake config file through the
_create_cmake_module_variables()
method.However, the method contains a typo. when the
LibXml2_INCLUDE_DIRS
variable is not defined butlibxml2_INCLUDE_DIRS
is, it used its value to setLIBXML2_LIBRARIES
&LIBXML2_LIBRARY
. This is incorrect, as the two settings are not related (one is used by the preprocessor while the other is used by the linker).This is further evidenced by the fact that the variables
LIBXML2_LIBRARIES
&LIBXML2_LIBRARY
are later overwritten using the value inLibXml2_LIBRARIES
orlibxml2_LIBRARIES
(in order of precedence).Details
The PR uses the value of
libxml2_INCLUDE_DIRS
to setLIBXML2_INCLUDE_DIR
/LIBXML2_INCLUDE_DIRS
instead ofLIBXML2_LIBRARIES
/LIBXML2_LIBRARY
.