aboutsummaryrefslogtreecommitdiffstats
path: root/build/conf
diff options
context:
space:
mode:
authordimdim11 <dimdim11@yandex-team.com>2024-08-14 09:30:41 +0300
committerdimdim11 <dimdim11@yandex-team.com>2024-08-14 09:40:46 +0300
commitd27afd6ad62a512f5f1973b11908d9626a11f317 (patch)
tree553e4deeb4d49f6ee93689f892dc98acfaab3125 /build/conf
parent58ef1d58d6f938f241e967ba4c66daf871a21340 (diff)
downloadydb-d27afd6ad62a512f5f1973b11908d9626a11f317.tar.gz
(1of3) Refactor opensource replacement
Refactor opensource replacement a0c25750dcdcf70f3c41ff614b5b3bcf34b532cf
Diffstat (limited to 'build/conf')
-rw-r--r--build/conf/opensource.conf39
1 files changed, 25 insertions, 14 deletions
diff --git a/build/conf/opensource.conf b/build/conf/opensource.conf
index dfdd63c335..852972820d 100644
--- a/build/conf/opensource.conf
+++ b/build/conf/opensource.conf
@@ -54,21 +54,32 @@ when ($OPENSOURCE == "yes" && $EXPORT_CMAKE == "yes") {
EXPORTED_BUILD_SYSTEM_BUILD_ROOT="${PROJECT_BINARY_DIR}"
}
-CMAKE_PACKAGE=
-CMAKE_PACKAGE_COMPONENT=
-CMAKE_PACKAGE_TARGET=
-CONAN_REFERENCE=
-CONAN_PKG_OPTS=
-### @usage: OPENSOURCE_EXPORT_REPLACEMENT(CMAKE PkgName CMAKE_TARGET PkgName::PkgTarget CONAN ConanRef CMAKE_COMPONENT OptCmakePkgComponent)
-###
-### Use specified conan/system pacakcge when exporting cmake build scripts for arcadia C++ project
-### for opensource publication.
-macro OPENSOURCE_EXPORT_REPLACEMENT(CMAKE[], CMAKE_TARGET[], CMAKE_COMPONENT[], CONAN[], CONAN_OPTIONS[]) {
- SET(CMAKE_PACKAGE $CMAKE)
- SET(CMAKE_PACKAGE_COMPONENT $CMAKE_COMPONENT)
+CMAKE_PACKAGE_SEM=
+CONAN_REQUIRES_SEM=
+CONAN_OPTIONS_SEM=
+CONAN_OS_REQUIRES_SEM=
+CONAN_OS_OPTIONS_SEM=
+macro _OPENSOURCE_EXPORT_REPLACEMENT_CMAKE(CMAKE[], CMAKE_TARGET[], CMAKE_COMPONENT[]) {
+ SET(CMAKE_PACKAGE_SEM packages-ITEM && packages-name $CMAKE ${pre= && packages-components :CMAKE_COMPONENT} && mpackages-ITEM && mpackages-name $CMAKE ${pre= && mpackages-components :CMAKE_COMPONENT} && find_package $CMAKE ${pre= COMPONENTS :CMAKE_COMPONENT} )
SET(CMAKE_LINK_TARGET $CMAKE_TARGET)
- SET(CONAN_REFERENCE $CONAN)
- SET(CONAN_PKG_OPTS $CONAN_OPTIONS)
+}
+
+### @usage: OPENSOURCE_EXPORT_REPLACEMENT(CMAKE PkgName CMAKE_COMPONENT OptCmakePkgComponent CMAKE_TARGET PkgName::PkgTarget CONAN ConanRequire CONAN ConanOptions CONAN_ADDITIONAL_SEMS ConanAdditionalSems)
+###
+### Use specified conan/system package when exporting cmake build scripts for arcadia C++ project for opensource publication.
+macro OPENSOURCE_EXPORT_REPLACEMENT(CMAKE[], CMAKE_TARGET[], CMAKE_COMPONENT[], CONAN[], CONAN_OPTIONS[], CONAN_ADDITIONAL_SEMS[]) {
+ _OPENSOURCE_EXPORT_REPLACEMENT_CMAKE(CMAKE $CMAKE CMAKE_TARGET $CMAKE_TARGET CMAKE_COMPONENT $CMAKE_COMPONENT)
+ SET(CONAN_REQUIRES_SEM && conan_require $CONAN && conan-requires $CONAN $CONAN_ADDITIONAL_SEMS)
+ SET(CONAN_OPTIONS_SEM ${pre=&& conan_options :CONAN_OPTIONS} ${pre=&& conan-options :CONAN_OPTIONS})
+}
+
+### @usage: OPENSOURCE_EXPORT_REPLACEMENT_BY_OS(OS Os CMAKE PkgName CMAKE_COMPONENT OptCmakePkgComponent CMAKE_TARGET PkgName::PkgTarget CONAN ConanRequire CONAN ConanOptions CONAN_ADDITIONAL_SEMS ConanAdditionalSems)
+###
+### Use specified conan/system package when exporting cmake build scripts for arcadia C++ project for opensource publication.
+macro OPENSOURCE_EXPORT_REPLACEMENT_BY_OS(OS[], CMAKE[], CMAKE_TARGET[], CMAKE_COMPONENT[], CONAN[], CONAN_OPTIONS[], CONAN_ADDITIONAL_SEMS[]) {
+ _OPENSOURCE_EXPORT_REPLACEMENT_CMAKE(CMAKE $CMAKE CMAKE_TARGET $CMAKE_TARGET CMAKE_COMPONENT $CMAKE_COMPONENT)
+ SET(CONAN_OS_REQUIRES_SEM && conan-os_depends-ITEM && conan-os_depends-os $OS && conan-os_depends-requires $CONAN $CONAN_ADDITIONAL_SEMS)
+ SET(CONAN_OS_OPTIONS_SEM && conan-os_depends-ITEM && conan-os_depends-os $OS ${pre=&& conan-os_depends-opts :CONAN_OPTIONS})
}
CMAKE_TARGET_NAME=$REALPRJNAME