mirror of
https://github.com/GNOME/libxml2.git
synced 2025-05-08 21:07:54 +08:00
cmake: Fix installation directories in libxml2-config.cmake
Use AX_RECURSIVE_EVAL with Autotools and remove hack using parent directories. Fixes #898.
This commit is contained in:
parent
95f34ce2e5
commit
454ba66f84
11
configure.ac
11
configure.ac
@ -1140,6 +1140,17 @@ dnl for the spec file
|
||||
RELDATE=`date +'%a %b %e %Y'`
|
||||
AC_SUBST(RELDATE)
|
||||
|
||||
# for libxml2-config.cmake.in
|
||||
AX_RECURSIVE_EVAL(["$bindir"], [INSTALL_BINDIR])
|
||||
AX_RECURSIVE_EVAL(["$includedir"], [INSTALL_INCLUDEDIR])
|
||||
AX_RECURSIVE_EVAL(["$libdir"], [INSTALL_LIBDIR])
|
||||
AC_SUBST(INSTALL_BINDIR)
|
||||
AC_SUBST(INSTALL_INCLUDEDIR)
|
||||
AC_SUBST(INSTALL_LIBDIR)
|
||||
AM_SUBST_NOTMAKE(INSTALL_BINDIR)
|
||||
AM_SUBST_NOTMAKE(INSTALL_INCLUDEDIR)
|
||||
AM_SUBST_NOTMAKE(INSTALL_LIBDIR)
|
||||
|
||||
# keep on one line for cygwin c.f. #130896
|
||||
AC_CONFIG_FILES([Makefile include/Makefile include/libxml/Makefile include/private/Makefile doc/Makefile doc/devhelp/Makefile example/Makefile fuzz/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake])
|
||||
AC_CONFIG_FILES([python/setup.py], [chmod +x python/setup.py])
|
||||
|
@ -24,20 +24,17 @@
|
||||
# LibXml2::LibXml2 - the LibXml2 library
|
||||
# LibXml2::xmllint - the xmllint command-line executable
|
||||
|
||||
get_filename_component(_libxml2_rootdir ${CMAKE_CURRENT_LIST_DIR}/../../../ ABSOLUTE)
|
||||
|
||||
set(LIBXML2_VERSION_MAJOR @LIBXML_MAJOR_VERSION@)
|
||||
set(LIBXML2_VERSION_MINOR @LIBXML_MINOR_VERSION@)
|
||||
set(LIBXML2_VERSION_MICRO @LIBXML_MICRO_VERSION@)
|
||||
set(LIBXML2_VERSION_STRING "@VERSION@")
|
||||
set(LIBXML2_DEFINITIONS "@XML_CFLAGS@")
|
||||
set(LIBXML2_INSTALL_PREFIX ${_libxml2_rootdir})
|
||||
set(LIBXML2_INCLUDE_DIR ${_libxml2_rootdir}/include/libxml2)
|
||||
set(LIBXML2_LIBRARY_DIR ${_libxml2_rootdir}/lib)
|
||||
set(LIBXML2_INCLUDE_DIR @INSTALL_INCLUDEDIR@/libxml2)
|
||||
set(LIBXML2_LIBRARY_DIR @INSTALL_LIBDIR@)
|
||||
|
||||
find_library(LIBXML2_LIBRARY NAMES xml2 HINTS ${LIBXML2_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
find_program(LIBXML2_XMLCATALOG_EXECUTABLE NAMES xmlcatalog HINTS ${_libxml2_rootdir}/bin NO_DEFAULT_PATH)
|
||||
find_program(LIBXML2_XMLLINT_EXECUTABLE NAMES xmllint HINTS ${_libxml2_rootdir}/bin NO_DEFAULT_PATH)
|
||||
find_program(LIBXML2_XMLCATALOG_EXECUTABLE NAMES xmlcatalog HINTS @INSTALL_BINDIR@ NO_DEFAULT_PATH)
|
||||
find_program(LIBXML2_XMLLINT_EXECUTABLE NAMES xmllint HINTS @INSTALL_BINDIR@ NO_DEFAULT_PATH)
|
||||
|
||||
set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
|
||||
set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR})
|
||||
|
56
m4/ax_recursive_eval.m4
Normal file
56
m4/ax_recursive_eval.m4
Normal file
@ -0,0 +1,56 @@
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_recursive_eval.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_RECURSIVE_EVAL(VALUE, RESULT)
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Interpolate the VALUE in loop until it doesn't change, and set the
|
||||
# result to $RESULT. WARNING: It's easy to get an infinite loop with some
|
||||
# unsane input.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation; either version 2 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 1
|
||||
|
||||
AC_DEFUN([AX_RECURSIVE_EVAL],
|
||||
[_lcl_receval="$1"
|
||||
$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
||||
test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
|
||||
_lcl_receval_old=''
|
||||
while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
|
||||
_lcl_receval_old="[$]_lcl_receval"
|
||||
eval _lcl_receval="\"[$]_lcl_receval\""
|
||||
done
|
||||
echo "[$]_lcl_receval")`])
|
@ -772,6 +772,9 @@ config_cmake = configuration_data()
|
||||
config_cmake.set('LIBXML_MAJOR_VERSION', v_maj)
|
||||
config_cmake.set('LIBXML_MINOR_VERSION', v_min)
|
||||
config_cmake.set('LIBXML_MICRO_VERSION', v_mic)
|
||||
config_cmake.set('INSTALL_BINDIR', dir_bin)
|
||||
config_cmake.set('INSTALL_INCLUDEDIR', dir_include)
|
||||
config_cmake.set('INSTALL_LIBDIR', dir_lib)
|
||||
config_cmake.set('VERSION', meson.project_version())
|
||||
config_cmake.set('WITH_ICONV', iconv_dep.found().to_int().to_string())
|
||||
config_cmake.set('WITH_ICU', icu_dep.found().to_int().to_string())
|
||||
|
Loading…
x
Reference in New Issue
Block a user