diff options
author | Tomasz Słodkowicz <slodki@users.noreply.github.com> | 2017-08-26 16:29:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-08-30 14:29:38 (GMT) |
commit | fb3a608f1ab4a8fda04d5c2fb5ad99e396ebd1e6 (patch) | |
tree | 609fa62af2b9196fd2fae129bdb49a64d568ee8a /Modules/FindGettext.cmake | |
parent | fff28e30cd01a88b2e5f67db2aaf4c068f1bfc89 (diff) | |
download | CMake-fb3a608f1ab4a8fda04d5c2fb5ad99e396ebd1e6.zip CMake-fb3a608f1ab4a8fda04d5c2fb5ad99e396ebd1e6.tar.gz CMake-fb3a608f1ab4a8fda04d5c2fb5ad99e396ebd1e6.tar.bz2 |
FindGettext: fix support for MS Windows gettext binaries
Sometimes it uses filename with .exe extension so try to match
filename with and without extension.
Diffstat (limited to 'Modules/FindGettext.cmake')
-rw-r--r-- | Modules/FindGettext.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index 8035507..9623b85 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -66,10 +66,14 @@ if(GETTEXT_MSGMERGE_EXECUTABLE) OUTPUT_VARIABLE gettext_version ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - if (gettext_version MATCHES "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)") - set(GETTEXT_VERSION_STRING "${CMAKE_MATCH_1}") + get_filename_component(msgmerge_name ${GETTEXT_MSGMERGE_EXECUTABLE} NAME) + get_filename_component(msgmerge_namewe ${GETTEXT_MSGMERGE_EXECUTABLE} NAME_WE) + if (gettext_version MATCHES "^(${msgmerge_name}|${msgmerge_namewe}) \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)") + set(GETTEXT_VERSION_STRING "${CMAKE_MATCH_2}") endif() unset(gettext_version) + unset(msgmerge_name) + unset(msgmerge_namewe) endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) |