Skip to content

Commit f6b2b80

Browse files
authored
Merge pull request #282 from aminya/add-remote [skip ci]
2 parents ca3ecdc + 67d723a commit f6b2b80

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ include(${_project_options_SOURCE_DIR}/Index.cmake)
7777
# install vcpkg dependencies: - should be called before defining project()
7878
run_vcpkg(
7979
VCPKG_URL "https://github.com/microsoft/vcpkg.git"
80-
VCPKG_REV "10e052511428d6b0c7fcc63a139e8024bb146032"
80+
VCPKG_REV "86a181505ac6460f98496a79abdee6a0f49905ec"
8181
)
8282
# Install conan dependencies: - should be called before defining project()
8383
run_conan()

docs/src/project_options_example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ include(${_project_options_SOURCE_DIR}/Index.cmake)
3030
# install vcpkg dependencies: - should be called before defining project()
3131
run_vcpkg(
3232
VCPKG_URL "https://github.com/microsoft/vcpkg.git"
33-
VCPKG_REV "10e052511428d6b0c7fcc63a139e8024bb146032"
33+
VCPKG_REV "86a181505ac6460f98496a79abdee6a0f49905ec"
3434
)
3535
# Install conan dependencies: - should be called before defining project()
3636
run_conan()

src/Git.cmake

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,16 @@ function(git_add_remote)
319319

320320
find_program(GIT_EXECUTABLE "git" REQUIRED)
321321

322-
# ensure that the given repository's remote is the current remote
322+
# Get the list of the remotes
323323
execute_process(
324324
COMMAND "${GIT_EXECUTABLE}" "remote" "-v" WORKING_DIRECTORY "${_fun_REPOSITORY_PATH}"
325325
COMMAND_ERROR_IS_FATAL LAST
326326
OUTPUT_VARIABLE _remote_output
327327
)
328-
string(FIND "${_remote_output}" "${_fun_REMOTE_URL}" _find_index)
328+
# Remove .git from the URL
329+
string(REGEX REPLACE "^(.*)\.git$" "\\1" _fun_REMOTE_URL_no_git "${_fun_REMOTE_URL}")
330+
# Check if the given remote already exists in the remote list
331+
string(FIND "${_remote_output}" "${_fun_REMOTE_URL_no_git}" _find_index)
329332

330333
# Add the given remote if it doesn't exist
331334
if(${_find_index} EQUAL -1)
@@ -343,12 +346,8 @@ function(git_add_remote)
343346
endif()
344347

345348
execute_process(
346-
COMMAND "${GIT_EXECUTABLE}" "remote" "add" "${_fun_REMOTE_NAME}" "${_fun_REMOTE_URL}"
347-
WORKING_DIRECTORY "${_fun_REPOSITORY_PATH}" COMMAND_ERROR_IS_FATAL LAST
348-
)
349-
execute_process(
350-
COMMAND "${GIT_EXECUTABLE}" "fetch" "${_fun_REMOTE_NAME}" WORKING_DIRECTORY "${_fun_REPOSITORY_PATH}"
351-
COMMAND_ERROR_IS_FATAL LAST
349+
COMMAND "${GIT_EXECUTABLE}" "remote" "add" "--fetch" "${_fun_REMOTE_NAME}" "${_fun_REMOTE_URL}"
350+
WORKING_DIRECTORY "${_fun_REPOSITORY_PATH}"
352351
)
353352
endif()
354353
endfunction()

src/Vcpkg.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Or by specifying the options
170170
171171
run_vcpkg(
172172
VCPKG_URL "https://github.com/microsoft/vcpkg.git"
173-
VCPKG_REV "10e052511428d6b0c7fcc63a139e8024bb146032"
173+
VCPKG_REV "86a181505ac6460f98496a79abdee6a0f49905ec"
174174
ENABLE_VCPKG_UPDATE
175175
)
176176

tests/install/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
33
"name": "another-project",
44
"version-string": "0.1.0",
5-
"builtin-baseline": "10e052511428d6b0c7fcc63a139e8024bb146032",
5+
"builtin-baseline": "86a181505ac6460f98496a79abdee6a0f49905ec",
66
"dependencies": [
77
{
88
"name": "eigen3",

tests/myproj/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if(ENABLE_CROSS_COMPILING)
1818
endif()
1919

2020
run_vcpkg(VCPKG_URL "https://github.com/microsoft/vcpkg.git" VCPKG_REV
21-
"10e052511428d6b0c7fcc63a139e8024bb146032" ENABLE_VCPKG_UPDATE
21+
"86a181505ac6460f98496a79abdee6a0f49905ec" ENABLE_VCPKG_UPDATE
2222
)
2323
run_conan()
2424

tests/myproj/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
33
"name": "myproject",
44
"version-string": "0.1.0",
5-
"builtin-baseline": "10e052511428d6b0c7fcc63a139e8024bb146032",
5+
"builtin-baseline": "86a181505ac6460f98496a79abdee6a0f49905ec",
66
"dependencies": [
77
{
88
"name": "eigen3",

0 commit comments

Comments
 (0)