Skip to content

Commit

Permalink
add documentation as an external git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-ce committed Nov 30, 2023
1 parent 535fe2b commit 8a111ed
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3,726 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/CMakeLists.txt.user
/extern/*
/doc/*
/doc
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ endif()
include(cmake/alp_add_git_repository.cmake)
alp_add_git_repository(renderer_static_data URL https://github.com/AlpineMapsOrg/renderer_static_data.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT)
alp_add_git_repository(alpineapp_fonts URL https://github.com/AlpineMapsOrg/fonts.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT)
alp_add_git_repository(doc URL https://github.com/AlpineMapsOrg/documentation.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT DESTINATION_PATH doc)


if (ANDROID)
alp_add_git_repository(android_openssl URL https://github.com/KDAB/android_openssl.git COMMITISH origin/master DO_NOT_ADD_SUBPROJECT)
Expand Down
9 changes: 6 additions & 3 deletions cmake/alp_add_git_repository.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ find_package(Git 2.22 REQUIRED)

function(alp_add_git_repository name)
set(options DO_NOT_ADD_SUBPROJECT)
set(oneValueArgs URL COMMITISH)
set(oneValueArgs URL COMMITISH DESTINATION_PATH)
set(multiValueArgs )
cmake_parse_arguments(PARSE_ARGV 1 PARAM "${options}" "${oneValueArgs}" "${multiValueArgs}")

file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/${ALP_EXTERN_DIR} )
set(repo_dir ${CMAKE_SOURCE_DIR}/${ALP_EXTERN_DIR}/${name})
set(short_repo_dir ${ALP_EXTERN_DIR}/${name})
if (DEFINED PARAM_DESTINATION_PATH AND NOT PARAM_DESTINATION_PATH STREQUAL "")
set(repo_dir ${CMAKE_SOURCE_DIR}/${PARAM_DESTINATION_PATH})
set(short_repo_dir ${PARAM_DESTINATION_PATH})
endif()

set(${name}_SOURCE_DIR "${repo_dir}" PARENT_SCOPE)

Expand Down Expand Up @@ -70,8 +74,7 @@ function(alp_add_git_repository name)
endif()
else()
message(STATUS "Clonging ${PARAM_URL} to ${short_repo_dir}.")
execute_process(COMMAND ${GIT_EXECUTABLE} clone --recurse-submodules ${PARAM_URL} ${name}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/${ALP_EXTERN_DIR}
execute_process(COMMAND ${GIT_EXECUTABLE} clone --recurse-submodules ${PARAM_URL} ${repo_dir}
RESULT_VARIABLE GIT_CLONE_RESULT)
if (NOT ${GIT_CLONE_RESULT})
execute_process(COMMAND ${GIT_EXECUTABLE} checkout --quiet ${PARAM_COMMITISH}
Expand Down
Loading

0 comments on commit 8a111ed

Please sign in to comment.