gnucash/data/accounts/sk/CMakeLists.txt
Geert Janssens 0cfb40efeb CMake - use configure_file instead of file(COPY ) wherever possible
file(COPY ) will only trigger when the destination file doesn't exist yet.
It won't retrigger on source file changes.
configure_file on the other hand will. To avoid unwanted substitution
attempts this can be invoked with the COPYONLY keyword.
Disadvantage of configure_file is that it will only take one
input file where file(COPY ) can operate on a list of files.
As such the configure_file statement has to be wrapped in a foreach.

A few uses of file(COPY ) can't be replaced as they are setting
file permissions. And the one in make_dist has been kept as that
always operates on an empty directory, hence copying is guaranteed.

The former will monitor the file for updates and copy it again
the latter will only copy the file if it doesn't exist in the destination yet
2020-04-19 21:23:22 +02:00

25 lines
759 B
CMake

set(account_DATA
acctchrt_brokerage.gnucash-xea
acctchrt_carloan.gnucash-xea
acctchrt_cdmoneymkt.gnucash-xea
acctchrt_childcare.gnucash-xea
acctchrt_common.gnucash-xea
acctchrt_currency.gnucash-xea
acctchrt_eduloan.gnucash-xea
acctchrt_fixedassets.gnucash-xea
acctchrt_homeloan.gnucash-xea
acctchrt_homeown.gnucash-xea
acctchrt_otherloan.gnucash-xea
acctchrt_renter.gnucash-xea
acctchrt_retiremt.gnucash-xea
acctchrt_spouseinc.gnucash-xea
acctchrt_spouseretire.gnucash-xea)
set_dist_list(SK_DIST ${account_DATA} CMakeLists.txt)
install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/sk)
foreach(acct_file ${account_DATA})
configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/sk/${acct_file} COPYONLY)
endforeach()