From patchwork Fri Jun 4 17:43:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Rogers X-Patchwork-Id: 12300407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38A8AC4743C for ; Fri, 4 Jun 2021 17:43:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2205D613FA for ; Fri, 4 Jun 2021 17:43:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbhFDRp0 (ORCPT ); Fri, 4 Jun 2021 13:45:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230163AbhFDRpY (ORCPT ); Fri, 4 Jun 2021 13:45:24 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1B36C061766 for ; Fri, 4 Jun 2021 10:43:28 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id q5so10129401wrm.1 for ; Fri, 04 Jun 2021 10:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=9IWbLO8RcVIBHxdVxnqQ4B4bOqXfzwkTu3W2+74X4Xs=; b=GrxyY0+qP6gIlkYa4ZXGRbfojG5l/kdWvDD+aJmxu7oIdyzx5pZyDUM3FIWjxLEXd1 gWHf5XAcD5Qp/c3zqelt5K95N3j2WzhCkv4YL7zP9ENlex6EXC0gGLuRfaXFd8Nb+0nO AIt6q3w2NZoXtsig3pJxs2GZTkPh02WDGEg/3c/bPvrqY6q5+sVT7F5ln/B0idikGWjt 29EyXFdD1usl242fBnhTx4021v5ZciJn2UScMmjkNxd1+hjL4DpCC4tSHMrDB1VjLgmN Atx4kPLFsESqx/m/nY2nqcPxGsPe8uJFmZZurz9MuR7bbyck8iUX/Z65PXNffKkl9Rfr 4fSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=9IWbLO8RcVIBHxdVxnqQ4B4bOqXfzwkTu3W2+74X4Xs=; b=C/80NkjPZGN1R2twdy99Fm19/chd9jCOWMfmRpwLRE6mljqpA7H1g0uMzIbMDL5npg vPAwa3+MB6SdllBhpGPQfq8Q4bVjx36PNyGWyayLENzfmHeyz+mn4SpIabBjxV+fNi60 fVqGT35RnJYzyYG/mpMF3LwmHCGVFonge9SrObCYG+VAtn8+Xc29Lr+v5z0p8dCNGf4w SR6pcx8ADYxhNBTX92RhuuE/NBmDTN3BS2zw+5dwTlyid//lWpEAqwJxdVz2+HowAcWt 7SZ3vX/FZKO6j81bMe012pmv1ysyVibyYh+TX+sXbaXhKhdWXcymai7hVqbH4Ion0uzM W+IA== X-Gm-Message-State: AOAM53352/uQXLUBzHLjTXigLBz/5Ov+MhCsA8Uy3cC7NcbZnu2/T23U tj/mCegR3TAs3O41cMWnDPTOGqtOa1k= X-Google-Smtp-Source: ABdhPJybPCs2h2tOqXBstiKyRHyOZtAKXQFS8MaQeTQHqhwbAvxGI/gxIPh6sKw12jBfPASTgGvYoQ== X-Received: by 2002:a5d:58c1:: with SMTP id o1mr5002432wrf.420.1622828607622; Fri, 04 Jun 2021 10:43:27 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r2sm7412570wrv.39.2021.06.04.10.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 10:43:27 -0700 (PDT) Message-Id: <3170f78daa5fa89f04f61e24c9c64c93ea5b394f.1622828605.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 04 Jun 2021 17:43:23 +0000 Subject: [PATCH 1/3] cmake: add knob to disable vcpkg Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Philip Oakley , Sibi Siddharthan , Johannes Schindelin , Danh Doan , Matthew Rogers , Matthew Rogers Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Matthew Rogers From: Matthew Rogers When building on windows users have the option to use vcpkg to provide the dependencies needed to compile. Previously, this was used only when using the Visual Studio generator which was not ideal because: - Not all users who want to use vcpkg use the Visual Studio generators. - Some versions of Visual Studio 2019 moved away from using the VS 2019 by default, making it impossible for Visual Studio to configure the project in the likely event that it couldn't find the dependencies. - Inexperienced users of CMake are very likely to get tripped up by the errors caused by a lack of vcpkg, making the above bullet point both annoying and hard to debug. As such, lets make using vcpkg the default on windows. Users who want to avoid using vcpkg can disable it by passing -DNO_VCPKG=TRUE. Signed-off-by: Matthew Rogers --- contrib/buildsystems/CMakeLists.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index a87841340e6a..41320150bf66 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -43,14 +43,24 @@ NOTE: By default CMake uses Makefile as the build tool on Linux and Visual Studi to use another tool say `ninja` add this to the command line when configuring. `-G Ninja` +NOTE: By default CMake will install vcpkg locally to your source tree on configuration, +to avoid this, add `-DNO_VCPKG=TRUE` to the command line when configuring. + ]] cmake_minimum_required(VERSION 3.14) #set the source directory to root of git set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) -if(WIN32) + +if (WIN32 AND NOT NO_VCPKG) + set(USING_VCPKG TRUE) +else() + set(USING_VCPKG FALSE) +endif() + +if(USING_VCPKG) set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg") - if(MSVC AND NOT EXISTS ${VCPKG_DIR}) + if(NOT EXISTS ${VCPKG_DIR}) message("Initializing vcpkg and building the Git's dependencies (this will take a while...)") execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat) endif() @@ -178,7 +188,9 @@ endif() find_program(MSGFMT_EXE msgfmt) if(NOT MSGFMT_EXE) - set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe) + if (USING_VCPKG) + set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe) + endif() if(NOT EXISTS ${MSGFMT_EXE}) message(WARNING "Text Translations won't be built") unset(MSGFMT_EXE) @@ -982,7 +994,7 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_GETTEXT='${NO_GETTEXT}'\n" file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "RUNTIME_PREFIX='${RUNTIME_PREFIX}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PYTHON='${NO_PYTHON}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "SUPPORTS_SIMPLE_IPC='${SUPPORTS_SIMPLE_IPC}'\n") -if(WIN32) +if(USING_VCPKG) file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n") endif() From patchwork Fri Jun 4 17:43:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Rogers X-Patchwork-Id: 12300413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D0F5C4743C for ; Fri, 4 Jun 2021 17:44:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 003FC613F9 for ; Fri, 4 Jun 2021 17:44:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbhFDRq3 (ORCPT ); Fri, 4 Jun 2021 13:46:29 -0400 Received: from mail-wm1-f45.google.com ([209.85.128.45]:38661 "EHLO mail-wm1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbhFDRq3 (ORCPT ); Fri, 4 Jun 2021 13:46:29 -0400 Received: by mail-wm1-f45.google.com with SMTP id t4-20020a1c77040000b029019d22d84ebdso8378300wmi.3 for ; Fri, 04 Jun 2021 10:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=nnJf0tHIxki5L5WIPkoLDvaxj0zlV3qOii/EBdifkio=; b=RMRG/2T2HDO9+nMPlLCHoB3jGMQrsmvA1IA23QqlkPM2oo5rZdw6xzKS8sZNRkA3/I DHD28KPZ9w2livsZ55AOpjS6sTh5BWfq59JP+1w9rswCEjvzEXV/7OombS9x5Kq5DIdp T+cPny4LFLUqVmB8WyD1IdkNqGQUixX3tq4EoaK2Ih5HysJv5RlspDfs1nWGsdQTr3IQ M5zr7soRd3xgxkJqT1URNWaQVoyvSpOHwTo3c+hrzt7oj5j5f5C1rnfC7imvN3+/2J/q CoVsIyPhqlNmx1a+pjG7/i8MrL9W5ChYgmxC+OGMTQCxId15jtzFrdkfvMBXHIyBvkya wRtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=nnJf0tHIxki5L5WIPkoLDvaxj0zlV3qOii/EBdifkio=; b=UtaBFw4Z0EyEEAAgnQcl0nZ8jneEi4u0AfvhNi5D5FUU40HCnfM8U3DR/KwShFozfL 9IkO/FjD+U032uPb/6sX4fz7ZXybt9E6l9DR0UUuf9xCNcEos5+Boy31geMeM/SMsvet 5dSY28tpfDtRlso6WAglWjA81v+VrUAOG0cQWhpkBVdKYD5Fnkvxkh32RaqT7yEwmXQb sr9UmxHK33Pi3EBbv9B2xdTTWj0/WCakjlMEhxBD6jNUJJ+6lMvxO/+Jr2CQKssaAWgq 0D+y1ZERY2nysjXHRB4Y0wD9QfcM+jvWnPT69UB/WDvi7R/ELwj4mOyDzyJu9e+oRlmo Ewpw== X-Gm-Message-State: AOAM533eh+9XmlvkLs1le35zuoiOEu0Brx0ABjkZN148/K+Bydi7t+vM 7sHZZha0ZDebM3yGxEj1ZPAsJu7t5Kc= X-Google-Smtp-Source: ABdhPJwiiicGy0ZCXin4EX5/zG0GN+QpjIWprn1wpAsfdioyORY9YDf0/7ml8f+8AtiLXOAW0O7YrQ== X-Received: by 2002:a1c:c90f:: with SMTP id f15mr4820800wmb.142.1622828608181; Fri, 04 Jun 2021 10:43:28 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r14sm7022550wrx.74.2021.06.04.10.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 10:43:27 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Fri, 04 Jun 2021 17:43:24 +0000 Subject: [PATCH 2/3] cmake: create compile_commands.json by default Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Philip Oakley , Sibi Siddharthan , Johannes Schindelin , Danh Doan , Matthew Rogers , Matthew Rogers Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Matthew Rogers From: Matthew Rogers Some users have expressed interest in a more "batteries included" way of building via CMake[1], and a big part of that is providing easier access to tooling external tools. A straightforward way to accomplish this is to make it as simple as possible is to enable the generation of the compile_commands.json file, which is supported by many tools such as: clang-tidy, clang-format, sourcetrail, etc. This does come with a small run-time overhead during the configuration step (~6 seconds on my machine): Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=TRUE real 1m9.840s user 0m0.031s sys 0m0.031s Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=FALSE real 1m3.195s user 0m0.015s sys 0m0.015s This seems like a small enough price to pay to make the project more accessible to newer users. Additionally there are other large projects like llvm [2] which has had this enabled by default for >6 years at the time of this writing, and no real negative consequences that I can find with my search-skills. NOTE: That the comppile_commands.json is currenntly produced only when using the Ninja and Makefile generators. See The CMake documentation[3] for more info. 1: https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/ 2: https://github.com/llvm/llvm-project/commit/2c5712051b31b316a9fc972f692579bd8efa6e67 3: https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html Signed-off-by: Matthew Rogers --- contrib/buildsystems/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 41320150bf66..99150c8f5853 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -58,6 +58,10 @@ else() set(USING_VCPKG FALSE) endif() +if (NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS) + SET(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) +endif() + if(USING_VCPKG) set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg") if(NOT EXISTS ${VCPKG_DIR}) From patchwork Fri Jun 4 17:43:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Rogers X-Patchwork-Id: 12300411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 814FEC4743D for ; Fri, 4 Jun 2021 17:44:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6920B613F9 for ; Fri, 4 Jun 2021 17:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230149AbhFDRqQ (ORCPT ); Fri, 4 Jun 2021 13:46:16 -0400 Received: from mail-wm1-f43.google.com ([209.85.128.43]:36370 "EHLO mail-wm1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbhFDRqQ (ORCPT ); Fri, 4 Jun 2021 13:46:16 -0400 Received: by mail-wm1-f43.google.com with SMTP id n17-20020a7bc5d10000b0290169edfadac9so8398792wmk.1 for ; Fri, 04 Jun 2021 10:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=fhJvnhnH40DJ4DKtvwKPdjwjeAWKhE6qvu1LmDaLYeE=; b=cfpFTLnINDwWTatugInRYc//iY8fe8BggMRizDXS3SObiIUT7P9Kmzsa+NN50GiAaB ShAst9MCmI/JWYthpcFLFIe/yEMCQiNQjVelMDeGgBiGbGQocsLzBAvnUUtk+9UlbTAu 4uX8xEKe3YzX5HJpxEfO3/IyiKKIE7nvI5k8Y++pPYPjlZR6oP9MWyxLiPBFakwGQbdp R9Hqmsa0TvzemWTE3rSV/PbN7M6VhKrJqEkYTPkPG921dmmIy7xD5diUZKdXasE9dk67 4unMBrGwn/l0qAzZK1Zy0i1VTWIgwi7NXZz6th9Zi9+rDLTLRoqQKIJNaniKo661PhZp gloQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=fhJvnhnH40DJ4DKtvwKPdjwjeAWKhE6qvu1LmDaLYeE=; b=Jl1mJTHyJsSnMO+6anhagu354VM6wiJg8hfjTyXbZLtqwVJR2dBeVfJwXQt0PQuBJk dfVJTWGbjjrtRx6LpCi86rh+d6B7D8zCu2UBPmRNOc2PIPGWoVbfKMv05FzS2oO67LaI h97PP8iPDfrT8lOl76By8SRP/SEDetILdcQ3uzn8CMVXm900puB0nfS9wf50fopkB6jJ YVlxSqdyo7AWMJbZxArlpzUIsOqifLaft0bFb9XevPZGqZfHccrRf9FXGs1RVeHFMubw eRRlMcJwgxSN8xDtILzk7PWhGo+DzcmbmbUy4rRtGjUDiHIvCdo6IQ2yckmok53ozxTQ +5dg== X-Gm-Message-State: AOAM530txtXMwSfm/QYGRZ6ykZ3XqNckAQyl2TvZGr3XguiwfRITTMMN otd/1jv/7dTg5Z/84ztA2aQsJEh9Slo= X-Google-Smtp-Source: ABdhPJzJJt+/xnb8NHbmFJoZuPuY3NVTwm22YJfSoBEEUsfLlQoOPxcgl+Bd9pEAvcadYOxNuqDbaQ== X-Received: by 2002:a7b:c4d2:: with SMTP id g18mr4721921wmk.25.1622828608799; Fri, 04 Jun 2021 10:43:28 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id y189sm6460564wmy.25.2021.06.04.10.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 10:43:28 -0700 (PDT) Message-Id: <07763a9de723af8674b707ba762845fd414bd0a6.1622828605.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 04 Jun 2021 17:43:25 +0000 Subject: [PATCH 3/3] cmake: add warning for ignored MSGFMT_EXE Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Philip Oakley , Sibi Siddharthan , Johannes Schindelin , Danh Doan , Matthew Rogers , Matthew Rogers Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Matthew Rogers From: Matthew Rogers It does not make sense to attempt to set MSGFMT_EXE when NO_GETTEXT is configured, as such add a check for NO_GETTEXT before attempting to set it. suggested-by: Johannes Schindelin Signed-off-by: Matthew Rogers --- contrib/buildsystems/CMakeLists.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 99150c8f5853..ea43a4f9cc9f 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -190,14 +190,18 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds endif() endif() -find_program(MSGFMT_EXE msgfmt) -if(NOT MSGFMT_EXE) - if (USING_VCPKG) - set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe) - endif() - if(NOT EXISTS ${MSGFMT_EXE}) - message(WARNING "Text Translations won't be built") - unset(MSGFMT_EXE) +if(NO_GETTEXT) + message(STATUS "msgfmt not used under NO_GETTEXT") +else() + find_program(MSGFMT_EXE msgfmt) + if(NOT MSGFMT_EXE) + if (USING_VCPKG) + set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe) + endif() + if(NOT EXISTS ${MSGFMT_EXE}) + message(WARNING "Text Translations won't be built") + unset(MSGFMT_EXE) + endif() endif() endif()