Skip to content

Cmake porting#432

Merged
lalitb merged 6 commits intoopen-telemetry:masterfrom
owent:cmake_porting
Dec 29, 2020
Merged

Cmake porting#432
lalitb merged 6 commits intoopen-telemetry:masterfrom
owent:cmake_porting

Conversation

@owent
Copy link
Copy Markdown
Member

@owent owent commented Dec 9, 2020

Add and install cmake config for all library targets and export target with the same name as bazel.

See #424

@owent owent requested a review from a team December 9, 2020 07:20
@owent owent force-pushed the cmake_porting branch 2 times, most recently from e5691fc to 1577238 Compare December 9, 2020 08:43
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 9, 2020

Codecov Report

Merging #432 (24d07d1) into master (7e06316) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #432   +/-   ##
=======================================
  Coverage   94.37%   94.37%           
=======================================
  Files         189      189           
  Lines        8410     8410           
=======================================
  Hits         7937     7937           
  Misses        473      473           
Impacted Files Coverage Δ
sdk/test/metrics/counter_aggregator_test.cc 98.21% <0.00%> (-1.79%) ⬇️
sdk/test/common/circular_buffer_test.cc 100.00% <0.00%> (+1.02%) ⬆️

Comment thread CMakeLists.txt Outdated
endif()
if(VCPKG_TARGET_TRIPLET MATCHES "^.*windows-static$")
set(CMAKE_MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it only Debug?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These codes mean set CMAKE_MSVC_RUNTIME_LIBRARY to MultiThreadedDebug when CMAKE_BUILD_TYPE is Debug , otherwise set CMAKE_MSVC_RUNTIME_LIBRARY to MultiThreaded . Just like https://github.com/microsoft/vcpkg/blob/master/scripts/toolchains/windows.cmake#L3 in vcpkg.

These codes are a old patch to compact for both x64/x86-windows-static and x64/x86-windows-static-md and can be replaced by the new codes set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<STREQUAL:${VCPKG_CRT_LINKAGE},dynamic>:DLL>" CACHE STRING "") now. I will update them later.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxgolov I have already update the cmake script and rebased from master again.

Copy link
Copy Markdown
Contributor

@maxgolov maxgolov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me, but I'd like (selfishly) merge my way older PR first ( #374 ), that older one is a bigger PR that does changes in many cmake files. So if we merge this current PR, then yet again I would run into conflicts and have to spend yet another day to merge and retest.. sigh 😄

@owent
Copy link
Copy Markdown
Member Author

owent commented Dec 19, 2020

It looks good to me, but I'd like (selfishly) merge my way older PR first ( #374 ), that older one is a bigger PR that does changes in many cmake files. So if we merge this current PR, then yet again I would run into conflicts and have to spend yet another day to merge and retest.. sigh 😄

Maybe I can create another PR witch is based of maxgolov/nostd_stl ?

@maxgolov
Copy link
Copy Markdown
Contributor

maxgolov commented Dec 22, 2020

@owt5008137 - No, it's now merged in the master. You're good. The changes look good to me in general. Thank you for your contribution! Would you be able to resolve the conflicts with the master and update the this PR?

@jsuereth @alolita - we need review from someone outside of Microsoft on this.

@owent
Copy link
Copy Markdown
Member Author

owent commented Dec 23, 2020

@owt5008137 - No, it's now merged in the master. You're good. The changes look good to me in general. Thank you for your contribution! Would you be able to resolve the conflicts with the master and update the this PR?

@jsuereth @alolita - we need review from someone outside of Microsoft on this.

@maxgolov All conflicts are resolved. And I submit another commit to fix curl/curl.h not found when using custom built and installed libcurl. The old usage do not support cmake config files generated by curl and there is also a spelling mistake.

Comment thread CMakeLists.txt
Comment on lines +187 to +188
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't include these 2 for non-posix?

Copy link
Copy Markdown
Member Author

@owent owent Dec 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GNUInstallDirs module only defines some directory names to install. And CMakePackageConfigHelpers is used to generate the standardized cmake config files, they are used by find_package(NAME CONFIG) of cmake. These two modules are useful on both posix and non-posix platforms.

Copy link
Copy Markdown
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for adding install configurations.

@lalitb lalitb requested a review from jsuereth December 23, 2020 10:02
@lalitb
Copy link
Copy Markdown
Member

lalitb commented Dec 28, 2020

@owt5008137 - Can you please rebase the branch with master, so that we can merge the PR.

@lalitb
Copy link
Copy Markdown
Member

lalitb commented Dec 29, 2020

@jsuereth -this is cmake- specific, and reviewed by @maxgolov and @ThomsonTan . Please let us know if this is ok to merge.

@owent
Copy link
Copy Markdown
Member Author

owent commented Dec 29, 2020

@owt5008137 - Can you please rebase the branch with master, so that we can merge the PR.

done

@lalitb lalitb merged commit 98bbdd6 into open-telemetry:master Dec 29, 2020
@owent owent deleted the cmake_porting branch May 28, 2021 02:07
GerHobbelt pushed a commit to GerHobbelt/opentelemetry-cpp that referenced this pull request Aug 31, 2025
…and-patch-dependencies

Update otel/opentelemetry-collector Docker tag to v0.131.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants