From patchwork Sat Sep 26 21:32:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain via GitGitGadget X-Patchwork-Id: 11801683 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DD8C139A for ; Sat, 26 Sep 2020 21:33:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 31FCC23772 for ; Sat, 26 Sep 2020 21:33:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ttFiWGoo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728284AbgIZVdF (ORCPT ); Sat, 26 Sep 2020 17:33:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727814AbgIZVdB (ORCPT ); Sat, 26 Sep 2020 17:33:01 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAA75C0613D9 for ; Sat, 26 Sep 2020 14:32:58 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id e16so7677756wrm.2 for ; Sat, 26 Sep 2020 14:32:58 -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=kPwKcxGrRvsZn7FWly9EDeX7JTF/jA86riQcfqmFzIg=; b=ttFiWGooJ90OuQLAyBFVHjzuX6e2hurJb/vRDCv8IZ/R9hwtohUOyR/O+gHftIAspP aN+y5jZASk7O46nFdnr+YyCPNx4SW9iuEr+7txbDTJccUG98ciUqOpB2a9gjkRuhPcPm nAoEsj6BGpiKKXaMCaTBt5kSsekQcJoLUD7WquDVG5cjKp4safG0U/SP3MAG5R+eefrG eDgn5rGLR0tnZiQ51NH5j3hoL+eju8ut6I5m6yDuVTcecXXwMKdoI95jv7m5ZP4a3b5j TGJYDzhdn7rWPVaOJlFMXsln5eCLeMB5iMX+Ighocmwz7FgxgdU7rTOjbtQP/QVgvA4E 8y3g== 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=kPwKcxGrRvsZn7FWly9EDeX7JTF/jA86riQcfqmFzIg=; b=HzunovFxWySBB7CS4HxN1SGncU9RSSRtlfJzu2CLh5AkLnYSQJse8arIa3JwMT6lH3 TMpBbr8WuUPfCr/nrD1b7IWlBNJikp6X/PL5+GMep0hs1tOxcXpThGuChxldpiyHQqoN 9dqji5QlNWkToKcPOhQPVG+HNskqv3NrKkp14Ry3L4bIvwyYmhKyKtZdwRphACrdobBf lwNMdnL5zXjSMvYpHSJgakYW4MWcuzThTrXn7O+0KsbMDkNHzVuq5IsSN9v6linPLFJK lGBjkeHwy+xkcJqvtqDRG5lc56tAYdMikltCQpgGxFYRLnfA6x6z06oaUcDcIWhRggIh a3yg== X-Gm-Message-State: AOAM533piegq2lEoBGrpvbjzBY3q/0MQg5MhUBRf2KQ9TxiuOJk6eZoP irjkpFxYD7ncQBJ0p2js64sj06xoccQ= X-Google-Smtp-Source: ABdhPJycRvYkpDPOrXB+eStP7Dv/u0P/3tVdoLONpAPQMzsps67WUITpF8EHEC96EPTgg5FMKbNhcg== X-Received: by 2002:a05:6000:124d:: with SMTP id j13mr11610065wrx.182.1601155977425; Sat, 26 Sep 2020 14:32:57 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f14sm8027466wrv.72.2020.09.26.14.32.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:57 -0700 (PDT) Message-Id: <68a7d984ec225f08486a4faf2b8d5bd2df2d5083.1601155970.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:48 +0000 Subject: [PATCH v2 09/10] cmake (Windows): recommend using Visual Studio's built-in CMake support Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin It is a lot more convenient to use than having to specify the configuration in CMake manually (does not matter whether using the command-line or CMake's GUI). While at it, recommend using `contrib/buildsystems/out/` as build directory also in the part that talks about running CMake manually. Helped-by: Junio C Hamano Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 1eaeb8b8e0..de92e4fe2d 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -4,17 +4,25 @@ #[[ -Instructions to run CMake: +Instructions how to use this in Visual Studio: -cmake `relative-path-to-CMakeLists.txt` -DCMAKE_BUILD_TYPE=Release -Eg. -From the root of git source tree - `cmake contrib/buildsystems/ ` -This will build the git binaries at the root +Open the worktree as a folder. Visual Studio 2019 and later will detect +the CMake configuration automatically and set everything up for you, +ready to build. You can then run the tests in `t/` via a regular Git Bash. -For out of source builds, say build in 'git/git-build/' - `mkdir git-build;cd git-build; cmake ../contrib/buildsystems/` -This will build the git binaries in git-build directory +Note: Visual Studio also has the option of opening `CMakeLists.txt` +directly; Using this option, Visual Studio will not find the source code, +though, therefore the `File>Open>Folder...` option is preferred. + +Instructions to run CMake manually: + + mkdir -p contrib/buildsystems/out + cd contrib/buildsystems/out + cmake ../ -DCMAKE_BUILD_TYPE=Release + +This will build the git binaries in contrib/buildsystems/out +directory (our top-level .gitignore file knows to ignore contents of +this directory). Possible build configurations(-DCMAKE_BUILD_TYPE) with corresponding compiler flags