vcpkg/ports/gettext-libintl/bashify.cmake
Kai Pastor 5b744ed753
[gettext] Split, fixes, faster build, checked-in config cache (#30429)
* [gettext] Preset more MSVC checks

* Modify configure to speed up windows builds

* Support checked-in config cache

* Collect config [skip actions]

* Add x64 config

* Collect config [skip actions]

* Re-use most of windows config.cache [skip actions]

* WIP [skip actions]

* WIP [skip actions]

* WIP [skip actions]

* WIP

* [mchehab-zbar] Update gettext dependencies

* Add missing patch

* Don't test find_package(Gettext)

* [vcpkg-autotools-cache] Script port for config caching

* Add missing file

* Remove vcpkg-autoconf-cache

---------

Co-authored-by: Monica <v-liumonica@microsoft.com>
2023-05-21 17:56:14 -07:00

17 lines
602 B
CMake

# By using bash builtin expansion, we can avoid
# expensively spawing three sub-processes (bash, echo, sed).
foreach(dir IN LISTS SOURCE_DIRS)
file(READ "${dir}/configure" script)
string(REGEX REPLACE
"(\n[a-zA-Z0-9_]*)='`[\$]ECHO \"[\$]([^\"]*)\" \\| [\$]SED \"[\$]delay_single_quote_subst\"`'"
[[\1='${\2//\\'/\\'\\\\\\'\\'}']]
script "${script}"
)
string(REPLACE
[[ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in]]
[[ case "\${!var}" in]]
script "${script}"
)
file(WRITE "${dir}/configure" "${script}")
endforeach()