Fix make dist on a clean checkout

cmake with unix makefiles fails to resolve dist dependencies
added from COPY_FROM_BUILD if these dependencies aren't built yet.

This commit replaces the COPY_FROM_BUILD based logic with two new functions
'dist_add_configured' and 'dist_add_generated' to indicate which files should
be included in the dist tarball. The latter also adds a target level dependency
to the dist tarball custom command. Hence the former should
be used for files that get generated during a cmake run while the latter
should be used for files generated as the result of a 'make/ninja-build' run
(like files for which an add_custom_command rule exists).

Note: this commit also temporarily disables the dist target when building
from a tarball (and hence it won't be tested in distcheck either). This
will be handled in a future commit.
This commit is contained in:
Geert Janssens
2018-01-28 17:45:49 +01:00
parent 1258a2adfd
commit 3dff4e5211
17 changed files with 128 additions and 119 deletions

View File

@@ -122,6 +122,7 @@ ENDIF()
ELSE(BUILDING_FROM_VCS)
ADD_CUSTOM_TARGET(gnc-vcs-info DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gnc-vcs-info.h)
ENDIF(BUILDING_FROM_VCS)
dist_add_generated(gnc-vcs-info gnc-vcs-info.h)
### Compile library
SET(core_utils_noinst_HEADERS

View File

@@ -28,6 +28,8 @@ SET(VERSION_TEXI_IN
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/version.texi ${VERSION_TEXI_IN})
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/stamp-vti ${VERSION_TEXI_IN})
dist_add_configured(version.texi)
dist_add_configured(stamp-vti)
FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" TEXI_BINARY_DIR)
FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/gnucash-design.texi" TEXI_SOURCE_FILE)
@@ -47,5 +49,6 @@ if (NOT ${MAKEINFO} STREQUAL "MAKEINFO-NOTFOUND")
)
ENDIF()
endif (NOT ${MAKEINFO} STREQUAL "MAKEINFO-NOTFOUND")
dist_add_generated(gnucash-design-info gnucash-design.info)
SET_DIST_LIST(doc_design_DIST CMakeLists.txt gnucash-design.texi ${gnucash_design_TEXINFOS})

View File

@@ -134,6 +134,7 @@ ADD_CUSTOM_COMMAND (
${LIBXSLT_XSLTPROC_EXECUTABLE} -o ${ISO_4217_C} "${CMAKE_CURRENT_SOURCE_DIR}/iso-currencies-to-c.xsl" "${CMAKE_CURRENT_SOURCE_DIR}/iso-4217-currencies.xml"
)
ADD_CUSTOM_TARGET(iso-4217-c DEPENDS ${ISO_4217_C})
dist_add_generated(iso-4217-c iso-4217-currencies.c)
SET (engine_SOURCES
Account.cpp

View File

@@ -8,6 +8,7 @@ SET (scm_SCHEME_4
)
configure_file(build-config.scm.in ${BUILD_CONFIG_SCM})
dist_add_configured(build-config.scm)
SET(GUILE_DEPENDS scm-core-utils scm-gnc-module)