Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUILD] Fixing CMake to build GTest on Windows #1887

Merged
merged 25 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0d6e552
cmake breaks here because of the REQUIRED clause
bachittle Dec 22, 2022
492285c
Merge branch 'main' into cmake_win_fix
bachittle Jan 3, 2023
877e14c
Merge branch 'main' into cmake_win_fix
lalitb Jan 3, 2023
d9e8473
Merge branch 'cmake_win_fix' of https://github.com/bachittle/opentele…
bachittle Jan 3, 2023
070a675
playing around with vcpkg, got it working but all tests fail (most li…
bachittle Jan 3, 2023
1124c66
Merge branch 'main' into cmake_win_fix
ThomsonTan Jan 3, 2023
e3d8a79
cmake toolchain files can't be set inside cmakelists.txt, maybe at th…
bachittle Jan 4, 2023
22caf23
Merge branch 'cmake_win_fix' of https://github.com/bachittle/opentele…
bachittle Jan 4, 2023
62db735
Merge branch 'main' into cmake_win_fix
lalitb Jan 30, 2023
9cfdac7
Merge branch 'main' into cmake_win_fix
lalitb Jan 31, 2023
2839764
Merge branch 'main' into cmake_win_fix
ThomsonTan Feb 4, 2023
cbbd449
better inclusion of VCPKG_ROOT
bachittle Feb 6, 2023
f7de82c
fixed cmake formatting
bachittle Feb 6, 2023
531f726
Merge branch 'main' into cmake_win_fix
ThomsonTan Feb 6, 2023
8e62fe0
actually fix cmake format (ran the command)
bachittle Feb 6, 2023
f931327
Merge branch 'main' into cmake_win_fix
ThomsonTan Feb 9, 2023
57a0975
Merge branch 'main' into cmake_win_fix
ThomsonTan Feb 10, 2023
7b954d0
Merge branch 'main' into cmake_win_fix
ThomsonTan Feb 11, 2023
a2f4462
Merge branch 'main' into cmake_win_fix
ThomsonTan Feb 18, 2023
0a17a07
Merge branch 'main' into cmake_win_fix
bachittle Feb 27, 2023
596c2b8
Merge branch 'main' into cmake_win_fix
ThomsonTan Mar 9, 2023
2bd872b
trying to include CMAKE_TOOLCHAIN_FILE, still fails...
bachittle Mar 10, 2023
cb439ce
fix cmake format
bachittle May 23, 2023
f6375fb
Merge branch 'main' into cmake_win_fix
ThomsonTan May 23, 2023
7349c5b
Merge branch 'main' into cmake_win_fix
marcalff May 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,14 @@ function(install_windows_deps)
set(ENV{ARCH} ${ARCH})
execute_process(
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/setup-buildtools.cmd)
set(CMAKE_TOOLCHAIN_FILE
# set(CMAKE_TOOLCHAIN_FILE
# ${CMAKE_CURRENT_SOURCE_DIR}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
# PARENT_SCOPE)
include(
${CMAKE_CURRENT_SOURCE_DIR}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
PARENT_SCOPE)
PARENT_SCOPE
)

endfunction()

if(WITH_JAEGER)
Expand Down Expand Up @@ -467,7 +472,7 @@ if(BUILD_TESTING)
${CMAKE_BINARY_DIR}/lib/libgmock.a)
elseif(WIN32)
# Make sure we are always bootsrapped with vcpkg on Windows
find_package(GTest REQUIRED)
find_package(GTest)
if(NOT (GTEST_FOUND OR GTest_FOUND))
install_windows_deps()
find_package(GTest REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion test_common/src/http/client/nosend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if(${BUILD_TESTING})
endif()

target_link_libraries(
opentelemetry_http_client_nosend ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIB}
opentelemetry_http_client_nosend ${GTEST_BOTH_LIBRARIES}
owent marked this conversation as resolved.
Show resolved Hide resolved
opentelemetry_ext opentelemetry_test_common)

endif()
1 change: 1 addition & 0 deletions tools/setup-buildtools.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ if %ERRORLEVEL% == 1 (
popd
) else (
echo Using existing vcpkg installation...
set "VCPKG_ROOT=%~dp0\vcpkg"
ThomsonTan marked this conversation as resolved.
Show resolved Hide resolved
)

REM Install dependencies
Expand Down