gnucash/libgnucash/scm/CMakeLists.txt
Geert Janssens 3dff4e5211 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.
2018-01-29 19:46:44 +01:00

50 lines
1.3 KiB
CMake

ADD_SUBDIRECTORY(gnumeric)
SET (BUILD_CONFIG_SCM ${CMAKE_CURRENT_BINARY_DIR}/build-config.scm)
SET (scm_SCHEME_4
substring-search.scm
xml-generator.scm
)
configure_file(build-config.scm.in ${BUILD_CONFIG_SCM})
dist_add_configured(build-config.scm)
SET(GUILE_DEPENDS scm-core-utils scm-gnc-module)
SET(scm_SCHEME_0
fin.scm
string.scm
${BUILD_CONFIG_SCM}
substring-search.scm
xml-generator.scm
)
GNC_ADD_SCHEME_TARGETS(scm-scm-0 "${scm_SCHEME_0}" "" "" FALSE)
GNC_ADD_SCHEME_TARGETS(scm-scm-1 "printf.scm" gnucash "" FALSE)
GNC_ADD_SCHEME_TARGETS(scm-scm-2
main.scm
gnucash
"scm-scm-1;${GUILE_DEPENDS}" # requires printf.scm from scm-scm-1 and modules from GUILE_DEPENDS
FALSE
)
# depends on main.scm
GNC_ADD_SCHEME_TARGETS(scm-scm-3
price-quotes.scm
gnucash
"scm-scm-2;scm-scm-0" # depends on build_config.scm
FALSE)
ADD_CUSTOM_TARGET(scm-scm ALL DEPENDS scm-scm-3 scm-scm-2 scm-scm-1 scm-scm-0 scm-gnumeric)
INSTALL(FILES config DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/gnucash)
SET_LOCAL_DIST(scm_DIST_local config CMakeLists.txt fin.scm string.scm build-config.scm.in substring-search.scm
xml-generator.scm main.scm price-quotes.scm printf.scm ${scm_SCHEME_4})
SET(scm_DIST ${scm_DIST_local} ${scm_gnumeric_DIST} PARENT_SCOPE)