diff --git a/CMakeLists.txt b/CMakeLists.txt index b9abf817..7f2c639e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -439,12 +439,11 @@ endif() if(LIBXML2_WITH_PROGRAMS) add_executable(xmllint xmllint.c shell.c) - add_executable(xmlcatalog xmlcatalog.c) - set( - PROGRAMS - xmlcatalog - xmllint - ) + set(PROGRAMS xmllint) + if(LIBXML2_WITH_CATALOG AND LIBXML2_WITH_OUTPUT) + add_executable(xmlcatalog xmlcatalog.c) + list(APPEND PROGRAMS xmlcatalog) + endif() foreach(PROGRAM ${PROGRAMS}) add_executable(LibXml2::${PROGRAM} ALIAS ${PROGRAM}) target_link_libraries(${PROGRAM} LibXml2) diff --git a/Makefile.am b/Makefile.am index 5caba33e..047a6d63 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,7 +26,7 @@ check_PROGRAMS = \ testparser \ testrecurse -bin_PROGRAMS = xmllint xmlcatalog +bin_PROGRAMS = xmllint bin_SCRIPTS = xml2-config @@ -48,6 +48,15 @@ if WITH_C14N_SOURCES libxml2_la_SOURCES += c14n.c endif if WITH_CATALOG_SOURCES +if WITH_OUTPUT_SOURCES +bin_PROGRAMS += xmlcatalog + +xmlcatalog_SOURCES = xmlcatalog.c +xmlcatalog_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS) +xmlcatalog_DEPENDENCIES = $(DEPS) +xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS) +endif + libxml2_la_SOURCES += catalog.c endif if WITH_DEBUG_SOURCES @@ -138,11 +147,6 @@ xmllint_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS) xmllint_DEPENDENCIES = $(DEPS) xmllint_LDADD= $(RDL_LIBS) $(LDADDS) -xmlcatalog_SOURCES=xmlcatalog.c -xmlcatalog_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS) -xmlcatalog_DEPENDENCIES = $(DEPS) -xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS) - testModule_SOURCES=testModule.c testModule_DEPENDENCIES = $(DEPS) testModule_LDADD= $(LDADDS) diff --git a/meson.build b/meson.build index 569bb436..c38f72ee 100644 --- a/meson.build +++ b/meson.build @@ -484,13 +484,15 @@ executable( ## xmlcatalog tool -executable( - 'xmlcatalog', - files('xmlcatalog.c'), - dependencies: [xml_dep, xmllint_deps], - include_directories: config_dir, - install: true, -) +if want_catalog and want_output + executable( + 'xmlcatalog', + files('xmlcatalog.c'), + dependencies: [xml_dep, xmllint_deps], + include_directories: config_dir, + install: true, + ) +endif ## testdso module