浏览代码

Improve error message when googletest is missing.

Feng Xiao 7 年之前
父节点
当前提交
8f88a507ee
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      cmake/tests.cmake

+ 6 - 1
cmake/tests.cmake

@@ -1,5 +1,10 @@
 if (NOT EXISTS "${PROJECT_SOURCE_DIR}/../third_party/googletest/CMakeLists.txt")
-  message(FATAL_ERROR "Cannot find third_party/googletest directory.")
+  message(FATAL_ERROR
+          "Cannot find third_party/googletest directory that's needed to "
+          "build tests. If you use git, make sure you have cloned submodules:\n"
+          "  git submodule update --init --recursive\n"
+          "If instead you want to skip tests, run cmake with:\n"
+          "  cmake -Dprotobuf_BUILD_TESTS=OFF\n")
 endif()
 
 option(protobuf_ABSOLUTE_TEST_PLUGIN_PATH