gnucash-docs master: Fix Cmake dist tarball creation with autotools-build option.

John Ralls jralls at code.gnucash.org
Sun Jun 28 19:05:26 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash-docs/commit/ffd39cd4 (commit)
	from  https://github.com/Gnucash/gnucash-docs/commit/56086d2e (commit)



commit ffd39cd493532619d15b15c52d4db71e0b214048
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Jun 28 15:56:51 2020 -0700

    Fix Cmake dist tarball creation with autotools-build option.
    
    If AUTOTOOLS_IN_DIST was set and the autogen build products (aclocal.m4,
    configure, config.guess, etc.) weren't present in CMAKE_SOURCE_ROOT
    ninja dist would fail because the dist target was dependent on those
    files, even though autogen.sh would create them as part of building the
    tarballs.
    
    This was apparently in order to enable building a dist tarball when
    autogen.sh wasn't available, but the only reason that might be the case
    is if one is starting from a dist tarball. That's silly, so removed
    the autogen-built files from dist_files and substituted an error.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ad2fe3d..fd78a5e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -185,17 +185,8 @@ add_subdirectory (help)
 if(AUTOTOOLS_IN_DIST)
     set(autotoolsfiles
         configure.ac
-        configure
-        config.guess
-        config.sub
-        COPYING
-        INSTALL
         Makefile.am
-        aclocal.m4
         gnucash-docs.spec.in
-        install-sh
-        ltmain.sh
-        missing
         chm.make
         epub.make
         mobi.make
@@ -203,15 +194,11 @@ if(AUTOTOOLS_IN_DIST)
         pdf.make
         xmldocs.make)
 
-    # If autogen.sh is not in the source tree, we assume the source is extracted
-    # from a dist tarball. In that case the Makefile.in files are already present
-    # and we can include the directly instead of generating them from autogen.sh
-    find_file(AUTOGEN autogen.sh
+      find_file(AUTOGEN autogen.sh
         HINTS "${CMAKE_SOURCE_DIR}"
         NO_DEFAULT_PATH)
-    if(NOT AUTOGEN)
-        list(APPEND autotoolsfiles Makefile.in)
-        message(STATUS "autogen.sh not in source tree. Assuming Makefile.in files are present instead")
+      if(NOT AUTOGEN)
+        message(FATAL_ERROR "No autogen.sh in sources. Either you're trying to make a distribution tarball from something other than a repository clone or your clone is defective. You can continue if you insist by passing -DAUTOTOOLS_IN_DIST=NO to cmake.")
     endif()
 
     add_to_dist(${autotoolsfiles})



Summary of changes:
 CMakeLists.txt | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)



More information about the gnucash-changes mailing list