Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
9603ee91
Commit
9603ee91
authored
Feb 01, 2012
by
David Cole
Committed by
Kitware Robot
Feb 01, 2012
Browse files
Options
Browse Files
Download
Plain Diff
Merge topic 'improve-libxml2'
9d7a0010
FindLibXml2: detect version when PkgConfig is not used
parents
ba963564
9d7a0010
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
Modules/FindLibXml2.cmake
Modules/FindLibXml2.cmake
+12
-5
No files found.
Modules/FindLibXml2.cmake
View file @
9603ee91
...
...
@@ -45,15 +45,22 @@ FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint)
# for backwards compat. with KDE 4.0.x:
SET
(
XMLLINT_EXECUTABLE
"
${
LIBXML2_XMLLINT_EXECUTABLE
}
"
)
IF
(
PC_LIBXML_VERSION
)
SET
(
LIBXML2_VERSION_STRING
${
PC_LIBXML_VERSION
}
)
ELSEIF
(
LIBXML2_INCLUDE_DIR AND EXISTS
"
${
LIBXML2_INCLUDE_DIR
}
/libxml/xmlversion.h"
)
FILE
(
STRINGS
"
${
LIBXML2_INCLUDE_DIR
}
/libxml/xmlversion.h"
libxml2_version_str
REGEX
"^#define[
\t
]+LIBXML_DOTTED_VERSION[
\t
]+
\"
.*
\"
"
)
STRING
(
REGEX REPLACE
"^#define[
\t
]+LIBXML_DOTTED_VERSION[
\t
]+
\"
([^
\"
]*)
\"
.*"
"
\\
1"
LIBXML2_VERSION_STRING
"
${
libxml2_version_str
}
"
)
UNSET
(
libxml2_version_str
)
ENDIF
()
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE
(
${
CMAKE_CURRENT_LIST_DIR
}
/FindPackageHandleStandardArgs.cmake
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
LibXml2
REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR
VERSION_VAR PC_LIBXML_VERSION
)
IF
(
LIBXML2_FOUND
)
SET
(
LIBXML2_VERSION_STRING
${
PC_LIBXML_VERSION
}
)
ENDIF
()
VERSION_VAR LIBXML2_VERSION_STRING
)
MARK_AS_ADVANCED
(
LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment