From: "Matthew Rogers via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Eric Sunshine <sunshine@sunshineco.com>,
Sibi Siddharthan <sibisiddharthan.github@gmail.com>,
Bagas Sanjaya <bagasdotme@gmail.com>,
Matthew Rogers <mattr94@gmail.com>
Subject: [PATCH v2 0/3] Make CMake work out of the box
Date: Sun, 06 Jun 2021 12:02:51 +0000 [thread overview]
Message-ID: <pull.970.v2.git.1622980974.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.970.git.1622828605.gitgitgadget@gmail.com>
This pull request comes from our discussion here[1], and I think these
patches provide a good compromise around the concerns discussed there
1:
https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/
CCing the people involved in the original discussion. cc: Philip Oakley
philipoakley@iee.email cc: Sibi Siddharthan
sibisiddharthan.github@gmail.com, cc: Johannes Schindelin
johannes.schindelin@gmx.de, cc: Danh Doan congdanhqx@gmail.com
Matthew Rogers (3):
cmake: add knob to disable vcpkg
cmake: create compile_commands.json by default
cmake: add warning for ignored MSGFMT_EXE
contrib/buildsystems/CMakeLists.txt | 37 ++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 9 deletions(-)
base-commit: c09b6306c6ca275ed9d0348a8c8014b2ff723cfb
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-970%2FROGERSM94%2Ffix-cmake-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-970/ROGERSM94/fix-cmake-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/970
Range-diff vs v1:
1: 3170f78daa5f ! 1: 485254b49de8 cmake: add knob to disable vcpkg
@@ Commit message
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.
+ VS 2019 generator 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
+ As such, let's 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 <mattr94@gmail.com>
@@ contrib/buildsystems/CMakeLists.txt: NOTE: By default CMake uses Makefile as the
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)
++option(USE_VCPKG "Whether or not to use vcpkg for obtaining dependencies. Only applicable to Windows platforms" ON)
++if(NOT WIN32)
++ set(USE_VCPKG OFF CACHE BOOL FORCE)
+endif()
+
-+if(USING_VCPKG)
++if(USE_VCPKG)
set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg")
- if(MSVC AND NOT EXISTS ${VCPKG_DIR})
+ if(NOT EXISTS ${VCPKG_DIR})
@@ contrib/buildsystems/CMakeLists.txt: 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)
++ if (USE_VCPKG)
+ set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)
+ endif()
if(NOT EXISTS ${MSGFMT_EXE})
@@ contrib/buildsystems/CMakeLists.txt: file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-O
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)
++if(USE_VCPKG)
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
endif()
2: c3bf266cf03a ! 2: a3b5eef54188 cmake: create compile_commands.json by default
@@ Commit message
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
+ NOTE: That the compile_commands.json is currently produced only when
using the Ninja and Makefile generators. See The CMake documentation[3]
for more info.
@@ Commit message
Signed-off-by: Matthew Rogers <mattr94@gmail.com>
## contrib/buildsystems/CMakeLists.txt ##
-@@ contrib/buildsystems/CMakeLists.txt: else()
- set(USING_VCPKG FALSE)
+@@ contrib/buildsystems/CMakeLists.txt: if(NOT WIN32)
+ set(USE_VCPKG OFF CACHE BOOL FORCE)
endif()
-+if (NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
-+ SET(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
++if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
++ set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
+endif()
+
- if(USING_VCPKG)
+ if(USE_VCPKG)
set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg")
if(NOT EXISTS ${VCPKG_DIR})
3: 07763a9de723 ! 3: 2110c8ffa423 cmake: add warning for ignored MSGFMT_EXE
@@ Commit message
configured, as such add a check for NO_GETTEXT before attempting to set
it.
- suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>
+ Suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Matthew Rogers <mattr94@gmail.com>
## contrib/buildsystems/CMakeLists.txt ##
@@ contrib/buildsystems/CMakeLists.txt: if(WIN32 AND NOT MSVC)#not required for vis
-find_program(MSGFMT_EXE msgfmt)
-if(NOT MSGFMT_EXE)
-- if (USING_VCPKG)
+- if (USE_VCPKG)
- set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)
- endif()
- if(NOT EXISTS ${MSGFMT_EXE})
@@ contrib/buildsystems/CMakeLists.txt: if(WIN32 AND NOT MSVC)#not required for vis
+else()
+ find_program(MSGFMT_EXE msgfmt)
+ if(NOT MSGFMT_EXE)
-+ if (USING_VCPKG)
++ if(USE_VCPKG)
+ set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)
+ endif()
+ if(NOT EXISTS ${MSGFMT_EXE})
--
gitgitgadget
next prev parent reply other threads:[~2021-06-06 12:04 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 17:43 [PATCH 0/3] Make CMake work out of the box Matthew Rogers via GitGitGadget
2021-06-04 17:43 ` [PATCH 1/3] cmake: add knob to disable vcpkg Matthew Rogers via GitGitGadget
2021-06-04 18:03 ` Eric Sunshine
2021-06-04 18:34 ` Matt Rogers
2021-06-04 20:55 ` Sibi Siddharthan
2021-06-05 22:30 ` Matt Rogers
2021-06-06 4:33 ` Sibi Siddharthan
2021-06-04 17:43 ` [PATCH 2/3] cmake: create compile_commands.json by default Matthew Rogers via GitGitGadget
2021-06-04 18:05 ` Eric Sunshine
2021-06-04 21:09 ` Sibi Siddharthan
2021-06-05 22:36 ` Matt Rogers
2021-06-06 4:39 ` Sibi Siddharthan
2021-06-04 17:43 ` [PATCH 3/3] cmake: add warning for ignored MSGFMT_EXE Matthew Rogers via GitGitGadget
2021-06-04 18:10 ` Eric Sunshine
2021-06-05 3:40 ` [PATCH 0/3] Make CMake work out of the box Bagas Sanjaya
2021-06-05 23:22 ` Matt Rogers
2021-06-10 9:43 ` Johannes Schindelin
2021-06-18 13:05 ` Philip Oakley
2021-06-18 13:42 ` Johannes Schindelin
2021-06-18 14:03 ` Philip Oakley
2021-06-22 22:32 ` Johannes Schindelin
2021-06-06 12:02 ` Matthew Rogers via GitGitGadget [this message]
2021-06-06 12:02 ` [PATCH v2 1/3] cmake: add knob to disable vcpkg Matthew Rogers via GitGitGadget
2021-06-06 12:02 ` [PATCH v2 2/3] cmake: create compile_commands.json by default Matthew Rogers via GitGitGadget
2021-06-06 12:02 ` [PATCH v2 3/3] cmake: add warning for ignored MSGFMT_EXE Matthew Rogers via GitGitGadget
2021-06-07 0:54 ` [PATCH v2 0/3] Make CMake work out of the box Junio C Hamano
2021-06-10 9:45 ` Johannes Schindelin
2021-06-18 13:11 ` Philip Oakley
2021-06-18 13:09 ` Philip Oakley
2021-06-10 9:47 ` Johannes Schindelin
2021-06-11 6:22 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.970.v2.git.1622980974.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=bagasdotme@gmail.com \
--cc=git@vger.kernel.org \
--cc=mattr94@gmail.com \
--cc=sibisiddharthan.github@gmail.com \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).