From 99cfee6f4ba5682395e1bee0bccbc4bf55230965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sun, 12 Jun 2022 23:13:14 +0300 Subject: [PATCH] mdbx-cmake: don't provide nor report package information if used as a subproject. --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a7cfef8..387d60d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -940,12 +940,14 @@ endif() ################################################################################ -set(PACKAGE "libmdbx") -set(CPACK_PACKAGE_VERSION_MAJOR ${MDBX_VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${MDBX_VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${MDBX_VERSION_RELEASE}) -set(CPACK_PACKAGE_VERSION_COMMIT ${MDBX_VERSION_REVISION}) -set(PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.${CPACK_PACKAGE_VERSION_COMMIT}") -message(STATUS "libmdbx package version is ${PACKAGE_VERSION}") +if (NOT SUBPROJECT) + set(PACKAGE "libmdbx") + set(CPACK_PACKAGE_VERSION_MAJOR ${MDBX_VERSION_MAJOR}) + set(CPACK_PACKAGE_VERSION_MINOR ${MDBX_VERSION_MINOR}) + set(CPACK_PACKAGE_VERSION_PATCH ${MDBX_VERSION_RELEASE}) + set(CPACK_PACKAGE_VERSION_COMMIT ${MDBX_VERSION_REVISION}) + set(PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.${CPACK_PACKAGE_VERSION_COMMIT}") + message(STATUS "libmdbx package version is ${PACKAGE_VERSION}") +endif() cmake_policy(POP)