Project import
diff --git a/google-gflags/AUTHORS.txt b/google-gflags/AUTHORS.txt
new file mode 100644
index 0000000..887918b
--- /dev/null
+++ b/google-gflags/AUTHORS.txt
@@ -0,0 +1,2 @@
+google-gflags@googlegroups.com
+
diff --git a/google-gflags/Android.mk b/google-gflags/Android.mk
new file mode 100644
index 0000000..d3f7bb1
--- /dev/null
+++ b/google-gflags/Android.mk
@@ -0,0 +1,99 @@
+LOCAL_PATH := $(my-dir)
+
+###
+### If you add to these, be sure to unset them at the end
+###
+GOOGLE_GFLAGS_TEST_INSTALL_ROOT         := $(TARGET_OUT_DATA_NATIVE_TESTS)/google-gflags
+GOOGLE_GFLAGS_COMMON                    := $(LOCAL_PATH)/android/build/google-gflags-common.mk
+GOOGLE_GFLAGS_TEST_MODULES              :=
+BUILD_GOOGLE_GFLAGS_TEST_EXECUTABLE     := $(LOCAL_PATH)/android/build/google-gflags-build-test-executable.mk
+INSTALL_GOOGLE_GFLAGS_TEST_DATA         := $(LOCAL_PATH)/android/build/google-gflags-install-test-data.mk
+
+include $(CLEAR_VARS)
+include $(GOOGLE_GFLAGS_COMMON)
+LOCAL_MODULE := libgflags
+LOCAL_SRC_FILES := \
+	src/gflags.cc \
+	src/gflags_reporting.cc \
+	src/gflags_completions.cc
+include $(BUILD_SHARED_LIBRARY)
+
+###
+### UNIT TESTS
+###
+### The main unit test runner is gflags-unit-tests.sh, which is a
+### translation of the tests defined in test/CMakeLists.txt .
+### The rest are supporting binaries used for implementing
+### the tests.
+###
+### Note: gflags does not use gtest
+###
+
+include $(CLEAR_VARS)
+include $(GOOGLE_GFLAGS_COMMON)
+LOCAL_MODULE := gflags_strip_flags_test
+LOCAL_SRC_FILES := test/gflags_strip_flags_test.cc
+include $(BUILD_GOOGLE_GFLAGS_TEST_EXECUTABLE)
+
+include $(CLEAR_VARS)
+include $(GOOGLE_GFLAGS_COMMON)
+LOCAL_MODULE := gflags_unittest
+LOCAL_CPPFLAGS += -Wno-unused-parameter
+LOCAL_SRC_FILES := test/gflags_unittest.cc
+include $(BUILD_GOOGLE_GFLAGS_TEST_EXECUTABLE)
+
+include $(CLEAR_VARS)
+include $(GOOGLE_GFLAGS_COMMON)
+LOCAL_MODULE := gflags_unittest-main
+LOCAL_CFLAGS += -Wno-unused-parameter
+LOCAL_SRC_FILES := test/gflags_unittest-main.cc
+include $(BUILD_GOOGLE_GFLAGS_TEST_EXECUTABLE)
+
+include $(CLEAR_VARS)
+include $(GOOGLE_GFLAGS_COMMON)
+LOCAL_MODULE := gflags_unittest_main
+LOCAL_CPPFLAGS += -Wno-unused-parameter
+LOCAL_SRC_FILES := test/gflags_unittest_main.cc
+include $(BUILD_GOOGLE_GFLAGS_TEST_EXECUTABLE)
+
+include $(CLEAR_VARS)
+include $(GOOGLE_GFLAGS_COMMON)
+LOCAL_MODULE := gflags_declare_test
+LOCAL_SRC_FILES := test/gflags_declare_test.cc \
+	test/gflags_declare_flags.cc
+include $(BUILD_GOOGLE_GFLAGS_TEST_EXECUTABLE)
+
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := flagfile.1
+LOCAL_SRC_FILES := test/flagfile.1
+include $(INSTALL_GOOGLE_GFLAGS_TEST_DATA)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := flagfile.2
+LOCAL_SRC_FILES := test/flagfile.2
+include $(INSTALL_GOOGLE_GFLAGS_TEST_DATA)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := flagfile.3
+LOCAL_SRC_FILES := test/flagfile.3
+include $(INSTALL_GOOGLE_GFLAGS_TEST_DATA)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := gflags-unit-tests.sh
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_SRC_FILES := android/test/gflags-unit-tests.sh
+LOCAL_MODULE_PATH := $(GOOGLE_GFLAGS_TEST_INSTALL_ROOT)
+LOCAL_REQUIRED_MODULES := $(GOOGLE_GFLAGS_TEST_MODULES) \
+	grep
+LOCAL_MODULE_TAGS := tests
+include $(BUILD_PREBUILT)
+
+###
+### Clean the environment. The EPA loves us.
+###
+GOOGLE_GFLAGS_TEST_INSTALL_ROOT         :=
+GOOGLE_GFLAGS_COMMON                    :=
+GOOGLE_GFLAGS_TEST_MODULES              :=
+BUILD_GOOGLE_GFLAGS_TEST_EXECUTABLE     :=
+INSTALL_GOOGLE_GFLAGS_TEST_DATA         :=
diff --git a/google-gflags/CMakeLists.txt b/google-gflags/CMakeLists.txt
new file mode 100644
index 0000000..54b5c35
--- /dev/null
+++ b/google-gflags/CMakeLists.txt
@@ -0,0 +1,506 @@
+cmake_minimum_required (VERSION 2.8.4 FATAL_ERROR)
+
+if (POLICY CMP0042)
+  cmake_policy (SET CMP0042 NEW)
+endif ()
+
+# ----------------------------------------------------------------------------
+# includes
+set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+include (utils)
+
+# ----------------------------------------------------------------------------
+# package information
+set (PACKAGE_NAME      "gflags")
+set (PACKAGE_VERSION   "2.1.2")
+set (PACKAGE_STRING    "${PACKAGE_NAME} ${PACKAGE_VERSION}")
+set (PACKAGE_TARNAME   "${PACKAGE_NAME}-${PACKAGE_VERSION}")
+set (PACKAGE_BUGREPORT "https://github.com/schuhschuh/gflags/issues")
+
+project (${PACKAGE_NAME} CXX)
+if (CMAKE_VERSION VERSION_LESS 100)
+  # C language still needed because the following required CMake modules
+  # (or their dependencies, respectively) are not correctly handling
+  # the case where only CXX is enabled.
+  # - CheckTypeSize.cmake (fixed in CMake 3.1, cf. http://www.cmake.org/Bug/view.php?id=14056)
+  # - FindThreads.cmake (--> CheckIncludeFiles.cmake <--)
+  enable_language (C)
+endif ()
+
+version_numbers (
+  ${PACKAGE_VERSION}
+    PACKAGE_VERSION_MAJOR
+    PACKAGE_VERSION_MINOR
+    PACKAGE_VERSION_PATCH
+)
+
+set (PACKAGE_SOVERSION "${PACKAGE_VERSION_MAJOR}")
+
+# ----------------------------------------------------------------------------
+# options
+if (NOT GFLAGS_NAMESPACE)
+  # maintain binary backwards compatibility with gflags library version <= 2.0,
+  # but at the same time enable the use of the preferred new "gflags" namespace
+  set (GFLAGS_NAMESPACE "google;${PACKAGE_NAME}" CACHE STRING "Name(s) of library namespace (separate multiple options by semicolon)")
+  mark_as_advanced (GFLAGS_NAMESPACE)
+endif ()
+set (GFLAGS_NAMESPACE_SECONDARY "${GFLAGS_NAMESPACE}")
+list (REMOVE_DUPLICATES GFLAGS_NAMESPACE_SECONDARY)
+if (NOT GFLAGS_NAMESPACE_SECONDARY)
+  message (FATAL_ERROR "GFLAGS_NAMESPACE must be set to one (or more) valid C++ namespace identifier(s separated by semicolon \";\").")
+endif ()
+foreach (ns IN LISTS GFLAGS_NAMESPACE_SECONDARY)
+  if (NOT ns MATCHES "^[a-zA-Z][a-zA-Z0-9_]*$")
+    message (FATAL_ERROR "GFLAGS_NAMESPACE contains invalid namespace identifier: ${ns}")
+  endif ()
+endforeach ()
+list (GET       GFLAGS_NAMESPACE_SECONDARY 0 GFLAGS_NAMESPACE)
+list (REMOVE_AT GFLAGS_NAMESPACE_SECONDARY 0)
+
+option (BUILD_SHARED_LIBS          "Request build of shared libraries."                                       OFF)
+option (BUILD_STATIC_LIBS          "Request build of static libraries (default if BUILD_SHARED_LIBS is OFF)." OFF)
+option (BUILD_gflags_LIB           "Request build of the multi-threaded gflags library."                      ON)
+option (BUILD_gflags_nothreads_LIB "Request build of the single-threaded gflags library."                     ON)
+option (BUILD_PACKAGING            "Enable build of distribution packages using CPack."                       OFF)
+option (BUILD_TESTING              "Enable build of the unit tests and their execution using CTest."          OFF)
+option (BUILD_NC_TESTS             "Request addition of negative compilation tests."                          OFF)
+option (INSTALL_HEADERS            "Request packaging of headers and other development files."                ON)
+
+mark_as_advanced (CLEAR CMAKE_INSTALL_PREFIX)
+mark_as_advanced (CMAKE_CONFIGURATION_TYPES
+                  BUILD_STATIC_LIBS
+                  BUILD_NC_TESTS
+                  INSTALL_HEADERS)
+if (APPLE)
+  mark_as_advanced(CMAKE_OSX_ARCHITECTURES
+                   CMAKE_OSX_DEPLOYMENT_TARGET
+                   CMAKE_OSX_SYSROOT)
+endif ()
+
+if (NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS)
+  set (BUILD_STATIC_LIBS ON)
+endif ()
+if (NOT BUILD_gflags_LIB AND NOT BUILD_gflags_nothreads_LIB)
+ message (FATAL_ERROR "At least one of BUILD_gflags_LIB and BUILD_gflags_nothreads_LIB must be ON.")
+endif ()
+
+if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
+  set_property (CACHE CMAKE_BUILD_TYPE PROPERTY VALUE Release)
+endif ()
+
+if (NOT GFLAGS_INCLUDE_DIR)
+  set (GFLAGS_INCLUDE_DIR "${PACKAGE_NAME}" CACHE STRING "Name of include directory of installed header files")
+  mark_as_advanced (GFLAGS_INCLUDE_DIR)
+else ()
+  if (IS_ABSOLUTE GFLAGS_INCLUDE_DIR)
+    message (FATAL_ERROR "GFLAGS_INCLUDE_DIR must be a path relative to CMAKE_INSTALL_PREFIX/include")
+  endif ()
+  if (GFLAGS_INCLUDE_DIR MATCHES "^\\.\\.[/\\]")
+    message (FATAL_ERROR "GFLAGS_INCLUDE_DIR must not start with parent directory reference (../)")
+  endif ()
+endif ()
+
+# ----------------------------------------------------------------------------
+# system checks
+include (CheckTypeSize)
+include (CheckIncludeFileCXX)
+include (CheckCXXSymbolExists)
+
+if (WIN32 AND NOT CYGWIN)
+  set (OS_WINDOWS 1)
+else ()
+  set (OS_WINDOWS 0)
+endif ()
+
+if (MSVC)
+  set (HAVE_SYS_TYPES_H 1)
+  set (HAVE_STDINT_H    1)
+  set (HAVE_STDDEF_H    1) # used by CheckTypeSize module
+  set (HAVE_INTTYPES_H  0)
+  set (HAVE_UNISTD_H    0)
+  set (HAVE_SYS_STAT_H  1)
+  set (HAVE_SHLWAPI_H   1)
+else ()
+  foreach (fname IN ITEMS unistd stdint inttypes sys/types sys/stat fnmatch)
+    string (TOUPPER "${fname}" FNAME)
+    string (REPLACE "/" "_" FNAME "${FNAME}")
+    if (NOT HAVE_${FNAME}_H)
+      check_include_file_cxx ("${fname}.h" HAVE_${FNAME}_H)
+    endif ()
+  endforeach ()
+  # the following are used in #if directives not #ifdef
+  bool_to_int (HAVE_STDINT_H)
+  bool_to_int (HAVE_SYS_TYPES_H)
+  bool_to_int (HAVE_INTTYPES_H)
+  if (NOT HAVE_FNMATCH_H AND OS_WINDOWS)
+    check_include_file_cxx ("shlwapi.h" HAVE_SHLWAPI_H)
+  endif ()
+endif ()
+
+set (GFLAGS_INTTYPES_FORMAT "" CACHE STRING "Format of integer types: \"C99\" (uint32_t), \"BSD\" (u_int32_t), \"VC7\" (__int32)")
+set_property (CACHE GFLAGS_INTTYPES_FORMAT PROPERTY STRINGS "C99;BSD;VC7")
+mark_as_advanced (GFLAGS_INTTYPES_FORMAT)
+if (NOT GFLAGS_INTTYPES_FORMAT)
+  set (TYPES uint32_t u_int32_t)
+  if (MSVC)
+    list (INSERT TYPES 0 __int32)
+  endif ()
+  foreach (type IN LISTS TYPES)
+    check_type_size (${type} ${type} LANGUAGE CXX)
+    if (HAVE_${type})
+      break ()
+    endif ()
+  endforeach ()
+  if (HAVE_uint32_t)
+    set_property (CACHE GFLAGS_INTTYPES_FORMAT PROPERTY VALUE C99)
+  elseif (HAVE_u_int32_t)
+    set_property (CACHE GFLAGS_INTTYPES_FORMAT PROPERTY VALUE BSD)
+  elseif (HAVE___int32)
+    set_property (CACHE GFLAGS_INTTYPES_FORMAT PROPERTY VALUE VC7)
+  else ()
+    mark_as_advanced (CLEAR GFLAGS_INTTYPES_FORMAT)
+    message (FATAL_ERROR "Do not know how to define a 32-bit integer quantity on your system!"
+                         " Neither uint32_t, u_int32_t, nor __int32 seem to be available."
+                         " Set GFLAGS_INTTYPES_FORMAT to either C99, BSD, or VC7 and try again.")
+  endif ()
+endif ()
+# use of special characters in strings to circumvent bug #0008226
+if ("^${GFLAGS_INTTYPES_FORMAT}$" STREQUAL "^WIN$")
+  set_property (CACHE GFLAGS_INTTYPES_FORMAT PROPERTY VALUE VC7)
+endif ()
+if (NOT GFLAGS_INTTYPES_FORMAT MATCHES "^(C99|BSD|VC7)$")
+  message (FATAL_ERROR "Invalid value for GFLAGS_INTTYPES_FORMAT! Choose one of \"C99\", \"BSD\", or \"VC7\"")
+endif ()
+set (GFLAGS_INTTYPES_FORMAT_C99 0)
+set (GFLAGS_INTTYPES_FORMAT_BSD 0)
+set (GFLAGS_INTTYPES_FORMAT_VC7 0)
+set ("GFLAGS_INTTYPES_FORMAT_${GFLAGS_INTTYPES_FORMAT}" 1)
+
+if (MSVC)
+  set (HAVE_strtoll 0)
+  set (HAVE_strtoq  0)
+else ()
+  check_cxx_symbol_exists (strtoll stdlib.h HAVE_STRTOLL)
+  if (NOT HAVE_STRTOLL)
+    check_cxx_symbol_exists (strtoq stdlib.h HAVE_STRTOQ)
+  endif ()
+endif ()
+
+set (CMAKE_THREAD_PREFER_PTHREAD TRUE)
+find_package (Threads)
+if (Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
+  set (HAVE_PTHREAD 1)
+  check_type_size (pthread_rwlock_t RWLOCK LANGUAGE CXX)
+else ()
+  set (HAVE_PTHREAD 0)
+endif ()
+
+if (UNIX AND NOT HAVE_PTHREAD AND BUILD_gflags_LIB)
+  if (CMAKE_HAVE_PTHREAD_H)
+    set (what "library")
+  else ()
+    set (what ".h file")
+  endif ()
+  message (FATAL_ERROR "Could not find pthread${what}. Check the log file"
+                       "\n\t${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
+                       "\nor disable the build of the multi-threaded gflags library (BUILD_gflags_LIB=OFF).")
+endif ()
+
+# ----------------------------------------------------------------------------
+# source files - excluding root subdirectory and/or .in suffix
+set (PUBLIC_HDRS
+  "gflags.h"
+  "gflags_declare.h"
+  "gflags_completions.h"
+)
+
+if (GFLAGS_NAMESPACE_SECONDARY)
+  set (INCLUDE_GFLAGS_NS_H "// Import gflags library symbols into alternative/deprecated namespace(s)")
+  foreach (ns IN LISTS GFLAGS_NAMESPACE_SECONDARY)
+    string (TOUPPER "${ns}" NS)
+    set (gflags_ns_h "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/gflags_${ns}.h")
+    configure_file ("${PROJECT_SOURCE_DIR}/src/gflags_ns.h.in" "${gflags_ns_h}" @ONLY)
+    list (APPEND PUBLIC_HDRS "${gflags_ns_h}")
+    set (INCLUDE_GFLAGS_NS_H "${INCLUDE_GFLAGS_NS_H}\n#include \"gflags_${ns}.h\"")
+  endforeach ()
+else ()
+  set (INCLUDE_GFLAGS_NS_H)
+endif ()
+
+set (PRIVATE_HDRS
+  "config.h"
+  "util.h"
+  "mutex.h"
+)
+
+set (GFLAGS_SRCS
+  "gflags.cc"
+  "gflags_reporting.cc"
+  "gflags_completions.cc"
+)
+
+if (OS_WINDOWS)
+  list (APPEND PRIVATE_HDRS "windows_port.h")
+  list (APPEND GFLAGS_SRCS  "windows_port.cc")
+endif ()
+
+# ----------------------------------------------------------------------------
+# configure source files
+if (CMAKE_COMPILER_IS_GNUCXX)
+  set (GFLAGS_ATTRIBUTE_UNUSED "__attribute((unused))")
+else ()
+  set (GFLAGS_ATTRIBUTE_UNUSED)
+endif ()
+
+# whenever we build a shared library (DLL on Windows), configure the public
+# headers of the API for use of this library rather than the optionally
+# also build statically linked library; users can override GFLAGS_DLL_DECL
+if (BUILD_SHARED_LIBS)
+  set (GFLAGS_IS_A_DLL 1)
+else ()
+  set (GFLAGS_IS_A_DLL 0)
+endif ()
+
+configure_headers (PUBLIC_HDRS  ${PUBLIC_HDRS})
+configure_sources (PRIVATE_HDRS ${PRIVATE_HDRS})
+configure_sources (GFLAGS_SRCS  ${GFLAGS_SRCS})
+
+include_directories ("${PROJECT_SOURCE_DIR}/src")
+include_directories ("${PROJECT_BINARY_DIR}/include")
+include_directories ("${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}")
+
+# ----------------------------------------------------------------------------
+# output directories
+set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin")
+set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib")
+set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "lib")
+
+# ----------------------------------------------------------------------------
+# add library targets
+set (TARGETS)
+# static vs. shared
+foreach (TYPE IN ITEMS STATIC SHARED)
+  if (BUILD_${TYPE}_LIBS)
+    # whether or not targets are a DLL
+    if (OS_WINDOWS AND "^${TYPE}$" STREQUAL "^SHARED$")
+      set (GFLAGS_IS_A_DLL 1)
+    else ()
+      set (GFLAGS_IS_A_DLL 0)
+    endif ()
+    string (TOLOWER "${TYPE}" type)
+    # multi-threaded vs. single-threaded
+    foreach (opts IN ITEMS "" _nothreads)
+      if (BUILD_gflags${opts}_LIB)
+        add_library (gflags${opts}-${type} ${TYPE} ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
+        if (opts MATCHES "nothreads")
+          set (defines "GFLAGS_IS_A_DLL=${GFLAGS_IS_A_DLL};NOTHREADS")
+        else ()
+          set (defines "GFLAGS_IS_A_DLL=${GFLAGS_IS_A_DLL}")
+          if (CMAKE_USE_PTHREADS_INIT)
+            target_link_libraries (gflags${opts}-${type} ${CMAKE_THREAD_LIBS_INIT})
+          endif ()
+        endif ()
+        set_target_properties (
+          gflags${opts}-${type} PROPERTIES COMPILE_DEFINITIONS "${defines}"
+                                           OUTPUT_NAME         "gflags${opts}"
+                                           VERSION             "${PACKAGE_VERSION}"
+                                           SOVERSION           "${PACKAGE_SOVERSION}"
+        )
+        if (HAVE_SHLWAPI_H)
+          target_link_libraries (gflags${opts}-${type} shlwapi.lib)
+        endif ()
+        if (NOT TARGET gflags${opts})
+          add_custom_target (gflags${opts})
+        endif ()
+        add_dependencies (gflags${opts} gflags${opts}-${type})
+        list (APPEND TARGETS gflags${opts}-${type})
+      endif ()
+    endforeach ()
+  endif ()
+endforeach ()
+
+# ----------------------------------------------------------------------------
+# installation
+if (OS_WINDOWS)
+  set (RUNTIME_INSTALL_DIR Bin)
+  set (LIBRARY_INSTALL_DIR Lib)
+  set (INCLUDE_INSTALL_DIR Include)
+  set (CONFIG_INSTALL_DIR  CMake)
+else ()
+  set (RUNTIME_INSTALL_DIR bin)
+  # The LIB_INSTALL_DIR and LIB_SUFFIX variables are used by the Fedora
+  # package maintainers. Also package maintainers of other distribution
+  # packages need to be able to specify the name of the library directory.
+  if (NOT LIB_INSTALL_DIR)
+    set (LIB_INSTALL_DIR "lib${LIB_SUFFIX}")
+  endif ()
+  set (LIBRARY_INSTALL_DIR "${LIB_INSTALL_DIR}"
+    CACHE PATH "Directory of installed libraries, e.g., \"lib64\""
+  )
+  mark_as_advanced (LIBRARY_INSTALL_DIR)
+  set (INCLUDE_INSTALL_DIR include)
+  set (CONFIG_INSTALL_DIR  ${LIBRARY_INSTALL_DIR}/cmake/${PACKAGE_NAME})
+endif ()
+
+file (RELATIVE_PATH INSTALL_PREFIX_REL2CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/${CONFIG_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}")
+configure_file (cmake/config.cmake.in  "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-install.cmake" @ONLY)
+configure_file (cmake/version.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake" @ONLY)
+
+install (TARGETS ${TARGETS} DESTINATION ${LIBRARY_INSTALL_DIR} EXPORT gflags-lib)
+if (INSTALL_HEADERS)
+  install (FILES ${PUBLIC_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/${GFLAGS_INCLUDE_DIR})
+  install (
+    FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-install.cmake"
+    RENAME ${PACKAGE_NAME}-config.cmake
+    DESTINATION ${CONFIG_INSTALL_DIR}
+  )
+  install (
+    FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake"
+    DESTINATION ${CONFIG_INSTALL_DIR}
+  )
+  install (EXPORT gflags-lib DESTINATION ${CONFIG_INSTALL_DIR} FILE ${PACKAGE_NAME}-export.cmake)
+  if (UNIX)
+    install (PROGRAMS src/gflags_completions.sh DESTINATION ${RUNTIME_INSTALL_DIR})
+  endif ()
+endif ()
+
+# ----------------------------------------------------------------------------
+# support direct use of build tree
+set (INSTALL_PREFIX_REL2CONFIG_DIR .)
+export (TARGETS ${TARGETS} FILE "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-export.cmake")
+export (PACKAGE gflags)
+configure_file (cmake/config.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake" @ONLY)
+
+# ----------------------------------------------------------------------------
+# testing - MUST follow the generation of the build tree config file
+if (BUILD_TESTING)
+  include (CTest)
+  enable_testing ()
+  add_subdirectory (test)
+endif ()
+
+# ----------------------------------------------------------------------------
+# packaging
+if (BUILD_PACKAGING)
+
+  if (NOT BUILD_SHARED_LIBS AND NOT INSTALL_HEADERS)
+    message (WARNING "Package will contain static libraries without headers!"
+                     "\nRecommended options for generation of runtime package:"
+                     "\n  BUILD_SHARED_LIBS=ON"
+                     "\n  BUILD_STATIC_LIBS=OFF"
+                     "\n  INSTALL_HEADERS=OFF"
+                     "\nRecommended options for generation of development package:"
+                     "\n  BUILD_SHARED_LIBS=ON"
+                     "\n  BUILD_STATIC_LIBS=ON"
+                     "\n  INSTALL_HEADERS=ON")
+  endif ()
+
+  # default package generators
+  if (APPLE)
+    set (PACKAGE_GENERATOR        "PackageMaker")
+    set (PACKAGE_SOURCE_GENERATOR "TGZ;ZIP")
+  elseif (UNIX)
+    set (PACKAGE_GENERATOR        "DEB;RPM")
+    set (PACKAGE_SOURCE_GENERATOR "TGZ;ZIP")
+  else ()
+    set (PACKAGE_GENERATOR        "ZIP")
+    set (PACKAGE_SOURCE_GENERATOR "ZIP")
+  endif ()
+
+  # used package generators
+  set (CPACK_GENERATOR        "${PACKAGE_GENERATOR}"        CACHE STRING "List of binary package generators (CPack).")
+  set (CPACK_SOURCE_GENERATOR "${PACKAGE_SOURCE_GENERATOR}" CACHE STRING "List of source package generators (CPack).")
+  mark_as_advanced (CPACK_GENERATOR CPACK_SOURCE_GENERATOR)
+
+  # some package generators (e.g., PackageMaker) do not allow .md extension
+  configure_file ("${CMAKE_CURRENT_LIST_DIR}/README.md" "${CMAKE_CURRENT_BINARY_DIR}/README.txt" COPYONLY)
+
+  # common package information
+  set (CPACK_PACKAGE_VENDOR              "Andreas Schuh")
+  set (CPACK_PACKAGE_CONTACT             "google-gflags@googlegroups.com")
+  set (CPACK_PACKAGE_NAME                "${PACKAGE_NAME}")
+  set (CPACK_PACKAGE_VERSION             "${PACKAGE_VERSION}")
+  set (CPACK_PACKAGE_VERSION_MAJOR       "${PACKAGE_VERSION_MAJOR}")
+  set (CPACK_PACKAGE_VERSION_MINOR       "${PACKAGE_VERSION_MINOR}")
+  set (CPACK_PACKAGE_VERSION_PATCH       "${PACKAGE_VERSION_PATCH}")
+  set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "A commandline flags library that allows for distributed flags.")
+  set (CPACK_RESOURCE_FILE_WELCOME       "${CMAKE_CURRENT_BINARY_DIR}/README.txt")
+  set (CPACK_RESOURCE_FILE_LICENSE       "${CMAKE_CURRENT_LIST_DIR}/COPYING.txt")
+  set (CPACK_PACKAGE_DESCRIPTION_FILE    "${CMAKE_CURRENT_BINARY_DIR}/README.txt")
+  set (CPACK_INSTALL_PREFIX              "${CMAKE_INSTALL_PREFIX}")
+  set (CPACK_OUTPUT_FILE_PREFIX          packages)
+  set (CPACK_PACKAGE_RELOCATABLE         TRUE)
+  set (CPACK_MONOLITHIC_INSTALL          TRUE)
+
+  # RPM package information -- used in cmake/package.cmake.in also for DEB
+  set (CPACK_RPM_PACKAGE_GROUP   "Development/Libraries")
+  set (CPACK_RPM_PACKAGE_LICENSE "BSD")
+  set (CPACK_RPM_PACKAGE_URL     "http://schuhschuh.github.com/gflags")
+  set (CPACK_RPM_CHANGELOG_FILE  "${CMAKE_CURRENT_LIST_DIR}/ChangeLog.txt")
+
+  if (INSTALL_HEADERS)
+    set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/doc/index.html")
+  else ()
+    set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/cmake/README_runtime.txt")
+  endif ()
+
+  # system/architecture
+  if (WINDOWS)
+    if (CMAKE_CL_64)
+      set (CPACK_SYSTEM_NAME "win64")
+    else ()
+      set (CPACK_SYSTEM_NAME "win32")
+    endif ()
+    set (CPACK_PACKAGE_ARCHITECTURE)
+  elseif (APPLE)
+    set (CPACK_PACKAGE_ARCHITECTURE darwin)
+  else ()
+    string (TOLOWER "${CMAKE_SYSTEM_NAME}" CPACK_SYSTEM_NAME)
+    if (CMAKE_CXX_FLAGS MATCHES "-m32")
+      set (CPACK_PACKAGE_ARCHITECTURE i386)
+    else ()
+      execute_process (
+        COMMAND         dpkg --print-architecture
+        RESULT_VARIABLE RV
+        OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE
+      )
+      if (RV EQUAL 0)
+	      string (STRIP "${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_ARCHITECTURE)
+      else ()
+        execute_process (COMMAND uname -m OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE)
+        if (CPACK_PACKAGE_ARCHITECTURE MATCHES "x86_64")
+	        set (CPACK_PACKAGE_ARCHITECTURE amd64)
+        else ()
+          set (CPACK_PACKAGE_ARCHITECTURE i386)
+        endif ()
+      endif ()
+    endif ()
+  endif ()
+
+  # source package settings
+  set (CPACK_SOURCE_TOPLEVEL_TAG      "source")
+  set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
+  set (CPACK_SOURCE_IGNORE_FILES      "/\\\\.git/;\\\\.swp$;\\\\.#;/#;\\\\.*~;cscope\\\\.*;/[Bb]uild[.+-_a-zA-Z0-9]*/")
+
+  # default binary package settings
+  set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY TRUE)
+  set (CPACK_PACKAGE_FILE_NAME          "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
+  if (CPACK_PACKAGE_ARCHITECTURE)
+    set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CPACK_PACKAGE_ARCHITECTURE}")
+  endif ()
+
+  # generator specific configuration file
+  #
+  # allow package maintainers to use their own configuration file
+  # $ cmake -DCPACK_PROJECT_CONFIG_FILE:FILE=/path/to/package/config
+  if (NOT CPACK_PROJECT_CONFIG_FILE)
+    configure_file (
+      "${CMAKE_CURRENT_LIST_DIR}/cmake/package.cmake.in"
+      "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-package.cmake" @ONLY
+    )
+    set (CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-package.cmake")
+  endif ()
+
+  include (CPack)
+
+endif () # BUILD_PACKAGING
diff --git a/google-gflags/COPYING.txt b/google-gflags/COPYING.txt
new file mode 100644
index 0000000..d15b0c2
--- /dev/null
+++ b/google-gflags/COPYING.txt
@@ -0,0 +1,28 @@
+Copyright (c) 2006, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+    * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/google-gflags/ChangeLog.txt b/google-gflags/ChangeLog.txt
new file mode 100644
index 0000000..eea9f83
--- /dev/null
+++ b/google-gflags/ChangeLog.txt
@@ -0,0 +1,218 @@
+* Tue Mar 24 2014 - Andreas Schuh <andreas.schuh.84@gmail.com>
+
+- gflags: version 2.1.2
+- Moved project to GitHub
+- Added GFLAGS_NAMESPACE definition to gflags_declare.h
+- Fixed issue 94: Keep "google" as primary namespace and import symbols into "gflags" namespace
+- Fixed issue 96: Fix binary ABI compatibility with gflags 2.0 using "google" as primary namespace
+- Fixed issue 97/101: Removed (patched) CMake modules and enabled C language instead
+- Fixed issue 103: Set CMake policy CMP0042 to silence warning regarding MACOS_RPATH setting
+
+* Sun Mar 20 2014 - Andreas Schuh <google-gflags@googlegroups.com>
+
+- gflags: version 2.1.1
+- Fixed issue 77: GFLAGS_IS_A_DLL expands to empty string in gflags_declare.h
+- Fixed issue 79: GFLAGS_NAMESPACE not expanded to actual namespace in gflags_declare.h
+- Fixed issue 80: Allow include path to differ from GFLAGS_NAMESPACE
+
+* Thu Mar 20 2014 - Andreas Schuh <google-gflags@googlegroups.com>
+
+- gflags: version 2.1.0
+- Build system configuration using CMake instead of autotools
+- CPack packaging support for Debian/Ubuntu, Red Hat, and Mac OS X
+- Fixed issue 54: Fix "invalid suffix on literal" (C++11)
+- Fixed issue 57: Use _strdup instead of strdup on Windows
+- Fixed issue 62: Change all preprocessor include guards to start with GFLAGS_
+- Fixed issue 64: Add DEFINE_validator macro
+- Fixed issue 73: Warnings in Visual Studio 2010 and unable to compile unit test
+
+* Wed Jan 25 2012 - Google Inc. <google-gflags@googlegroups.com>
+
+- gflags: version 2.0
+- Changed the 'official' gflags email in setup.py/etc
+- Renamed google-gflags.sln to gflags.sln
+- Changed copyright text to reflect Google's relinquished ownership
+
+* Tue Dec 20 2011 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 1.7
+- Add CommandLineFlagInfo::flag_ptr pointing to current storage (musji)
+- PORTING: flush after writing to stderr, needed on cygwin
+- PORTING: Clean up the GFLAGS_DLL_DECL stuff better
+- Fix a bug in StringPrintf() that affected large strings (csilvers)
+- Die at configure-time when g++ isn't installed
+
+* Fri Jul 29 2011 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 1.6
+- BUGFIX: Fix a bug where we were leaving out a required $(top_srcdir)
+- Fix definition of clstring (jyrki)
+- Split up flag declares into its own file (jyrki)
+- Add --version support (csilvers)
+- Update the README for gflags with static libs
+- Update acx_pthread.m4 for nostdlib
+- Change ReparseCommandLineFlags to return void (csilvers)
+- Some doc typofixes and example augmentation (various)
+
+* Mon Jan 24 2011 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 1.5
+- Better reporting of current vs default value (handler)
+- Add API for cleaning up of memory at program-exit (jmarantz)
+- Fix macros to work inside namespaces (csilvers)
+- Use our own string typedef in case string is redefined (csilvers)
+- Updated to autoconf 2.65
+
+* Wed Oct 13 2010 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 1.4
+- Add a check to prevent passing 0 to DEFINE_string (jorg)
+- Reduce compile (.o) size (jyrki)
+- Some small changes to quiet debug compiles (alexk)
+- PORTING: better support static linking on windows (csilvers)
+- DOCUMENTATION: change default values, use validators, etc.
+- Update the NEWS file to be non-empty
+- Add pkg-config (.pc) files for libgflags and libgflags_nothreads
+
+* Mon Jan  4 2010 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 1.3
+- PORTABILITY: can now build and run tests under MSVC (csilvers)
+- Remove the python gflags code, which is now its own package (tansell)
+- Clarify that "last flag wins" in the docs (csilvers)
+- Comment danger of using GetAllFlags in validators (wojtekm)
+- PORTABILITY: Some fixes necessary for c++0x (mboerger)
+- Makefile fix: $(srcdir) -> $(top_srcdir) in one place (csilvres)
+- INSTALL: autotools to autoconf v2.64 + automake v1.11 (csilvers)
+
+* Thu Sep 10 2009 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 1.2
+- PORTABILITY: can now build and run tests under mingw (csilvers)
+- Using a string arg for a bool flag is a compile-time error (rbayardo)
+- Add --helpxml to gflags.py (salcianu)
+- Protect against a hypothetical global d'tor mutex problem (csilvers)
+- BUGFIX: can now define a flag after 'using namespace google' (hamaji)
+
+* Tue Apr 14 2009 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 1.1
+- Add both foo and nofoo for boolean flags, with --undefok (andychu)
+- Better document how validators work (wojtekm)
+- Improve binary-detection for bash-completion (mtamsky)
+- Python: Add a concept of "key flags", used with --help (salcianu)
+- Python: Robustify flag_values (salcianu)
+- Python: Add a new DEFINE_bool alias (keir, andrewliu)
+- Python: Do module introspection based on module name (dsturtevant)
+- Fix autoconf a bit better, especially on windows and solaris (ajenjo)
+- BUG FIX: gflags_nothreads was linking against the wrong lib (ajenjo)
+- BUG FIX: threads-detection failed on FreeBSD; replace it (ajenjo)
+- PORTABILITY: Quiet an internal compiler error with SUSE 10 (csilvers)
+- PORTABILITY: Update deb.sh for more recenty debuilds (csilvers)
+- PORTABILITY: #include more headers to satify new gcc's (csilvers)
+- INSTALL: Updated to autoconf 2.61 and libtool 1.5.26 (csilvers)
+
+* Fri Oct  3 2008 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 1.0
+- Add a missing newline to an error string (bcmills)
+- (otherwise exactly the same as gflags 1.0rc2)
+
+* Thu Sep 18 2008 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 1.0rc2
+- Report current flag values in --helpxml (hdn)
+- Fix compilation troubles with gcc 4.3.3 (simonb)
+- BUG FIX: I was missing a std:: in DECLARE_string (csilvers)
+- BUG FIX: Clarify in docs how to specify --bool flags (csilvers)
+- BUG FIX: Fix --helpshort for source files not in a subdir (csilvers)
+- BUG FIX: Fix python unittest for 64-bit builds (bcmills)
+
+* Tue Aug 19 2008 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 1.0rc1
+- Move #include files from google/ to gflags/ (csilvers)
+- Small optimizations to reduce binary (library) size (jyrki)
+- BUGFIX: forgot a std:: in one of the .h files (csilvers)
+- Speed up locking by making sure calls are inlined (ajenjo)
+- 64-BIT COMPATIBILITY: Use %PRId64 instead of %lld (csilvers)
+- PORTABILITY: fix Makefile to work with Cygwin (ajenjo)
+- PORTABILITY: fix code to compile under Visual Studio (ajenjo)
+- PORTABILITY: fix code to compile under Solaris 10 with CC (csilvers)
+
+* Mon Jul 21 2008 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 0.9
+- Add the ability to validate a command-line flag (csilvers)
+- Add completion support for commandline flags in bash (daven)
+- Add -W compile flags to Makefile, when using gcc (csilvers)
+- Allow helpstring to be NULL (cristianoc)
+- Improved documentation of classes in the .cc file (csilvers)
+- Fix python bug with AppendFlagValues + shortnames (jjtswan)
+- Use bool instead of int for boolean flags in gflags.py (bcmills)
+- Simplify the way we declare flags, now more foolproof (csilvers)
+- Better error messages when bool flags collide (colohan)
+- Only evaluate DEFINE_foo macro args once (csilvers)
+
+* Wed Mar 26 2008 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 0.8
+- Export DescribeOneFlag() in the API
+- Add support for automatic line wrapping at 80 cols for gflags.py
+- Bugfix: do not treat an isolated "-" the same as an isolated "--"
+- Update rpm spec to point to Google Code rather than sourceforge (!)
+- Improve documentation (including documenting thread-safety)
+- Improve #include hygiene
+- Improve testing
+
+* Thu Oct 18 2007 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 0.7
+- Deal even more correctly with libpthread not linked in (csilvers)
+- Add STRIP_LOG, an improved DO_NOT_SHOW_COMMANDLINE_HELP (sioffe)
+- Be more accurate printing default flag values in --help (dsturtevant)
+- Reduce .o file size a bit by using shorter namespace names (jeff)
+- Use relative install path, so 'setup.py --home' works (csilvers)
+- Notice when a boolean flag has a non-boolean default (bnmouli)
+- Broaden --helpshort to match foo-main.cc and foo_main.cc (hendrie)
+- Fix "no modules match" message for --helpshort, etc (hendrie)
+
+* Wed Aug 15 2007 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 0.6
+- Deal correctly with case that libpthread is not linked in (csilvers)
+- Update Makefile/tests so we pass "make distcheck" (csilvers)
+- Document and test that last assignment to a flag wins (wan)
+
+* Tue Jun 12 2007 - Google Inc. <opensource@google.com>
+
+- google-gflags: version 0.5
+- Include all m4 macros in the distribution (csilvers)
+- Python: Fix broken data_files field in setup.py (sidlon)
+- Python: better string serliaizing and unparsing (abo, csimmons)
+- Fix checks for NaN and inf to work with Mac OS X (csilvers)