kou commented on PR #13101: URL: https://github.com/apache/arrow/pull/13101#issuecomment-1121531412
It seems that the gtest package for Windows doesn't include CMake package files: * https://anaconda.org/conda-forge/gtest * https://github.com/conda-forge/gtest-feedstock/blob/main/recipe/bld.bat It seems that `FindGTest.cmake` https://cmake.org/cmake/help/latest/module/FindGTest.html bundled in CMake 3.23 or later fits our use case: * It uses `GTestConfig.cmake` provided by Google Test if possible * It defines not only `GTest::gtest` and `GTets::gtest_main` but also `GTest::gmock` How about trying it? ```diff diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 865406e705..7dfe388bb7 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -1969,11 +1969,16 @@ macro(build_gtest) endmacro() if(ARROW_TESTING) + if(CMAKE_VERSION VERSION_LESS 3.23) + set(GTEST_USE_CONFIG FALSE) + else() + set(GTEST_USE_CONFIG TRUE) + endif() resolve_dependency(GTest REQUIRED_VERSION 1.10.0 USE_CONFIG - TRUE) + ${GTEST_USE_CONFIG}) if(NOT GTEST_VENDORED) # TODO(wesm): This logic does not work correctly with the MSVC static libraries ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
