Jelajahi Sumber

Update xrepo-cmake config-files related comments.

Chen Yufei 3 tahun lalu
induk
melakukan
21935bf18b
2 mengubah file dengan 5 tambahan dan 3 penghapusan
  1. 1 0
      package/remote_package.md
  2. 4 3
      zh-cn/package/remote_package.md

+ 1 - 0
package/remote_package.md

@@ -1680,6 +1680,7 @@ xrepo_package("gflags 2.2.2" CONFIGS "shared=true,mt=true")
 # `xrepo_package` add gflags install directory to CMAKE_PREFIX_PATH.
 # As gflags provides cmake config-files, we can now call `find_package` to find
 # gflags package.
+# Refer to https://cmake.org/cmake/help/latest/command/find_package.html#search-modes
 find_package(gflags CONFIG COMPONENTS shared)
 
 add_executable(example-bin "")

+ 4 - 3
zh-cn/package/remote_package.md

@@ -1635,9 +1635,10 @@ xrepo_target_packages(example-bin gflags)
 ```cmake
 xrepo_package("gflags 2.2.2" CONFIGS "shared=true,mt=true")
 
-# `xrepo_package` sets `gflags_DIR` variable in parent scope because gflags
-# provides cmake modules. So we can now call `find_package` to find gflags
-# package.
+# `xrepo_package` 会将 gflags 安装目录添加到 CMAKE_PREFIX_PATH.
+# `find_package(gflags)` 会从 CMAKE_PREFIX_PATH 包含的目录中找到 gflags 提供的
+# config-file 文件。
+# 参考 https://cmake.org/cmake/help/latest/command/find_package.html#search-modes
 find_package(gflags CONFIG COMPONENTS shared)
 
 add_executable(example-bin "")