FindGTest imported target broken with 3.19.0
find_package(GTest)
results in failure:
-- Found GTest: optimized;D:/vcpkg/installed/x64-windows/lib/gtest.lib;debug;D:/vcpkg/installed/x64-windows/debug/lib/gtestd.lib
CMake Error at D:/vcpkg/scripts/buildsystems/vcpkg.cmake:480 (_add_library):
_add_library called with IMPORTED argument but no library type.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:233 (add_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:235 (set_target_properties):
set_target_properties Can not find target to add properties to:
GTest::GTest
Call Stack (most recent call first):
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:243 (set_target_properties):
set_target_properties Can not find target to add properties to:
GTest::GTest
Call Stack (most recent call first):
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:155 (set_property):
set_property could not find TARGET GTest::GTest. Perhaps it has not yet
been created.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:247 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:158 (set_target_properties):
set_target_properties Can not find target to add properties to:
GTest::GTest
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:247 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:164 (set_target_properties):
set_target_properties Can not find target to add properties to:
GTest::GTest
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:247 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:155 (set_property):
set_property could not find TARGET GTest::GTest. Perhaps it has not yet
been created.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:248 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:158 (set_target_properties):
set_target_properties Can not find target to add properties to:
GTest::GTest
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:248 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:164 (set_target_properties):
set_target_properties Can not find target to add properties to:
GTest::GTest
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:248 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at D:/vcpkg/scripts/buildsystems/vcpkg.cmake:480 (_add_library):
_add_library called with IMPORTED argument but no library type.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:252 (add_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:253 (set_target_properties):
set_target_properties Can not find target to add properties to: GTest::Main
Call Stack (most recent call first):
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:155 (set_property):
set_property could not find TARGET GTest::Main. Perhaps it has not yet
been created.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:256 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:158 (set_target_properties):
set_target_properties Can not find target to add properties to: GTest::Main
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:256 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:164 (set_target_properties):
set_target_properties Can not find target to add properties to: GTest::Main
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:256 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:155 (set_property):
set_property could not find TARGET GTest::Main. Perhaps it has not yet
been created.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:257 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:158 (set_target_properties):
set_target_properties Can not find target to add properties to: GTest::Main
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:257 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:164 (set_target_properties):
set_target_properties Can not find target to add properties to: GTest::Main
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindGTest.cmake:257 (__gtest_import_library)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package)
cmake/GTest.cmake:46 (find_package)
CMakeLists.txt:91 (include)
Looking at FindGTest.cmake:
__gtest_determine_library_type(GTEST_LIBRARY)
add_library(GTest::gtest ${GTEST_LIBRARY_TYPE} IMPORTED)
It looks like it's probably the first line there that's the problem; I assume it should be GTEST_LIBRARY_TYPE
and not GTEST_LIBRARY
?