From 8411df715cf522606e3b1aca386ddfc0b63d34b4 Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Sun, 11 Nov 2018 20:44:23 +0000 Subject: [PATCH] Update CMake and Bazel examples --- index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 1192603..bfccd82 100644 --- a/index.html +++ b/index.html @@ -114,7 +114,7 @@ such as pkg-conf You can either require an external installation of the gflags package and find it using CMake's find_package command, or include the gflags project as subtree or submodule within your project's source tree and add the directory using CMake's add_subdirectory command. - +

To use an external gflags installation, add the following CMake code to your CMakeLists.txt file.

Find gflags installation. The gflags_DIR variable must be set to the <prefix>/lib/cmake/gflags directory @@ -143,7 +143,7 @@ any installation of the gflags subproject products.

imported gflags library target:

    add_executable(foo main.cc)
-   target_link_libraries(foo gflags)
+   target_link_libraries(foo gflags::gflags)
 

Declare dependency on gflags with Bazel

@@ -154,15 +154,15 @@ add the following lines to your WORKSPACE file
 git_repository(
-    name   = "com_github_gflags_gflags",
-    commit = "<INSERT COMMIT SHA HERE>",
+    name = "com_github_gflags_gflags",
     remote = "https://github.com/gflags/gflags.git",
+    tags = "v2.2.2"
 )
 

You can then add @com_github_gflags_gflags//:gflags to the deps section of a cc_binary or cc_library rule, and #include "gflags/gflags.h" to -include it in your source code. This use the shared gflags library with multi-threading enabled. +include it in your source code. This uses the shared gflags library with multi-threading enabled. In order to use the single-threaded shared gflags library, use the dependency @com_github_gflags_gflags//:gflags_nothreads instead.