gnucash-docs maint: A better way to handle autogen.sh and AUTOTOOLS_IN_DIST.
John Ralls
jralls at code.gnucash.org
Sat Jul 25 20:12:06 EDT 2020
Updated via https://github.com/Gnucash/gnucash-docs/commit/e0268667 (commit)
from https://github.com/Gnucash/gnucash-docs/commit/0e6e25c4 (commit)
commit e02686678e336250310aae647d0b685872e97dc3
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Jul 25 17:01:00 2020 -0700
A better way to handle autogen.sh and AUTOTOOLS_IN_DIST.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 71c2599..82412fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -196,15 +196,6 @@ if(AUTOTOOLS_IN_DIST)
pdf.make
xmldocs.make)
- if (AUTOTOOLS_IN_DIST AND NOT AUTOTOOLS_IN_DIST STREQUAL "RUN")
- find_file(AUTOGEN autogen.sh
- HINTS "${CMAKE_SOURCE_DIR}"
- NO_DEFAULT_PATH)
- 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()
- set(AUTOTOOLS_IN_DIST "RUN")
- endif()
add_to_dist(${autotoolsfiles})
endif()
@@ -235,7 +226,7 @@ add_custom_command(OUTPUT ${DIST_FILE}.gz ${DIST_FILE}.bz2
-D GNUCASH_SOURCE_DIR=${CMAKE_SOURCE_DIR}
-D BUILD_SOURCE_DIR=${CMAKE_BINARY_DIR}
"-Ddist_files=\"${dist_files}\""
- -D AUTOGEN=${AUTOGEN}
+ -D AUTOTOOLS_IN_DIST=${AUTOTOOLS_IN_DIST}
-D SHELL=${SHELL}
-P ${CMAKE_SOURCE_DIR}/cmake/MakeDist.cmake
diff --git a/cmake/AddGncDocTargets.cmake b/cmake/AddGncDocTargets.cmake
index c63aeab..924fd25 100644
--- a/cmake/AddGncDocTargets.cmake
+++ b/cmake/AddGncDocTargets.cmake
@@ -42,10 +42,6 @@ function (add_gnc_doc_targets docname entities)
set(autotoolsfiles
Makefile.am
${docname}-${lang}.omf)
-
- if(NOT AUTOGEN)
- list(APPEND autotoolsfiles Makefile.in)
- endif()
endif()
file(GLOB_RECURSE figures_dist
diff --git a/cmake/MakeDist.cmake b/cmake/MakeDist.cmake
index 92a7a1a..7f53cc6 100644
--- a/cmake/MakeDist.cmake
+++ b/cmake/MakeDist.cmake
@@ -35,6 +35,15 @@ function(find_automake AUTOMAKE_VAR ACLOCAL_VAR AUTOMAKE_VERSION_VAR)
set(${AUTOMAKE_VERSION_VAR} ${AUTOMAKE_VERSION} PARENT_SCOPE)
endfunction()
+function(find_autogen)
+ find_file(AUTOGEN autogen.sh
+ HINTS "${GNUCASH_SOURCE_DIR}"
+ NO_DEFAULT_PATH)
+ if(NOT AUTOGEN)
+ message(FATAL_ERROR "No autogen.sh in ${GNUCASH_SOURCE_DIR}. 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()
+endfunction()
+
function(make_dist PACKAGE_PREFIX GNUCASH_SOURCE_DIR BUILD_SOURCE_DIR)
# -- Remove any existing packaging directory.
@@ -57,9 +66,10 @@ function(make_dist PACKAGE_PREFIX GNUCASH_SOURCE_DIR BUILD_SOURCE_DIR)
cmake_policy(SET CMP0012 NEW)
# When making a dist tarball including autotools files
- # the Makefile.in files may have to be generated by running autogen.sh
- # The toplevel cmake configuration determines whether this is required or not
- if(AUTOGEN)
+ # the Makefile.in files must generated by running autogen.sh
+
+ if(AUTOTOOLS_IN_DIST)
+ find_autogen(AUTOGEN)
find_automake(AUTOMAKE ACLOCAL AUTOMAKE_VERSION)
# -- Run autogen.sh to cause Makefile.in files to be created.
diff --git a/guide/CMakeLists.txt b/guide/CMakeLists.txt
index 9c580b0..8049a94 100644
--- a/guide/CMakeLists.txt
+++ b/guide/CMakeLists.txt
@@ -41,8 +41,5 @@ add_subdirectory(pt)
if(AUTOTOOLS_IN_DIST)
set(autotoolsfiles Makefile.am)
- if(NOT AUTOGEN)
- list(APPEND autotoolsfiles Makefile.in)
- endif()
endif()
add_to_dist(CMakeLists.txt ${autotoolsfiles})
diff --git a/help/CMakeLists.txt b/help/CMakeLists.txt
index b50cbd8..ad7c7c7 100644
--- a/help/CMakeLists.txt
+++ b/help/CMakeLists.txt
@@ -40,8 +40,5 @@ add_subdirectory(pt)
if(AUTOTOOLS_IN_DIST)
set(autotoolsfiles Makefile.am)
- if(NOT AUTOGEN)
- list(APPEND autotoolsfiles Makefile.in)
- endif()
endif()
add_to_dist(CMakeLists.txt ${autotoolsfiles})
Summary of changes:
CMakeLists.txt | 11 +----------
cmake/AddGncDocTargets.cmake | 4 ----
cmake/MakeDist.cmake | 16 +++++++++++++---
guide/CMakeLists.txt | 3 ---
help/CMakeLists.txt | 3 ---
5 files changed, 14 insertions(+), 23 deletions(-)
More information about the gnucash-changes
mailing list