4242
4343## [ Build scripts]
4444
45- ### CMake WITH_OTLP_RETRY_PREVIEW
46-
47- #### Announcement (WITH_OTLP_RETRY_PREVIEW)
48-
49- The CMake compile flag WITH_OTLP_RETRY_PREVIEW is deprecated by:
45+ ### Legacy CMake option names
46+
47+ #### Announcement (legacy CMake option names)
48+
49+ * Version: ` TO-BE-RELEASED-VERSION `
50+ * Date: ` TO-BE-RELEASED-DATE `
51+ * PR: [ #4268 ] ( https://github.com/open-telemetry/opentelemetry-cpp/pull/4268 )
52+
53+ #### Motivation (legacy CMake option names)
54+
55+ Generic CMake option names can collide with variables owned by applications,
56+ parent projects, and third-party dependencies. The ` OTELCPP_ ` prefix identifies
57+ options owned by opentelemetry-cpp.
58+
59+ #### Scope (legacy CMake option names)
60+
61+ The following legacy CMake option names are deprecated:
62+
63+ | Legacy name | Replacement |
64+ | --- | --- |
65+ | ` BUILD_PACKAGE ` | ` OTELCPP_BUILD_PACKAGE ` |
66+ | ` BUILD_W3CTRACECONTEXT_TEST ` | ` OTELCPP_BUILD_W3CTRACECONTEXT_TEST ` |
67+ | ` OPENTELEMETRY_BUILD_DLL ` | ` OTELCPP_BUILD_DLL ` |
68+ | ` OPENTELEMETRY_EXTERNAL_COMPONENT_PATH ` | ` OTELCPP_EXTERNAL_COMPONENT_PATH ` |
69+ | ` OPENTELEMETRY_INSTALL ` | ` OTELCPP_INSTALL ` |
70+ | ` OPENTELEMETRY_SKIP_DYNAMIC_LOADING_TESTS ` | ` OTELCPP_SKIP_DYNAMIC_LOADING_TESTS ` |
71+ | ` TARBALL ` | ` OTELCPP_TARBALL ` |
72+ | ` WITH_ABI_VERSION_1 ` | ` OTELCPP_WITH_ABI_VERSION_1 ` |
73+ | ` WITH_ABI_VERSION_2 ` | ` OTELCPP_WITH_ABI_VERSION_2 ` |
74+ | ` WITH_API_ONLY ` | ` OTELCPP_WITH_API_ONLY ` |
75+ | ` WITH_ASYNC_EXPORT_PREVIEW ` | ` OTELCPP_WITH_ASYNC_EXPORT_PREVIEW ` |
76+ | ` WITH_BENCHMARK ` | ` OTELCPP_WITH_BENCHMARK ` |
77+ | ` WITH_CONFIGURATION ` | ` OTELCPP_WITH_CONFIGURATION ` |
78+ | ` WITH_CURL_LOGGING ` | ` OTELCPP_WITH_CURL_LOGGING ` |
79+ | ` WITH_ELASTICSEARCH ` | ` OTELCPP_WITH_ELASTICSEARCH ` |
80+ | ` WITH_ETW ` | ` OTELCPP_WITH_ETW ` |
81+ | ` WITH_EXAMPLES ` | ` OTELCPP_WITH_EXAMPLES ` |
82+ | ` WITH_EXAMPLES_HTTP ` | ` OTELCPP_WITH_EXAMPLES_HTTP ` |
83+ | ` WITH_FUNC_TESTS ` | ` OTELCPP_WITH_FUNC_TESTS ` |
84+ | ` WITH_GSL ` | ` OTELCPP_WITH_GSL ` |
85+ | ` WITH_HTTP_CLIENT_CURL ` | ` OTELCPP_WITH_HTTP_CLIENT_CURL ` |
86+ | ` WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW ` | ` OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW ` |
87+ | ` WITH_METRICS_EXEMPLAR_PREVIEW ` | ` OTELCPP_WITH_METRICS_EXEMPLAR_PREVIEW ` |
88+ | ` WITH_NO_DEPRECATED_CODE ` | ` OTELCPP_WITH_NO_DEPRECATED_CODE ` |
89+ | ` WITH_NO_GETENV ` | ` OTELCPP_WITH_NO_GETENV ` |
90+ | ` WITH_OPENTRACING ` | ` OTELCPP_WITH_OPENTRACING ` |
91+ | ` WITH_OTLP_FILE ` | ` OTELCPP_WITH_OTLP_FILE ` |
92+ | ` WITH_OTLP_GRPC ` | ` OTELCPP_WITH_OTLP_GRPC ` |
93+ | ` WITH_OTLP_GRPC_CREDENTIAL_PREVIEW ` | ` OTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW ` |
94+ | ` WITH_OTLP_GRPC_SSL_MTLS_PREVIEW ` | ` OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW ` |
95+ | ` WITH_OTLP_HTTP ` | ` OTELCPP_WITH_OTLP_HTTP ` |
96+ | ` WITH_OTLP_HTTP_COMPRESSION ` | ` OTELCPP_WITH_OTLP_HTTP_COMPRESSION ` |
97+ | ` WITH_OTLP_RETRY_PREVIEW ` | ` OTELCPP_WITH_OTLP_RETRY_PREVIEW ` |
98+ | ` WITH_OTLP_UTF8_VALIDITY ` | ` OTELCPP_WITH_OTLP_UTF8_VALIDITY ` |
99+ | ` WITH_PROMETHEUS ` | ` OTELCPP_WITH_PROMETHEUS ` |
100+ | ` WITH_RESOURCE_DETECTORS_PREVIEW ` | ` OTELCPP_WITH_RESOURCE_DETECTORS_PREVIEW ` |
101+ | ` WITH_STL ` | ` OTELCPP_WITH_STL ` |
102+ | ` WITH_THREAD_INSTRUMENTATION_PREVIEW ` | ` OTELCPP_WITH_THREAD_INSTRUMENTATION_PREVIEW ` |
103+ | ` WITH_ZIPKIN ` | ` OTELCPP_WITH_ZIPKIN ` |
104+
105+ ` BUILD_TESTING ` is not listed because it is a standard CMake variable, not a
106+ deprecated alias. When opentelemetry-cpp is the top-level project,
107+ ` BUILD_TESTING ` provides the default for ` OTELCPP_BUILD_TESTING ` . Set
108+ ` OTELCPP_BUILD_TESTING ` explicitly to control opentelemetry-cpp tests.
109+
110+ #### Mitigation (legacy CMake option names)
111+
112+ Update CMake command lines, presets, build scripts, and CI configurations to
113+ use the replacement names. The legacy names are still accepted during the
114+ deprecation period and produce a deprecation warning at configure time. When
115+ both names are set, the ` OTELCPP_ ` name takes precedence.
116+
117+ #### Planned removal (legacy CMake option names)
118+
119+ The legacy CMake option names will be removed in a future release. The
120+ replacement names are not affected by this removal.
121+
122+ ### CMake OTELCPP_WITH_OTLP_RETRY_PREVIEW
123+
124+ #### Announcement (OTELCPP_WITH_OTLP_RETRY_PREVIEW)
125+
126+ The CMake compile flag ` OTELCPP_WITH_OTLP_RETRY_PREVIEW ` , formerly named
127+ ` WITH_OTLP_RETRY_PREVIEW ` , is deprecated by:
50128
51129* Enable WITH_OTLP_RETRY_PREVIEW by default
52130 [ #3953 ] ( https://github.com/open-telemetry/opentelemetry-cpp/pull/3953 )
53131
54- #### Motivation (WITH_OTLP_RETRY_PREVIEW )
132+ #### Motivation (OTELCPP_WITH_OTLP_RETRY_PREVIEW )
55133
56- Flags like ` WITH_OTLP_RETRY_PREVIEW ` are used to conditionally compile
57- new features, when they are introduced in the code base.
134+ Flags like ` OTELCPP_WITH_OTLP_RETRY_PREVIEW ` are used to conditionally compile
135+ new features when they are introduced in the code base.
58136
59137Now that this feature is stable, conditional compilation is no longer
60138necessary.
61139
62- #### Scope (WITH_OTLP_RETRY_PREVIEW )
140+ #### Scope (OTELCPP_WITH_OTLP_RETRY_PREVIEW )
63141
64- Remove compilation flag WITH_OTLP_RETRY_PREVIEW in CMake.
142+ Remove the ` OTELCPP_WITH_OTLP_RETRY_PREVIEW ` compilation flag and its legacy
143+ name ` WITH_OTLP_RETRY_PREVIEW ` from CMake.
65144
66- Remove ifdef ENABLE_OTLP_RETRY_PREVIEW in C++ .
145+ Remove the ` ENABLE_OTLP_RETRY_PREVIEW ` preprocessor condition from C++.
67146
68- #### Mitigation (WITH_OTLP_RETRY_PREVIEW )
147+ #### Mitigation (OTELCPP_WITH_OTLP_RETRY_PREVIEW )
69148
70- Applications built with ` WITH_OTLP_RETRY_PREVIEW=ON ` need to:
149+ Applications built with ` OTELCPP_WITH_OTLP_RETRY_PREVIEW=ON ` or
150+ ` WITH_OTLP_RETRY_PREVIEW=ON ` need to:
71151
72- * remove the WITH_OTLP_RETRY_PREVIEW flag from CMake scripts
152+ * remove the preview flag from CMake scripts
73153
74- Applications built with ` WITH_OTLP_RETRY_PREVIEW=OFF ` need to:
154+ Applications built with ` OTELCPP_WITH_OTLP_RETRY_PREVIEW=OFF ` or
155+ ` WITH_OTLP_RETRY_PREVIEW=OFF ` need to:
75156
76- * remove the WITH_OTLP_RETRY_PREVIEW flag from CMake scripts
157+ * remove the preview flag from CMake scripts
77158* use ` retry_policy_max_attempts ` = 0 in the OTLP exporter options.
78159
79160For Bazel, no compilation option exists,
@@ -82,42 +163,46 @@ the bazel build enables unconditionally ENABLE_OTLP_RETRY_PREVIEW.
82163Make sure to properly initialize ` retry_policy_max_attempts `
83164to enable or disable the retry feature.
84165
85- #### Planned removal (WITH_OTLP_RETRY_PREVIEW )
166+ #### Planned removal (OTELCPP_WITH_OTLP_RETRY_PREVIEW )
86167
87168This compilation flag will be removed after October 1st, 2026.
88169
89- ### CMake WITH_OTLP_GRPC_SSL_MTLS_PREVIEW
170+ ### CMake OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW
90171
91- #### Announcement (WITH_OTLP_GRPC_SSL_MTLS_PREVIEW )
172+ #### Announcement (OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW )
92173
93- The CMake compile flag WITH_OTLP_GRPC_SSL_MTLS_PREVIEW is deprecated by:
174+ The CMake compile flag ` OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW ` , formerly
175+ named ` WITH_OTLP_GRPC_SSL_MTLS_PREVIEW ` , is deprecated by:
94176
95177* Enable WITH_OTLP_GRPC_SSL_MTLS_PREVIEW by default
96178 [ #3970 ] ( https://github.com/open-telemetry/opentelemetry-cpp/pull/3970 )
97179
98- #### Motivation (WITH_OTLP_GRPC_SSL_MTLS_PREVIEW )
180+ #### Motivation (OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW )
99181
100- Flags like ` WITH_OTLP_GRPC_SSL_MTLS_PREVIEW ` are used to conditionally compile
101- new features, when they are introduced in the code base.
182+ Flags like ` OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW ` are used to conditionally
183+ compile new features when they are introduced in the code base.
102184
103185Now that this feature is stable, conditional compilation is no longer
104186necessary.
105187
106- #### Scope (WITH_OTLP_GRPC_SSL_MTLS_PREVIEW )
188+ #### Scope (OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW )
107189
108- Remove compilation flag WITH_OTLP_GRPC_SSL_MTLS_PREVIEW in CMake.
190+ Remove the ` OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW ` compilation flag and its
191+ legacy name ` WITH_OTLP_GRPC_SSL_MTLS_PREVIEW ` from CMake.
109192
110- Remove ifdef ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW in C++ .
193+ Remove the ` ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW ` preprocessor condition from C++.
111194
112- #### Mitigation (WITH_OTLP_GRPC_SSL_MTLS_PREVIEW )
195+ #### Mitigation (OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW )
113196
114- Applications built with ` WITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON ` need to:
197+ Applications built with ` OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON ` or
198+ ` WITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON ` need to:
115199
116- * remove the WITH_OTLP_GRPC_SSL_MTLS_PREVIEW flag from CMake scripts
200+ * remove the preview flag from CMake scripts
117201
118- Applications built with ` WITH_OTLP_GRPC_SSL_MTLS_PREVIEW=OFF ` need to:
202+ Applications built with ` OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW=OFF ` or
203+ ` WITH_OTLP_GRPC_SSL_MTLS_PREVIEW=OFF ` need to:
119204
120- * remove the WITH_OTLP_GRPC_SSL_MTLS_PREVIEW flag from CMake scripts
205+ * remove the preview flag from CMake scripts
121206* initialize ssl client properties in the OTLP GRPC exporter options,
122207 either with real KEY and CERT data, or with empty strings.
123208
@@ -134,7 +219,7 @@ ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW.
134219Make sure to properly initialize ssl client properties
135220to enable or disable the feature.
136221
137- #### Planned removal (WITH_OTLP_GRPC_SSL_MTLS_PREVIEW )
222+ #### Planned removal (OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW )
138223
139224This compilation flag will be removed after October 1st, 2026.
140225
0 commit comments