No official binary distribution packages are provided by the gflags developers.
No official binary distribution packages are provided by the gflags developers.
There may, however, be binary packages available for your OS. Please consult
There may, however, be binary packages available for your operating system.
also the package repositories of your Linux distribution.
Please consult also the package repositories of your Linux distribution.
For example on Debian/Ubuntu Linux, gflags can be installed using the
On Debian/Ubuntu Linux, gflags can be installed using the following command:
following command:
sudo apt-get install libgflags-dev
sudo apt-get install libgflags-dev
Compiling the source code with vcpkg
On macOS, [Homebrew](https://brew.sh/) includes a formula for gflags:
=========================
brew install gflags
# Compiling the source code with Bazel
To use gflags in a [Bazel](http://bazel.io) project, map it in as an external
dependency by editing your WORKSPACE file:
git_repository(
name = "com_github_gflags_gflags",
commit = "<INSERT COMMIT SHA HERE>",
remote = "https://github.com/gflags/gflags.git",
)
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.
# Compiling the source code with vcpkg
You can download and install gflags using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
You can download and install gflags using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
...
@@ -23,8 +41,8 @@ You can download and install gflags using the [vcpkg](https://github.com/Microso
...
@@ -23,8 +41,8 @@ You can download and install gflags using the [vcpkg](https://github.com/Microso
The gflags port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
The gflags port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
Compiling the source code with CMake
=========================
# Compiling the source code with CMake
The build system of gflags is since version 2.1 based on [CMake](http://cmake.org).
The build system of gflags is since version 2.1 based on [CMake](http://cmake.org).
The common steps to build, test, and install software are therefore:
The common steps to build, test, and install software are therefore:
...
@@ -77,19 +95,3 @@ GFLAGS_INTTYPES_FORMAT | String identifying format of built-in integer type
...
@@ -77,19 +95,3 @@ GFLAGS_INTTYPES_FORMAT | String identifying format of built-in integer type
GFLAGS_INCLUDE_DIR | Name of headers installation directory relative to CMAKE_INSTALL_PREFIX.
GFLAGS_INCLUDE_DIR | Name of headers installation directory relative to CMAKE_INSTALL_PREFIX.
LIBRARY_INSTALL_DIR | Name of library installation directory relative to CMAKE_INSTALL_PREFIX.
LIBRARY_INSTALL_DIR | Name of library installation directory relative to CMAKE_INSTALL_PREFIX.
INSTALL_HEADERS | Request installation of public header files.
INSTALL_HEADERS | Request installation of public header files.
Using gflags with [Bazel](http://bazel.io)
=========================
To use gflags in a Bazel project, map it in as an external dependency by editing
your WORKSPACE file:
git_repository(
name = "com_github_gflags_gflags",
commit = "<INSERT COMMIT SHA HERE>",
remote = "https://github.com/gflags/gflags.git",
)
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