-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make CMake work out of the box #970
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,14 +43,27 @@ 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Eric Sunshine wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Eric Sunshine wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Sibi Siddharthan wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Matt Rogers wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Sibi Siddharthan wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Sibi Siddharthan wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Matt Rogers wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Sibi Siddharthan wrote (reply to this):
|
||
`-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) | ||
|
||
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(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) | ||
endif() | ||
|
||
if(USE_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() | ||
|
@@ -176,12 +189,18 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds | |
endif() | ||
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(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(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}) | ||
message(WARNING "Text Translations won't be built") | ||
unset(MSGFMT_EXE) | ||
endif() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a missing And I'd like to avoid There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made some updates with your comments in mind, I think the version I have is a bit more what we want, I changed the text output from a warning to a status because this should be normal operation if we're operating under NO_GETTEXT and I felt issuing a warning for that would be a bit weird. |
||
endif() | ||
endif() | ||
|
||
|
@@ -982,7 +1001,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(USE_VCPKG) | ||
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n") | ||
endif() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Eric Sunshine wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Matt Rogers wrote (reply to this):