Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set(CMAKE_PREMISES_PATH "${CMAKE_CURRENT_LIST_DIR}/CMakePremises")
- unset(GIT CACHE)
- find_program(GIT git)
- if(${GIT} STREQUAL "GIT-NOTFOUND")
- message(FATAL_ERROR "Git not found. Add it to PATH and try again")
- endif()
- macro(git)
- execute_process(
- COMMAND ${GIT} ${ARGN}
- ERROR_VARIABLE ERROR_MESSAGE
- RESULT_VARIABLE ERROR_CODE)
- if(NOT ${ERROR_CODE} EQUAL 0)
- message(FATAL_ERROR "${ERROR_MESSAGE}")
- endif()
- endmacro()
- function(clone_CMakePremises)
- git(
- clone ssh://slb1-swt@vs-ssh.visualstudio.com:22/OLGA/_ssh/CMakePremises ${CMAKE_PREMISES_PATH}
- WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
- endfunction()
- function(update_CMakePremises)
- git(
- fetch --all
- WORKING_DIRECTORY ${CMAKE_PREMISES_PATH})
- git(
- reset --hard HEAD
- WORKING_DIRECTORY ${CMAKE_PREMISES_PATH})
- endfunction()
- if(EXISTS ${CMAKE_PREMISES_PATH})
- update_CMakePremises()
- else()
- clone_CMakePremises()
- endif()
- file(WRITE "${CMAKE_PREMISES_PATH}/.gitignore" "*")
- include(${CMAKE_CURRENT_LIST_DIR}/CMakePremises/Dependencies.cmake)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement