Skip to content

Commit

Permalink
Merge pull request #1006 from dkorolev/add_c5t_project_root
Browse files Browse the repository at this point in the history
Cloning into "${CMAKE_CURRENT_SOURCE_DIR}".
  • Loading branch information
dkorolev authored Jul 6, 2024
2 parents 8be019d + 688cf7b commit dcc7305
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ function(UseGitOrCloneImpl remote use_custom_branch custom_branch)
else()
if(NOT use_custom_branch)
message(STATUS "Cloning `${dep}` from `${remote}` using the default branch ...")
execute_process(OUTPUT_QUIET ERROR_QUIET COMMAND git clone --depth 1 ${remote})
execute_process(OUTPUT_QUIET ERROR_QUIET COMMAND git clone --depth 1 ${remote} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
else()
message(STATUS "Cloning `${dep}` from `${remote}:${branch}` ...")
execute_process(OUTPUT_QUIET ERROR_QUIET COMMAND git clone --depth 1 -b ${custom_branch} ${remote})
execute_process(OUTPUT_QUIET ERROR_QUIET COMMAND git clone --depth 1 -b ${custom_branch} ${remote} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
add_subdirectory("${CMAKE_SOURCE_DIR}/${dep}" ${dep})
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/${dep}" ${dep})
message(STATUS "Cloning `${dep}` from `${remote}`: Configured.")
if("${C5T_PROJECT_ROOT}" STREQUAL "")
file(TOUCH .gitignore)
file(APPEND .gitignore "${dep}/\n") # NOTE(dkorolev): This may add extra `.gitignore` lines, ignore for now.
endif()
set("C5T_DEP_DIR_${dep}" "${CMAKE_SOURCE_DIR}/${dep}" CACHE INTERNAL "")
set("C5T_DEP_DIR_${dep}" "${CMAKE_CURRENT_SOURCE_DIR}/${dep}" CACHE INTERNAL "")
endif()
# If the added repository contains the `.c5t_cmake_dependency` file,
# then add this repo's C5T library name to all targets built by this `CMakeLists.txt`.
Expand Down

0 comments on commit dcc7305

Please sign in to comment.