From 0cfb40efeba7db45a91086cf509c3ed289becce1 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Sun, 19 Apr 2020 19:33:07 +0200 Subject: [PATCH] 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 --- bindings/python/CMakeLists.txt | 4 +++- cmake/configure-manpage.cmake | 3 +-- data/accounts/C/CMakeLists.txt | 4 +++- data/accounts/ca/CMakeLists.txt | 5 ++++- data/accounts/cs/CMakeLists.txt | 5 ++++- data/accounts/da/CMakeLists.txt | 5 ++++- data/accounts/de_AT/CMakeLists.txt | 5 ++++- data/accounts/de_CH/CMakeLists.txt | 5 ++++- data/accounts/de_DE/CMakeLists.txt | 5 ++++- data/accounts/el_GR/CMakeLists.txt | 5 ++++- data/accounts/en_GB/CMakeLists.txt | 5 ++++- data/accounts/en_IN/CMakeLists.txt | 4 +++- data/accounts/es_ES/CMakeLists.txt | 5 ++++- data/accounts/es_MX/CMakeLists.txt | 4 +++- data/accounts/fi_FI/CMakeLists.txt | 5 ++++- data/accounts/fr_BE/CMakeLists.txt | 5 ++++- data/accounts/fr_CA/CMakeLists.txt | 4 +++- data/accounts/fr_CH/CMakeLists.txt | 5 ++++- data/accounts/fr_FR/CMakeLists.txt | 5 ++++- data/accounts/he/CMakeLists.txt | 4 +++- data/accounts/hr/CMakeLists.txt | 4 +++- data/accounts/hu/CMakeLists.txt | 4 +++- data/accounts/it/CMakeLists.txt | 5 ++++- data/accounts/ja/CMakeLists.txt | 4 +++- data/accounts/ko/CMakeLists.txt | 5 ++++- data/accounts/lt/CMakeLists.txt | 5 ++++- data/accounts/lv/CMakeLists.txt | 5 ++++- data/accounts/nb/CMakeLists.txt | 5 ++++- data/accounts/nl/CMakeLists.txt | 5 ++++- data/accounts/pl/CMakeLists.txt | 5 ++++- data/accounts/pt_BR/CMakeLists.txt | 4 +++- data/accounts/pt_PT/CMakeLists.txt | 4 +++- data/accounts/ru/CMakeLists.txt | 4 +++- data/accounts/sk/CMakeLists.txt | 4 +++- data/accounts/sv_AX/CMakeLists.txt | 4 +++- data/accounts/sv_FI/CMakeLists.txt | 5 ++++- data/accounts/sv_SE/CMakeLists.txt | 5 ++++- data/accounts/tr_TR/CMakeLists.txt | 5 ++++- data/accounts/zh_CN/CMakeLists.txt | 5 ++++- data/accounts/zh_HK/CMakeLists.txt | 5 ++++- data/accounts/zh_TW/CMakeLists.txt | 5 ++++- data/checks/CMakeLists.txt | 4 +++- doc/CMakeLists.txt | 4 +++- doc/tip_of_the_day.list.c | 2 +- gnucash/gtkbuilder/CMakeLists.txt | 4 +++- gnucash/import-export/aqb/CMakeLists.txt | 11 +++++++---- gnucash/import-export/ofx/CMakeLists.txt | 5 +++-- gnucash/python/CMakeLists.txt | 6 ++++-- gnucash/ui/CMakeLists.txt | 4 +++- 49 files changed, 174 insertions(+), 55 deletions(-) diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index 225a04e92f..b41f5a215b 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -102,7 +102,9 @@ if(WITH_PYTHON) DESTINATION ${PYTHON_SYSCONFIG_OUTPUT}/gnucash ) - file(COPY ${PYEXEC_FILES} DESTINATION ${PYTHON_SYSCONFIG_BUILD}/gnucash) + foreach(PYEXEC_FILE ${PYEXEC_FILES}) + configure_file(${PYEXEC_FILE} ${PYTHON_SYSCONFIG_BUILD}/gnucash/${PYEXEC_FILE} COPYONLY) + endforeach() add_custom_target(gnucash-core-c-py ALL COMMAND ${CMAKE_COMMAND} -E copy ${SWIG_GNUCASH_CORE_PY} ${PYTHON_SYSCONFIG_BUILD}/gnucash diff --git a/cmake/configure-manpage.cmake b/cmake/configure-manpage.cmake index fbef1dda88..4dd4144989 100644 --- a/cmake/configure-manpage.cmake +++ b/cmake/configure-manpage.cmake @@ -13,5 +13,4 @@ include (${SRC_DIR}/cmake/version-info2env.cmake) versioninfo2env (${VCS_INFO_FILE}) configure_file(${SRC} ${DST} ) -file(COPY gnucash.1 -DESTINATION ${DATADIR_BUILD}/gnucash) +configure_file(gnucash.1 ${DATADIR_BUILD}/gnucash/gnucash.1 COPYONLY) diff --git a/data/accounts/C/CMakeLists.txt b/data/accounts/C/CMakeLists.txt index 7dda269ae2..236187036d 100644 --- a/data/accounts/C/CMakeLists.txt +++ b/data/accounts/C/CMakeLists.txt @@ -21,5 +21,7 @@ set(account_DATA set_dist_list(C_DIST ${account_DATA} acctchrt_full.gnucash-xea CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/C) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/C) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/C/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/ca/CMakeLists.txt b/data/accounts/ca/CMakeLists.txt index 4c0986d512..f1e0c0356b 100644 --- a/data/accounts/ca/CMakeLists.txt +++ b/data/accounts/ca/CMakeLists.txt @@ -18,4 +18,7 @@ set(account_DATA set_dist_list(CA_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/ca) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/ca) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/ca/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/cs/CMakeLists.txt b/data/accounts/cs/CMakeLists.txt index 5d8586e1b1..7150fca37c 100644 --- a/data/accounts/cs/CMakeLists.txt +++ b/data/accounts/cs/CMakeLists.txt @@ -18,4 +18,7 @@ set(account_DATA set_dist_list(CS_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/cs) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/cs) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/cs/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/da/CMakeLists.txt b/data/accounts/da/CMakeLists.txt index ceda89df0e..3850c7efda 100644 --- a/data/accounts/da/CMakeLists.txt +++ b/data/accounts/da/CMakeLists.txt @@ -7,4 +7,7 @@ set(account_DATA set_dist_list(DA_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/da) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/da) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/da/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/de_AT/CMakeLists.txt b/data/accounts/de_AT/CMakeLists.txt index 331171ea78..e98b65259e 100644 --- a/data/accounts/de_AT/CMakeLists.txt +++ b/data/accounts/de_AT/CMakeLists.txt @@ -13,4 +13,7 @@ set(dist_account_DATA set_dist_list(DE_AT_DIST ${dist_account_DATA} CMakeLists.txt) install(FILES ${dist_account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/de_AT) -file(COPY ${dist_account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/de_AT) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/de_AT/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/de_CH/CMakeLists.txt b/data/accounts/de_CH/CMakeLists.txt index d6274c2cdf..fcd0f89036 100644 --- a/data/accounts/de_CH/CMakeLists.txt +++ b/data/accounts/de_CH/CMakeLists.txt @@ -9,4 +9,7 @@ set(account_DATA set_dist_list(DE_CH_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/de_CH) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/de_CH) \ No newline at end of file + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/de_CH/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/de_DE/CMakeLists.txt b/data/accounts/de_DE/CMakeLists.txt index 6603fcd6fd..b2322221eb 100644 --- a/data/accounts/de_DE/CMakeLists.txt +++ b/data/accounts/de_DE/CMakeLists.txt @@ -17,4 +17,7 @@ set(account_DATA set_dist_list(DE_DE_DIST ${account_DATA} acctchrt_full.gnucash-xea CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/de_DE) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/de_DE) \ No newline at end of file + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/de_DE/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/el_GR/CMakeLists.txt b/data/accounts/el_GR/CMakeLists.txt index 6054650913..55dfa3ff6a 100644 --- a/data/accounts/el_GR/CMakeLists.txt +++ b/data/accounts/el_GR/CMakeLists.txt @@ -6,4 +6,7 @@ set(account_DATA set_dist_list(EL_GR_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/el_GR) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/el_GR) \ No newline at end of file + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/el_GR/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/en_GB/CMakeLists.txt b/data/accounts/en_GB/CMakeLists.txt index 9e10dd4a76..555c67a6e9 100644 --- a/data/accounts/en_GB/CMakeLists.txt +++ b/data/accounts/en_GB/CMakeLists.txt @@ -20,4 +20,7 @@ set(account_DATA set_dist_list(EN_GB_DIST ${account_DATA} acctchrt_full.gnucash-xea CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/en_GB) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/en_GB) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/en_GB/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/en_IN/CMakeLists.txt b/data/accounts/en_IN/CMakeLists.txt index 7789a32ae3..73f264e23e 100644 --- a/data/accounts/en_IN/CMakeLists.txt +++ b/data/accounts/en_IN/CMakeLists.txt @@ -25,5 +25,7 @@ set_dist_list(EN_IN_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/en_IN) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/en_IN) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/en_IN/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/es_ES/CMakeLists.txt b/data/accounts/es_ES/CMakeLists.txt index ca21d97c01..de937b47a9 100644 --- a/data/accounts/es_ES/CMakeLists.txt +++ b/data/accounts/es_ES/CMakeLists.txt @@ -18,4 +18,7 @@ set(account_DATA set_dist_list(ES_ES_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/es_ES) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/es_ES) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/es_ES/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/es_MX/CMakeLists.txt b/data/accounts/es_MX/CMakeLists.txt index 04e731fb17..b19258d8ec 100644 --- a/data/accounts/es_MX/CMakeLists.txt +++ b/data/accounts/es_MX/CMakeLists.txt @@ -18,5 +18,7 @@ set(account_DATA set_dist_list(ES_MX_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/es_MX) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/es_MX) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/es_MX/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/fi_FI/CMakeLists.txt b/data/accounts/fi_FI/CMakeLists.txt index 7dd2f0ccdc..e639279b0b 100644 --- a/data/accounts/fi_FI/CMakeLists.txt +++ b/data/accounts/fi_FI/CMakeLists.txt @@ -6,4 +6,7 @@ set(account_DATA set_dist_list(FI_FI_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/fi_FI) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/fi_FI) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/fi_FI/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/fr_BE/CMakeLists.txt b/data/accounts/fr_BE/CMakeLists.txt index d1dbb5ed33..2a64c60e71 100644 --- a/data/accounts/fr_BE/CMakeLists.txt +++ b/data/accounts/fr_BE/CMakeLists.txt @@ -19,4 +19,7 @@ set(account_DATA set_dist_list(FR_BE_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/fr_BE) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/fr_BE) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/fr_BE/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/fr_CA/CMakeLists.txt b/data/accounts/fr_CA/CMakeLists.txt index fa448f787d..4860d84d3f 100644 --- a/data/accounts/fr_CA/CMakeLists.txt +++ b/data/accounts/fr_CA/CMakeLists.txt @@ -17,5 +17,7 @@ set(account_DATA set_dist_list(FR_CA_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/fr_CA) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/fr_CA) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/fr_CA/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/fr_CH/CMakeLists.txt b/data/accounts/fr_CH/CMakeLists.txt index c37ecd1198..5a3c4d182d 100644 --- a/data/accounts/fr_CH/CMakeLists.txt +++ b/data/accounts/fr_CH/CMakeLists.txt @@ -19,4 +19,7 @@ set(account_DATA set_dist_list(FR_CH_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/fr_CH) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/fr_CH) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/fr_CH/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/fr_FR/CMakeLists.txt b/data/accounts/fr_FR/CMakeLists.txt index dc2c17bb3a..16f8b22d7b 100644 --- a/data/accounts/fr_FR/CMakeLists.txt +++ b/data/accounts/fr_FR/CMakeLists.txt @@ -19,4 +19,7 @@ set(account_DATA set_dist_list(FR_FR_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/fr_FR) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/fr_FR) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/fr_FR/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/he/CMakeLists.txt b/data/accounts/he/CMakeLists.txt index 025a862e99..ef271b907a 100644 --- a/data/accounts/he/CMakeLists.txt +++ b/data/accounts/he/CMakeLists.txt @@ -21,5 +21,7 @@ set(account_DATA set_dist_list(HE_DIST ${account_DATA} acctchrt_full.gnucash-xea CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/he) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/he) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/he/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/hr/CMakeLists.txt b/data/accounts/hr/CMakeLists.txt index 15efd5b7a8..a62b4a0001 100644 --- a/data/accounts/hr/CMakeLists.txt +++ b/data/accounts/hr/CMakeLists.txt @@ -23,5 +23,7 @@ set(account_DATA set_dist_list(HR_DIST ${account_DATA} CMakeLists.txt) # acctchrt_full.gnucash-xea install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/hr) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/hr) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/hr/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/hu/CMakeLists.txt b/data/accounts/hu/CMakeLists.txt index 0f9adf6d21..12528d8801 100644 --- a/data/accounts/hu/CMakeLists.txt +++ b/data/accounts/hu/CMakeLists.txt @@ -20,5 +20,7 @@ set(account_DATA set_dist_list(HU_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/hu) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/hu) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/hu/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/it/CMakeLists.txt b/data/accounts/it/CMakeLists.txt index 5783f1960a..09016fc692 100644 --- a/data/accounts/it/CMakeLists.txt +++ b/data/accounts/it/CMakeLists.txt @@ -16,4 +16,7 @@ set(account_DATA set_dist_list(IT_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/it) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/it) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/it/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/ja/CMakeLists.txt b/data/accounts/ja/CMakeLists.txt index 1f673f2d24..69e93ecc46 100644 --- a/data/accounts/ja/CMakeLists.txt +++ b/data/accounts/ja/CMakeLists.txt @@ -20,5 +20,7 @@ set(account_DATA set_dist_list(JA_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/ja) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/ja) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/ja/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/ko/CMakeLists.txt b/data/accounts/ko/CMakeLists.txt index 20dc925909..dbb83d0d34 100644 --- a/data/accounts/ko/CMakeLists.txt +++ b/data/accounts/ko/CMakeLists.txt @@ -19,4 +19,7 @@ set(account_DATA set_dist_list(KO_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/ko) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/ko) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/ko/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/lt/CMakeLists.txt b/data/accounts/lt/CMakeLists.txt index 1cc8b3d64b..0a359af2aa 100644 --- a/data/accounts/lt/CMakeLists.txt +++ b/data/accounts/lt/CMakeLists.txt @@ -3,4 +3,7 @@ set(account_DATA acctchrt_business.gnucash-xea) set_dist_list(LT_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/lt) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/lt) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/lt/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/lv/CMakeLists.txt b/data/accounts/lv/CMakeLists.txt index e36a8f8319..9e0eea3228 100644 --- a/data/accounts/lv/CMakeLists.txt +++ b/data/accounts/lv/CMakeLists.txt @@ -19,4 +19,7 @@ set(account_DATA set_dist_list(LV_DIST ${account_DATA} acctchrt_full.gnucash-xea CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/lv) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/lv) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/lv/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/nb/CMakeLists.txt b/data/accounts/nb/CMakeLists.txt index a21dbc9db9..87dc6ae4c4 100644 --- a/data/accounts/nb/CMakeLists.txt +++ b/data/accounts/nb/CMakeLists.txt @@ -20,4 +20,7 @@ set(account_DATA set_dist_list(NB_DIST ${account_DATA} acctchrt_full.gnucash-xea CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/nb) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/nb) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/nb/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/nl/CMakeLists.txt b/data/accounts/nl/CMakeLists.txt index 97d9a99fe1..c60dd15d78 100644 --- a/data/accounts/nl/CMakeLists.txt +++ b/data/accounts/nl/CMakeLists.txt @@ -6,4 +6,7 @@ set(account_DATA set_dist_list(NL_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/nl) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/nl) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/nl/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/pl/CMakeLists.txt b/data/accounts/pl/CMakeLists.txt index 6531a4d27b..8d842e8e2a 100644 --- a/data/accounts/pl/CMakeLists.txt +++ b/data/accounts/pl/CMakeLists.txt @@ -19,4 +19,7 @@ set(account_DATA set_dist_list(PL_DIST ${account_DATA} acctchrt_full.gnucash-xea CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/pl) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/pl) \ No newline at end of file + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/pl/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/pt_BR/CMakeLists.txt b/data/accounts/pt_BR/CMakeLists.txt index 2f9f31ed21..b2f2d7d0ea 100644 --- a/data/accounts/pt_BR/CMakeLists.txt +++ b/data/accounts/pt_BR/CMakeLists.txt @@ -18,5 +18,7 @@ set(account_DATA set_dist_list(PT_BR_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/pt_BR) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/pt_BR) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/pt_BR/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/pt_PT/CMakeLists.txt b/data/accounts/pt_PT/CMakeLists.txt index 744386bf93..2c56a912cd 100644 --- a/data/accounts/pt_PT/CMakeLists.txt +++ b/data/accounts/pt_PT/CMakeLists.txt @@ -17,5 +17,7 @@ set(account_DATA set_dist_list(PT_PT_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/pt_PT) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/pt_PT) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/pt_PT/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/ru/CMakeLists.txt b/data/accounts/ru/CMakeLists.txt index d5ada84a48..390caaa852 100644 --- a/data/accounts/ru/CMakeLists.txt +++ b/data/accounts/ru/CMakeLists.txt @@ -11,5 +11,7 @@ set(account_DATA set_dist_list(RU_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/ru) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/ru) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/ru/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/sk/CMakeLists.txt b/data/accounts/sk/CMakeLists.txt index 2e05ec8aeb..9c90456e46 100644 --- a/data/accounts/sk/CMakeLists.txt +++ b/data/accounts/sk/CMakeLists.txt @@ -18,5 +18,7 @@ set(account_DATA set_dist_list(SK_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/sk) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/sk) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/sk/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/sv_AX/CMakeLists.txt b/data/accounts/sv_AX/CMakeLists.txt index 70b98f4be2..5c2135465d 100644 --- a/data/accounts/sv_AX/CMakeLists.txt +++ b/data/accounts/sv_AX/CMakeLists.txt @@ -6,5 +6,7 @@ set(account_DATA set_dist_list(SV_AX_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/sv_AX) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/sv_AX) +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/sv_AX/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/sv_FI/CMakeLists.txt b/data/accounts/sv_FI/CMakeLists.txt index ea99c3d19a..ca53fa20be 100644 --- a/data/accounts/sv_FI/CMakeLists.txt +++ b/data/accounts/sv_FI/CMakeLists.txt @@ -6,4 +6,7 @@ set(account_DATA set_dist_list(SV_FI_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/sv_FI) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/sv_FI) \ No newline at end of file + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/sv_FI/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/sv_SE/CMakeLists.txt b/data/accounts/sv_SE/CMakeLists.txt index 83180b28de..963b5a1f39 100644 --- a/data/accounts/sv_SE/CMakeLists.txt +++ b/data/accounts/sv_SE/CMakeLists.txt @@ -6,4 +6,7 @@ set(account_DATA set_dist_list(SV_SE_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/sv_SE) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/sv_SE) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/sv_SE/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/tr_TR/CMakeLists.txt b/data/accounts/tr_TR/CMakeLists.txt index adcb955613..674f3eb6c2 100644 --- a/data/accounts/tr_TR/CMakeLists.txt +++ b/data/accounts/tr_TR/CMakeLists.txt @@ -11,4 +11,7 @@ set(account_DATA set_dist_list(TR_TR_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/tr_TR) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/tr_TR) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/tr_TR/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/zh_CN/CMakeLists.txt b/data/accounts/zh_CN/CMakeLists.txt index 8244d65b92..3503a97d7e 100644 --- a/data/accounts/zh_CN/CMakeLists.txt +++ b/data/accounts/zh_CN/CMakeLists.txt @@ -19,4 +19,7 @@ set(account_DATA set_dist_list(ZH_CN_DIST ${account_DATA} acctchrt_full.gnucash-xea CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/zh_CN) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/zn_CN) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/zh_CN/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/zh_HK/CMakeLists.txt b/data/accounts/zh_HK/CMakeLists.txt index 03cae9b788..d8f1ed0466 100644 --- a/data/accounts/zh_HK/CMakeLists.txt +++ b/data/accounts/zh_HK/CMakeLists.txt @@ -3,4 +3,7 @@ set(account_DATA acctchrt_business.gnucash-xea) set_dist_list(ZH_HK_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/zh_HK) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/zh_HK) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/zh_HK/${acct_file} COPYONLY) +endforeach() diff --git a/data/accounts/zh_TW/CMakeLists.txt b/data/accounts/zh_TW/CMakeLists.txt index 2eefcafe4c..3fb62b5fb7 100644 --- a/data/accounts/zh_TW/CMakeLists.txt +++ b/data/accounts/zh_TW/CMakeLists.txt @@ -3,4 +3,7 @@ set(account_DATA acctchrt_business.gnucash-xea) set_dist_list(ZH_TW_DIST ${account_DATA} CMakeLists.txt) install(FILES ${account_DATA} DESTINATION ${ACCOUNTS_INSTALL_DIR}/zh_TW) -file(COPY ${account_DATA} DESTINATION ${ACCOUNTS_BUILD_DIR}/zh_TW) + +foreach(acct_file ${account_DATA}) + configure_file(${acct_file} ${ACCOUNTS_BUILD_DIR}/zh_TW/${acct_file} COPYONLY) +endforeach() diff --git a/data/checks/CMakeLists.txt b/data/checks/CMakeLists.txt index 65d1d33f7d..5f8ccf48f2 100644 --- a/data/checks/CMakeLists.txt +++ b/data/checks/CMakeLists.txt @@ -10,6 +10,8 @@ set(checks_DATA install(FILES ${checks_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/checks) -file(COPY ${checks_DATA} DESTINATION ${DATADIR_BUILD}/gnucash/checks) +foreach(check_file ${checks_DATA}) + configure_file(${check_file} ${DATADIR_BUILD}/gnucash/checks/${check_file} COPYONLY) +endforeach() set_dist_list(checks_DIST CMakeLists.txt ${checks_DATA}) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 233dd64d8e..ddc194b00d 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -28,7 +28,9 @@ install(FILES ${doc_DATA} DESTINATION ${CMAKE_INSTALL_DOCDIR}) set_local_dist(doc_DIST_local ${doc_DATA} ${doc_noinst_DATA}) set(doc_DIST ${doc_DIST_local} ${examples_DIST} PARENT_SCOPE) -file(COPY ${doc_DATA} DESTINATION ${DATADIR_BUILD}/doc/gnucash) +foreach(doc_file ${doc_DATA}) + configure_file(${doc_file} ${DATADIR_BUILD}/doc/gnucash/${doc_file} COPYONLY) +endforeach() # Generate the tip of the day file. diff --git a/doc/tip_of_the_day.list.c b/doc/tip_of_the_day.list.c index a69da038f7..ed421a6616 100644 --- a/doc/tip_of_the_day.list.c +++ b/doc/tip_of_the_day.list.c @@ -1,4 +1,4 @@ - N_( "The GnuCash online manual has lots of helpful information. \ + N_( "1The GnuCash online manual has lots of helpful information. \ You can access the manual under the Help menu.") N_( "The GnuCash developers are easy to contact. As well \ diff --git a/gnucash/gtkbuilder/CMakeLists.txt b/gnucash/gtkbuilder/CMakeLists.txt index f998c00234..83d17dce16 100644 --- a/gnucash/gtkbuilder/CMakeLists.txt +++ b/gnucash/gtkbuilder/CMakeLists.txt @@ -64,7 +64,9 @@ set (gtkbuilder_SOURCES window-reconcile.glade ) -file (COPY ${gtkbuilder_SOURCES} DESTINATION ${DATADIR_BUILD}/gnucash/gtkbuilder) +foreach (gtkbuilder_file ${gtkbuilder_SOURCES}) + configure_file (${gtkbuilder_file} ${DATADIR_BUILD}/gnucash/gtkbuilder/${gtkbuilder_file} COPYONLY) +endforeach() install (FILES ${gtkbuilder_SOURCES} DESTINATION share/gnucash/gtkbuilder) diff --git a/gnucash/import-export/aqb/CMakeLists.txt b/gnucash/import-export/aqb/CMakeLists.txt index 0d070f86e8..726abc9804 100644 --- a/gnucash/import-export/aqb/CMakeLists.txt +++ b/gnucash/import-export/aqb/CMakeLists.txt @@ -85,10 +85,13 @@ endif() install(FILES ${aqbanking_UI} DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/ui) - file(COPY ${aqbanking_UI} - DESTINATION ${DATADIR_BUILD}/gnucash/ui) - file(COPY ${aqbanking_GLADE} - DESTINATION ${DATADIR_BUILD}/gnucash/gtkbuilder) + foreach(ui_file ${aqbanking_UI}) + configure_file(${ui_file} ${DATADIR_BUILD}/gnucash/ui/${ui_file} COPYONLY) + endforeach() + + foreach(glade_file ${aqbanking_GLADE}) + configure_file(${glade_file} ${DATADIR_BUILD}/gnucash/gtkbuilder/${glade_file} COPYONLY) + endforeach() endif() set_local_dist(aqbanking_DIST_local CMakeLists.txt diff --git a/gnucash/import-export/ofx/CMakeLists.txt b/gnucash/import-export/ofx/CMakeLists.txt index 0bf5375c29..07f8b9ab04 100644 --- a/gnucash/import-export/ofx/CMakeLists.txt +++ b/gnucash/import-export/ofx/CMakeLists.txt @@ -38,8 +38,9 @@ endif() install(FILES ${ofx_UI} DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/ui) - file(COPY ${ofx_UI} - DESTINATION ${DATADIR_BUILD}/gnucash/ui) + foreach(ui_file ${ofx_UI}) + configure_file(${ui_file} ${DATADIR_BUILD}/gnucash/ui/${ui_file} COPYONLY) + endforeach() endif() set_local_dist(ofx_DIST_local CMakeLists.txt ${ofx_SOURCES} ${ofx_noinst_HEADERS} ${ofx_UI}) diff --git a/gnucash/python/CMakeLists.txt b/gnucash/python/CMakeLists.txt index 7ec9f37c1c..9f3c304007 100644 --- a/gnucash/python/CMakeLists.txt +++ b/gnucash/python/CMakeLists.txt @@ -31,8 +31,10 @@ endif() install(FILES ${pycons_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/python/pycons) install(FILES init.py DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/python) - file(COPY ${pycons_DATA} DESTINATION ${CMAKE_BINARY_DIR}/share/gnucash/python/pycons) - file(COPY init.py DESTINATION ${CMAKE_BINARY_DIR}/share/gnucash/python) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/share/gnucash/python/pycons) + foreach(py_file ${pycons_DATA} init.py) + configure_file(${py_file} ${CMAKE_BINARY_DIR}/share/gnucash/python/${py_file} COPYONLY) + endforeach() endif() set_local_dist(pycons_DIST ${pycons_DATA}) diff --git a/gnucash/ui/CMakeLists.txt b/gnucash/ui/CMakeLists.txt index 0429c7dd0f..0ac651135e 100644 --- a/gnucash/ui/CMakeLists.txt +++ b/gnucash/ui/CMakeLists.txt @@ -34,7 +34,9 @@ set (ui_SOURCES gnc-windows-menu-ui.xml osx_accel_map) -file (COPY ${ui_SOURCES} DESTINATION ${DATADIR_BUILD}/gnucash/ui) +foreach (ui_file ${ui_SOURCES}) + configure_file (${ui_file} ${DATADIR_BUILD}/gnucash/ui/${ui_file} COPYONLY) +endforeach() install (FILES ${ui_SOURCES} DESTINATION share/gnucash/ui)