diff options
author | Chris Bieneman <beanz@apple.com> | 2016-01-14 22:44:29 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2016-01-14 22:44:29 +0000 |
commit | 6bfebb747b200faf91c4cd898a51af4cadebde56 (patch) | |
tree | c2b64da5ed24077145673d54fa2500331347a508 /llvm/cmake/modules | |
parent | f6d17b953ca1fe8a79927e1ccfe0b2a2238d4965 (diff) | |
download | bcm5719-llvm-6bfebb747b200faf91c4cd898a51af4cadebde56.tar.gz bcm5719-llvm-6bfebb747b200faf91c4cd898a51af4cadebde56.zip |
[CMake] Add support for populating LLVM_REPOSITORY from CMake.
Autoconf does this in the GetRepositoryPath script, CMake's VersionFromVCS does grab the SVN_REVISION, but doesn't populate the repository URL.
llvm-svn: 257826
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r-- | llvm/cmake/modules/VersionFromVCS.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/cmake/modules/VersionFromVCS.cmake b/llvm/cmake/modules/VersionFromVCS.cmake index 26314d4126d..85cb8ead21a 100644 --- a/llvm/cmake/modules/VersionFromVCS.cmake +++ b/llvm/cmake/modules/VersionFromVCS.cmake @@ -16,6 +16,9 @@ function(add_version_info_from_vcs VERS) set(SVN_REVISION ${Project_WC_REVISION} PARENT_SCOPE) set(result "${result}-r${Project_WC_REVISION}") endif() + if( Project_WC_URL ) + set(LLVM_REPOSITORY ${Project_WC_URL} PARENT_SCOPE) + endif() endif() elseif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git ) set(result "${result}git") @@ -65,6 +68,19 @@ function(add_version_info_from_vcs VERS) else() set(result "${result}${git_svn_rev}") endif() + + execute_process(COMMAND + ${git_executable} svn info + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + TIMEOUT 5 + RESULT_VARIABLE git_result + OUTPUT_VARIABLE git_output) + if( git_result EQUAL 0) + string(REGEX MATCH "URL: ([^ \n]*)" svn_url ${git_output}) + if(svn_url) + set(LLVM_REPOSITORY ${CMAKE_MATCH_1} PARENT_SCOPE) + endif() + endif() endif() endif() endif() |