From 1cab079d6f40450b4f221611798191d345e5b021 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Wed, 6 May 2020 02:49:00 +0300 Subject: [PATCH] mdbx-cmake: one more fix fetch_version macro. Change-Id: Ic1cd4d2005149305ce320171f13edf3416e0b8f3 --- cmake/utils.cmake | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 25025a44..a4ed7bdf 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -169,32 +169,19 @@ macro(fetch_version name source_root_directory parent_scope) list(GET ${name}_VERSION_LIST 2 "${name}_VERSION_RELEASE") list(GET ${name}_VERSION_LIST 3 "${name}_VERSION_REVISION") - if(parent_scope) - set(${name}_VERSION_MAJOR ${${name}_VERSION_MAJOR} PARENT_SCOPE) - set(${name}_VERSION_MINOR ${${name}_VERSION_MINOR} PARENT_SCOPE) - set(${name}_VERSION_RELEASE ${${name}_VERSION_RELEASE} PARENT_SCOPE) - set(${name}_VERSION_REVISION ${${name}_VERSION_REVISION} PARENT_SCOPE) - set(${name}_VERSION ${${name}_VERSION} PARENT_SCOPE) + if(${parent_scope}) + set(${name}_VERSION_MAJOR "${${name}_VERSION_MAJOR}" PARENT_SCOPE) + set(${name}_VERSION_MINOR "${${name}_VERSION_MINOR}" PARENT_SCOPE) + set(${name}_VERSION_RELEASE "${${name}_VERSION_RELEASE}" PARENT_SCOPE) + set(${name}_VERSION_REVISION "${${name}_VERSION_REVISION}" PARENT_SCOPE) + set(${name}_VERSION "${${name}_VERSION}" PARENT_SCOPE) - set(${name}_GIT_DESCRIBE ${${name}_GIT_DESCRIBE} PARENT_SCOPE) - set(${name}_GIT_TIMESTAMP ${${name}_GIT_TIMESTAMP} PARENT_SCOPE) - set(${name}_GIT_TREE ${${name}_GIT_TREE} PARENT_SCOPE) - set(${name}_GIT_COMMIT ${${name}_GIT_COMMIT} PARENT_SCOPE) - set(${name}_GIT_REVISION ${${name}_GIT_REVISION} PARENT_SCOPE) - set(${name}_GIT_VERSION ${${name}_GIT_VERSION} PARENT_SCOPE) - else() - set(${name}_VERSION_MAJOR ${${name}_VERSION_MAJOR}) - set(${name}_VERSION_MINOR ${${name}_VERSION_MINOR}) - set(${name}_VERSION_RELEASE ${${name}_VERSION_RELEASE}) - set(${name}_VERSION_REVISION ${${name}_VERSION_REVISION}) - set(${name}_VERSION ${${name}_VERSION}) - - set(${name}_GIT_DESCRIBE ${${name}_GIT_DESCRIBE}) - set(${name}_GIT_TIMESTAMP ${${name}_GIT_TIMESTAMP}) - set(${name}_GIT_TREE ${${name}_GIT_TREE}) - set(${name}_GIT_COMMIT ${${name}_GIT_COMMIT}) - set(${name}_GIT_REVISION ${${name}_GIT_REVISION}) - set(${name}_GIT_VERSION ${${name}_GIT_VERSION}) + set(${name}_GIT_DESCRIBE "${${name}_GIT_DESCRIBE}" PARENT_SCOPE) + set(${name}_GIT_TIMESTAMP "${${name}_GIT_TIMESTAMP}" PARENT_SCOPE) + set(${name}_GIT_TREE "${${name}_GIT_TREE}" PARENT_SCOPE) + set(${name}_GIT_COMMIT "${${name}_GIT_COMMIT}" PARENT_SCOPE) + set(${name}_GIT_REVISION "${${name}_GIT_REVISION}" PARENT_SCOPE) + set(${name}_GIT_VERSION "${${name}_GIT_VERSION}" PARENT_SCOPE) endif() endmacro(fetch_version)