Re-organize structure of GLog/GFlags CMake libraries
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 3 Jan 2016 10:07:30 +0000 (15:07 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 4 Jan 2016 14:39:13 +0000 (19:39 +0500)
The idea is to split them into two separate targets and have dedicated include
directories list for each of them in order to avoid some annoying include header
modifications in comparison with upstream.

Reviewers: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1706

22 files changed:
build_files/cmake/Modules/GTestTesting.cmake
build_files/cmake/macros.cmake
extern/libmv/CMakeLists.txt
extern/libmv/ChangeLog
extern/libmv/bundle.sh
extern/libmv/files.txt
extern/libmv/mkfiles.sh
extern/libmv/third_party/CMakeLists.txt
extern/libmv/third_party/gflags/CMakeLists.txt [new file with mode: 0644]
extern/libmv/third_party/gflags/README.libmv
extern/libmv/third_party/gflags/README.md [new file with mode: 0644]
extern/libmv/third_party/gflags/gflags/gflags.h
extern/libmv/third_party/gflags/gflags/gflags_declare.h
extern/libmv/third_party/glog/AUTHORS
extern/libmv/third_party/glog/CMakeLists.txt [new file with mode: 0644]
extern/libmv/third_party/glog/README.libmv
extern/libmv/third_party/glog/src/base/commandlineflags.h
extern/libmv/third_party/glog/src/base/mutex.h
extern/libmv/third_party/glog/src/windows/glog/logging.h
extern/libmv/third_party/glog/src/windows/port.cc
extern/libmv/third_party/glog/src/windows/port.h
source/blenderplayer/CMakeLists.txt

index b98d15ecd41a5aa345af4d87a4ebd348b925f798..cb0d33d3c9a16fba3e910ab9c34a1d6750ff8735 100644 (file)
@@ -34,7 +34,8 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
                                      extern_gtest
                                      # needed for glog
                                      ${PTHREADS_LIBRARIES}
-                                     extern_glog)
+                                     extern_glog
+                                     extern_gflags)
                set_target_properties(${NAME}_test PROPERTIES
                                      RUNTIME_OUTPUT_DIRECTORY         "${TESTS_OUTPUT_DIR}"
                                      RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}"
index 12b7e667fb14bcc7226c97af42eb70cab7f35e87..e57f93e6dced64402a9d11a33dbf50be24da4159 100644 (file)
@@ -630,6 +630,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
                extern_wcwidth
                extern_libmv
                extern_glog
+               extern_gflags
                extern_sdlew
 
                bf_intern_glew_mx
index fd559c86846f24d6189a3c9aec9c12b68d10cf0b..a222c22447f7b47bea5218c2f1055c344439ce21 100644 (file)
@@ -37,10 +37,28 @@ set(SRC
        libmv-capi.h
 )
 
-if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
+TEST_SHARED_PTR_SUPPORT()
+if(SHARED_PTR_FOUND)
+       if(SHARED_PTR_TR1_MEMORY_HEADER)
+               add_definitions(-DCERES_TR1_MEMORY_HEADER)
+       endif()
+       if(SHARED_PTR_TR1_NAMESPACE)
+               add_definitions(-DCERES_TR1_SHARED_PTR)
+       endif()
+else()
+       message(FATAL_ERROR "Unable to find shared_ptr.")
+endif()
+
+add_definitions(-DGOOGLE_GLOG_DLL_DECL=)
+add_definitions(-DGFLAGS_DLL_DEFINE_FLAG=)
+add_definitions(-DGFLAGS_DLL_DECLARE_FLAG=)
+add_definitions(-DGFLAGS_DLL_DECL=)
+
+add_subdirectory(third_party)
+
+if(WITH_LIBMV)
        list(APPEND INC
                third_party/gflags
-               third_party/gflags/gflags
                third_party/glog/src
                third_party/ceres/include
                third_party/ceres/config
@@ -53,37 +71,10 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
                ${ZLIB_INCLUDE_DIRS}
        )
 
-       if(WIN32)
-               list(APPEND INC
-                       third_party/glog/src/windows
-               )
-
-               if(NOT MINGW)
-                       list(APPEND INC
-                               third_party/msinttypes
-                       )
-               endif()
-       endif()
-
        add_definitions(
                -DWITH_LIBMV_GUARDED_ALLOC
-               -DGOOGLE_GLOG_DLL_DECL=
                -DLIBMV_NO_FAST_DETECTOR=
        )
-endif()
-
-if(WITH_LIBMV)
-       TEST_SHARED_PTR_SUPPORT()
-       if(SHARED_PTR_FOUND)
-               if(SHARED_PTR_TR1_MEMORY_HEADER)
-                       add_definitions(-DCERES_TR1_MEMORY_HEADER)
-               endif()
-               if(SHARED_PTR_TR1_NAMESPACE)
-                       add_definitions(-DCERES_TR1_SHARED_PTR)
-               endif()
-       else()
-               message(FATAL_ERROR "Unable to find shared_ptr.")
-       endif()
 
        list(APPEND SRC
                intern/autotrack.cc
@@ -260,91 +251,3 @@ else()
 endif()
 
 blender_add_lib(extern_libmv "${SRC}" "${INC}" "${INC_SYS}")
-
-if(WITH_LIBMV)
-       add_subdirectory(third_party)
-endif()
-
-# make GLog a separate target, so it can be used for gtest as well.
-if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
-       # We compile GLog together with GFlag so we don't worry about
-       # adding extra lib to linker.
-       set(GLOG_SRC
-               third_party/gflags/gflags.cc
-               third_party/gflags/gflags_completions.cc
-               third_party/gflags/gflags_reporting.cc
-
-               third_party/gflags/config.h
-               third_party/gflags/gflags/gflags_completions.h
-               third_party/gflags/gflags/gflags_declare.h
-               third_party/gflags/gflags/gflags_gflags.h
-               third_party/gflags/gflags/gflags.h
-               third_party/gflags/mutex.h
-               third_party/gflags/util.h
-       )
-
-       if(WIN32)
-               list(APPEND GLOG_SRC
-                       third_party/glog/src/logging.cc
-                       third_party/glog/src/raw_logging.cc
-                       third_party/glog/src/utilities.cc
-                       third_party/glog/src/vlog_is_on.cc
-                       third_party/glog/src/windows/port.cc
-
-                       third_party/glog/src/utilities.h
-                       third_party/glog/src/stacktrace_generic-inl.h
-                       third_party/glog/src/stacktrace.h
-                       third_party/glog/src/stacktrace_x86_64-inl.h
-                       third_party/glog/src/base/googleinit.h
-                       third_party/glog/src/base/mutex.h
-                       third_party/glog/src/base/commandlineflags.h
-                       third_party/glog/src/stacktrace_powerpc-inl.h
-                       third_party/glog/src/stacktrace_x86-inl.h
-                       third_party/glog/src/config.h
-                       third_party/glog/src/stacktrace_libunwind-inl.h
-                       third_party/glog/src/windows/glog/raw_logging.h
-                       third_party/glog/src/windows/glog/vlog_is_on.h
-                       third_party/glog/src/windows/glog/logging.h
-                       third_party/glog/src/windows/glog/log_severity.h
-                       third_party/glog/src/windows/port.h
-                       third_party/glog/src/windows/config.h
-
-                       third_party/gflags/windows_port.cc
-                       third_party/gflags/windows_port.h
-               )
-       else()
-               list(APPEND GLOG_SRC
-                       third_party/glog/src/demangle.cc
-                       third_party/glog/src/logging.cc
-                       third_party/glog/src/raw_logging.cc
-                       third_party/glog/src/signalhandler.cc
-                       third_party/glog/src/symbolize.cc
-                       third_party/glog/src/utilities.cc
-                       third_party/glog/src/vlog_is_on.cc
-
-                       third_party/glog/src/base/commandlineflags.h
-                       third_party/glog/src/base/googleinit.h
-                       third_party/glog/src/base/mutex.h
-                       third_party/glog/src/config_freebsd.h
-                       third_party/glog/src/config.h
-                       third_party/glog/src/config_hurd.h
-                       third_party/glog/src/config_linux.h
-                       third_party/glog/src/config_mac.h
-                       third_party/glog/src/demangle.h
-                       third_party/glog/src/glog/logging.h
-                       third_party/glog/src/glog/log_severity.h
-                       third_party/glog/src/glog/raw_logging.h
-                       third_party/glog/src/glog/vlog_is_on.h
-                       third_party/glog/src/stacktrace_generic-inl.h
-                       third_party/glog/src/stacktrace.h
-                       third_party/glog/src/stacktrace_libunwind-inl.h
-                       third_party/glog/src/stacktrace_powerpc-inl.h
-                       third_party/glog/src/stacktrace_x86_64-inl.h
-                       third_party/glog/src/stacktrace_x86-inl.h
-                       third_party/glog/src/symbolize.h
-                       third_party/glog/src/utilities.h
-               )
-       endif()
-
-       blender_add_lib(extern_glog "${GLOG_SRC}" "${INC}" "${INC_SYS}")
-endif()
index e04defd1e1a81d0b76295c6337345511ac14f2da..63c9963a22fbbf078eabfefee1ab3dc720b1dff2 100644 (file)
@@ -1,3 +1,25 @@
+commit d3537e3709fe11f42312e82cb1c9837c9e742385
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date:   Sun Jan 3 14:17:10 2016 +0500
+
+    GLog/GFlags: Reduce difference between upstream and bundled versions
+    
+    Several things here:
+    
+    - Re-bundled sources using own fork with pull-requests applied on the sources.
+    
+    - Got rid of changes around include "config.h", it was needed by Blender to
+      make it's include directories configuration to work. This could be addressed
+      differently from Blender side.
+    
+    - Moved some customization to defines set by CMakeLists.
+
+commit 1ec37bba2cfbbf0d6568429fa3035ee2164c23e6
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date:   Sat Jan 2 12:42:55 2016 +0500
+
+    GFlags linking errors fix for MSVC
+
 commit df7642b270e8e43685e9ffb404b59d7b226a9f60
 Author: Sergey Sharybin <sergey.vfx@gmail.com>
 Date:   Thu Dec 31 17:56:12 2015 +0500
@@ -585,40 +607,3 @@ Date:   Thu Apr 17 18:42:43 2014 +0600
     
     Should prevent accidents like that one happened recently
     with crashing Blender after Libmv re-integration.
-
-commit e1fe41b6604771ba769a9b15eb2f489fbf7af251
-Author: Sergey Sharybin <sergey.vfx@gmail.com>
-Date:   Thu Apr 17 17:52:23 2014 +0600
-
-    Fix offset array not being properly allocated
-    
-    We really do need unit test for buffer (un)distortion,
-    didn't notice this bug for until new Libmv has been
-    integrated into Blender.
-
-commit ee21415a353396df67ef21e82adaffab2a8d2a0a
-Author: Sergey Sharybin <sergey.vfx@gmail.com>
-Date:   Thu Apr 17 16:26:12 2014 +0600
-
-    Support multiple distortion models, including a new division model
-    
-    This commit makes it so CameraIntrinsics is no longer hardcoded
-    to use the traditional polynomial radial distortion model. Currently
-    the distortion code has generic logic which is shared between
-    different distortion models, but had no other models until now.
-    
-    This moves everything specific to the polynomial radial distortion
-    to a subclass PolynomialDistortionCameraIntrinsics(), and adds a
-    new division distortion model suitable for cameras such as the
-    GoPro which have much stronger distortion due to their fisheye lens.
-    
-    This also cleans up the internal API of CameraIntrinsics to make
-    it easier to understand and reduces old C-style code.
-    
-    Reviewers: keir
-    
-    Reviewed By: keir
-    
-    CC: jta
-    
-    Differential Revision: https://developer.blender.org/D335
index e9fb33e593082447737c1c5983d40391cc818b61..53686f435460fd537bb92d15463bfe1a17465150 100755 (executable)
@@ -16,9 +16,13 @@ git clone -b $BRANCH $repo $tmp/libmv
 
 git --git-dir $tmp/libmv/.git --work-tree $tmp/libmv log -n 50 > ChangeLog
 
-find libmv -type f -not -iwholename '*.svn*' -exec rm -rf {} \;
-find third_party -type f -not -iwholename '*.svn*' -not -iwholename '*third_party/ceres*' \
+find libmv -type f -exec rm -rf {} \;
+find third_party -type f \
+    -not -iwholename '*third_party/ceres*' \
+    -not -iwholename '*third_party/SConscript*' \
     -not -iwholename '*third_party/CMakeLists.txt*' \
+    -not -iwholename '*third_party/gflags/CMakeLists.txt*' \
+    -not -iwholename '*third_party/glog/CMakeLists.txt*' \
     -exec rm -rf {} \;
 
 cat "files.txt" | while read f; do
@@ -130,10 +134,28 @@ set(SRC
        libmv-capi.h
 )
 
-if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
+TEST_SHARED_PTR_SUPPORT()
+if(SHARED_PTR_FOUND)
+       if(SHARED_PTR_TR1_MEMORY_HEADER)
+               add_definitions(-DCERES_TR1_MEMORY_HEADER)
+       endif()
+       if(SHARED_PTR_TR1_NAMESPACE)
+               add_definitions(-DCERES_TR1_SHARED_PTR)
+       endif()
+else()
+       message(FATAL_ERROR "Unable to find shared_ptr.")
+endif()
+
+add_definitions(-DGOOGLE_GLOG_DLL_DECL=)
+add_definitions(-DGFLAGS_DLL_DEFINE_FLAG=)
+add_definitions(-DGFLAGS_DLL_DECLARE_FLAG=)
+add_definitions(-DGFLAGS_DLL_DECL=)
+
+add_subdirectory(third_party)
+
+if(WITH_LIBMV)
        list(APPEND INC
                third_party/gflags
-               third_party/gflags/gflags
                third_party/glog/src
                third_party/ceres/include
                third_party/ceres/config
@@ -146,37 +168,10 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
                \${ZLIB_INCLUDE_DIRS}
        )
 
-       if(WIN32)
-               list(APPEND INC
-                       third_party/glog/src/windows
-               )
-
-               if(NOT MINGW)
-                       list(APPEND INC
-                               third_party/msinttypes
-                       )
-               endif()
-       endif()
-
        add_definitions(
                -DWITH_LIBMV_GUARDED_ALLOC
-               -DGOOGLE_GLOG_DLL_DECL=
                -DLIBMV_NO_FAST_DETECTOR=
        )
-endif()
-
-if(WITH_LIBMV)
-       TEST_SHARED_PTR_SUPPORT()
-       if(SHARED_PTR_FOUND)
-               if(SHARED_PTR_TR1_MEMORY_HEADER)
-                       add_definitions(-DCERES_TR1_MEMORY_HEADER)
-               endif()
-               if(SHARED_PTR_TR1_NAMESPACE)
-                       add_definitions(-DCERES_TR1_SHARED_PTR)
-               endif()
-       else()
-               message(FATAL_ERROR "Unable to find shared_ptr.")
-       endif()
 
        list(APPEND SRC
                intern/autotrack.cc
@@ -222,58 +217,4 @@ else()
 endif()
 
 blender_add_lib(extern_libmv "\${SRC}" "\${INC}" "\${INC_SYS}")
-
-if(WITH_LIBMV)
-       add_subdirectory(third_party)
-endif()
-
-# make GLog a separate target, so it can be used for gtest as well.
-if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
-       # We compile GLog together with GFlag so we don't worry about
-       # adding extra lib to linker.
-       set(GLOG_SRC
-${third_gflags_sources}
-
-${third_gflags_headers}
-       )
-
-       if(WIN32)
-               list(APPEND GLOG_SRC
-                       third_party/glog/src/logging.cc
-                       third_party/glog/src/raw_logging.cc
-                       third_party/glog/src/utilities.cc
-                       third_party/glog/src/vlog_is_on.cc
-                       third_party/glog/src/windows/port.cc
-
-                       third_party/glog/src/utilities.h
-                       third_party/glog/src/stacktrace_generic-inl.h
-                       third_party/glog/src/stacktrace.h
-                       third_party/glog/src/stacktrace_x86_64-inl.h
-                       third_party/glog/src/base/googleinit.h
-                       third_party/glog/src/base/mutex.h
-                       third_party/glog/src/base/commandlineflags.h
-                       third_party/glog/src/stacktrace_powerpc-inl.h
-                       third_party/glog/src/stacktrace_x86-inl.h
-                       third_party/glog/src/config.h
-                       third_party/glog/src/stacktrace_libunwind-inl.h
-                       third_party/glog/src/windows/glog/raw_logging.h
-                       third_party/glog/src/windows/glog/vlog_is_on.h
-                       third_party/glog/src/windows/glog/logging.h
-                       third_party/glog/src/windows/glog/log_severity.h
-                       third_party/glog/src/windows/port.h
-                       third_party/glog/src/windows/config.h
-
-                       third_party/gflags/windows_port.cc
-                       third_party/gflags/windows_port.h
-               )
-       else()
-               list(APPEND GLOG_SRC
-${third_glog_sources}
-
-${third_glog_headers}
-               )
-       endif()
-
-       blender_add_lib(extern_glog "\${GLOG_SRC}" "\${INC}" "\${INC_SYS}")
-endif()
 EOF
index 427ff86dc042d0ae3b3208c343a67b967be0cb5e..d3a7993ea6b18d75a4fc84b2963ede627c1e69e6 100644 (file)
@@ -147,6 +147,7 @@ third_party/gflags/gflags_reporting.cc
 third_party/gflags/mutex.h
 third_party/gflags/NEWS.txt
 third_party/gflags/README.libmv
+third_party/gflags/README.md
 third_party/gflags/util.h
 third_party/gflags/windows_port.cc
 third_party/gflags/windows_port.h
index c7c8c33f7255469187dda94a6fef8e7ab89da986..281d07cd839379124411c0adc8c880a131f30c59 100755 (executable)
@@ -1,4 +1,8 @@
 #!/bin/sh
 
 find ./libmv/ -type f | sed -r 's/^\.\///' | sort > files.txt
-find ./third_party/ -mindepth 2 -type f | grep -v third_party/ceres | sed -r 's/^\.\///' | sort >> files.txt
+find ./third_party/ -mindepth 2 -type f | \
+    grep -v third_party/ceres | \
+    grep -v third_party/gflags/CMakeLists.txt | \
+    grep -v third_party/glog/CMakeLists.txt | \
+    sed -r 's/^\.\///' | sort >> files.txt
index 6212fe480b122cd5c803eba9efb0d2b527a93ff0..660b39e3d53ae17e66d6f19e10eea9ba0a080e59 100644 (file)
@@ -1,2 +1,8 @@
+if(WITH_LIBMV)
+       add_subdirectory(ceres)
+endif()
 
-add_subdirectory(ceres)
+if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
+       add_subdirectory(gflags)
+       add_subdirectory(glog)
+endif()
diff --git a/extern/libmv/third_party/gflags/CMakeLists.txt b/extern/libmv/third_party/gflags/CMakeLists.txt
new file mode 100644 (file)
index 0000000..99e2898
--- /dev/null
@@ -0,0 +1,54 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2016, Blender Foundation
+# All rights reserved.
+#
+# Contributor(s): Blender Foundation,
+#                 Sergey Sharybin
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+       .
+       gflags
+)
+
+set(INC_SYS
+)
+
+set(SRC
+       gflags.cc
+       gflags_completions.cc
+       gflags_reporting.cc
+
+       config.h
+       gflags/gflags_completions.h
+       gflags/gflags_declare.h
+       gflags/gflags_gflags.h
+       gflags/gflags.h
+       mutex.h
+       util.h
+)
+
+if(WIN32)
+       list(APPEND SRC
+               windows_port.cc
+               windows_port.h
+       )
+endif()
+
+blender_add_lib(extern_gflags "${SRC}" "${INC}" "${INC_SYS}")
index f4310b39bbbc115fa5f3b81e1111d6ed37e4d314..bf58ccb5fd2a5362073ac9a85e90796e436cdd9f 100644 (file)
@@ -1,7 +1,7 @@
 Project: Google Flags
 URL: http://code.google.com/p/google-gflags/
 License: New BSD
-Upstream version: 2.1.1
+Upstream version: 2.2.0 (9db82895)
 Local modifications:
 
 - Flattened the tree and only included files needed for libmv.
@@ -15,4 +15,5 @@ Local modifications:
 
 - Removed attribute(unused) from FlagSaver.
 
-  TODO(keir): Import and use gflags for Windows from upstream.
+- Applied some modifications from fork https://github.com/Nazg-Gul/gflags.git
+  (see https://github.com/gflags/gflags/pull/129)
diff --git a/extern/libmv/third_party/gflags/README.md b/extern/libmv/third_party/gflags/README.md
new file mode 100644 (file)
index 0000000..79bd202
--- /dev/null
@@ -0,0 +1,270 @@
+24 March 2015
+-------------
+
+I've just released gflags 2.1.2.
+
+This release completes the namespace change fixes. In particular,
+it restores binary ABI compatibility with release version 2.0.
+The deprecated "google" namespace is by default still kept as
+primary namespace while symbols are imported into the new "gflags" namespace.
+This can be overridden using the CMake variable GFLAGS_NAMESPACE.
+
+Other fixes of the build configuration are related to the (patched)
+CMake modules FindThreads.cmake and CheckTypeSize.cmake. These have
+been removed and instead the C language is enabled again even though
+gflags is written in C++ only.
+
+This release also marks the complete move of the gflags project
+from Google Code to GitHub. Email addresses of original issue
+reporters got lost in the process. Given the age of most issue reports,
+this should be negligable.
+
+Please report any further issues using the GitHub issue tracker.
+
+
+30 March 2014
+-------------
+
+I've just released gflags 2.1.1.
+
+This release fixes a few bugs in the configuration of gflags\_declare.h
+and adds a separate GFLAGS\_INCLUDE\_DIR CMake variable to the build configuration.
+Setting GFLAGS\_NAMESPACE to "google" no longer changes also the include
+path of the public header files. This allows the use of the library with
+other Google projects such as glog which still use the deprecated "google"
+namespace for the gflags library, but include it as "gflags/gflags.h".
+
+20 March 2014
+-------------
+
+I've just released gflags 2.1.
+
+The major changes are the use of CMake for the build configuration instead
+of the autotools and packaging support through CPack. The default namespace
+of all C++ symbols is now "gflags" instead of "google". This can be
+configured via the GFLAGS\_NAMESPACE variable.
+
+This release compiles with all major compilers without warnings and passed
+the unit tests on  Ubuntu 12.04, Windows 7 (Visual Studio 2008 and 2010,
+Cygwin, MinGW), and Mac OS X (Xcode 5.1).
+
+The SVN repository on Google Code is now frozen and replaced by a Git
+repository such that it can be used as Git submodule by projects. The main
+hosting of this project remains at Google Code. Thanks to the distributed
+character of Git, I can push (and pull) changes from both GitHub and Google Code
+in order to keep the two public repositories in sync.
+When fixing an issue for a pull request through either of these hosting
+platforms, please reference the issue number as
+[described here](https://code.google.com/p/support/wiki/IssueTracker#Integration_with_version_control).
+For the further development, I am following the
+[Git branching model](http://nvie.com/posts/a-successful-git-branching-model/)
+with feature branch names prefixed by "feature/" and bugfix branch names
+prefixed by "bugfix/", respectively.
+
+Binary and source [packages](https://github.com/schuhschuh/gflags/releases) are available on GitHub.
+
+
+14 January 2014
+---------------
+
+The migration of the build system to CMake is almost complete.
+What remains to be done is rewriting the tests in Python such they can be
+executed on non-Unix platforms and splitting them up into separate CTest tests.
+Though merging these changes into the master branch yet remains to be done,
+it is recommended to already start using the
+[cmake-migration](https://github.com/schuhschuh/gflags/tree/cmake-migration) branch.
+
+
+20 April 2013
+-------------
+
+More than a year has past since I (Andreas) took over the maintenance for
+`gflags`. Only few minor changes have been made since then, much to my regret.
+To get more involved and stimulate participation in the further
+development of the library, I moved the project source code today to
+[GitHub](https://github.com/schuhschuh/gflags).
+I believe that the strengths of [Git](http://git-scm.com/) will allow for better community collaboration
+as well as ease the integration of changes made by others. I encourage everyone
+who would like to contribute to send me pull requests.
+Git's lightweight feature branches will also provide the right tool for more
+radical changes which should only be merged back into the master branch
+after these are complete and implement the desired behavior.
+
+The SVN repository remains accessible at Google Code and I will keep the
+master branch of the Git repository hosted at GitHub and the trunk of the
+Subversion repository synchronized. Initially, I was going to simply switch the
+Google Code project to Git, but in this case the SVN repository would be
+frozen and force everyone who would like the latest development changes to
+use Git as well. Therefore I decided to host the public Git repository at GitHub
+instead.
+
+Please continue to report any issues with gflags on Google Code. The GitHub project will
+only be used to host the Git repository.
+
+One major change of the project structure I have in mind for the next weeks
+is the migration from autotools to [CMake](http://www.cmake.org/).
+Check out the (unstable!)
+[cmake-migration](https://github.com/schuhschuh/gflags/tree/cmake-migration)
+branch on GitHub for details.
+
+
+25 January 2012
+---------------
+
+I've just released gflags 2.0.
+
+The `google-gflags` project has been renamed to `gflags`.  I
+(csilvers) am stepping down as maintainer, to be replaced by Andreas
+Schuh.  Welcome to the team, Andreas!  I've seen the energy you have
+around gflags and the ideas you have for the project going forward,
+and look forward to having you on the team.
+
+I bumped the major version number up to 2 to reflect the new community
+ownership of the project.  All the [changes](ChangeLog.txt)
+are related to the renaming.  There are no functional changes from
+gflags 1.7.  In particular, I've kept the code in the namespace
+`google`, though in a future version it should be renamed to `gflags`.
+I've also kept the `/usr/local/include/google/` subdirectory as
+synonym of `/usr/local/include/gflags/`, though the former name has
+been obsolete for some time now.
+
+
+18 January 2011
+---------------
+
+The `google-gflags` Google Code page has been renamed to
+`gflags`, in preparation for the project being renamed to
+`gflags`.  In the coming weeks, I'll be stepping down as
+maintainer for the gflags project, and as part of that Google is
+relinquishing ownership of the project; it will now be entirely
+community run.  The name change reflects that shift.
+
+
+20 December 2011
+----------------
+
+I've just released gflags 1.7.  This is a minor release; the major
+change is that `CommandLineFlagInfo` now exports the address in memory
+where the flag is located.  There has also been a bugfix involving
+very long --help strings, and some other minor [changes](ChangeLog.txt).
+
+29 July 2011
+------------
+
+I've just released gflags 1.6.  The major new feature in this release
+is support for setting version info, so that --version does something
+useful.
+
+One minor change has required bumping the library number:
+`ReparseCommandlineFlags` now returns `void` instead of `int` (the int
+return value was always meaningless).  Though I doubt anyone ever used
+this (meaningless) return value, technically it's a change to the ABI
+that requires a version bump.  A bit sad.
+
+There's also a procedural change with this release: I've changed the
+internal tools used to integrate Google-supplied patches for gflags
+into the opensource release.  These new tools should result in more
+frequent updates with better change descriptions.  They will also
+result in future `ChangeLog` entries being much more verbose (for better
+or for worse).
+
+See the [ChangeLog](ChangeLog.txt) for a full list of changes for this release.
+
+24 January 2011
+---------------
+
+I've just released gflags 1.5.  This release has only minor changes
+from 1.4, including some slightly better reporting in --help, and
+an new memory-cleanup function that can help when running gflags-using
+libraries under valgrind.  The major change is to fix up the macros
+(`DEFINE_bool` and the like) to work more reliably inside namespaces.
+
+If you have not had a problem with these macros, and don't need any of
+the other changes described, there is no need to upgrade.  See the
+[ChangeLog](ChangeLog.txt) for a full list of changes for this release.
+
+11 October 2010
+---------------
+
+I've just released gflags 1.4.  This release has only minor changes
+from 1.3, including some documentation tweaks and some work to make
+the library smaller.  If 1.3 is working well for you, there's no
+particular reason to upgrade.
+
+4 January 2010
+--------------
+
+I've just released gflags 1.3.  gflags now compiles under MSVC, and
+all tests pass.  I **really** never thought non-unix-y Windows folks
+would want gflags, but at least some of them do.
+
+The major news, though, is that I've separated out the python package
+into its own library, [python-gflags](http://code.google.com/p/python-gflags).
+If you're interested in the Python version of gflags, that's the place to
+get it now.
+
+10 September 2009
+-----------------
+
+I've just released gflags 1.2.  The major change from gflags 1.1 is it
+now compiles under MinGW (as well as cygwin), and all tests pass.  I
+never thought Windows folks would want unix-style command-line flags,
+since they're so different from the Windows style, but I guess I was
+wrong!
+
+The other changes are minor, such as support for --htmlxml in the
+python version of gflags.
+
+15 April 2009
+-------------
+
+I've just released gflags 1.1.  It has only minor changes fdrom gflags
+1.0 (see the [ChangeLog](ChangeLog.txt) for details).
+The major change is that I moved to a new system for creating .deb and .rpm files.
+This allows me to create x86\_64 deb and rpm files.
+
+In the process of moving to this new system, I noticed an
+inconsistency: the tar.gz and .rpm files created libraries named
+libgflags.so, but the deb file created libgoogle-gflags.so.  I have
+fixed the deb file to create libraries like the others.  I'm no expert
+in debian packaging, but I believe this has caused the package name to
+change as well.  Please let me know (at
+[[mailto:google-gflags@googlegroups.com](mailto:google-gflags@googlegroups.com)
+google-gflags@googlegroups.com]) if this causes problems for you --
+especially if you know of a fix!  I would be happy to change the deb
+packages to add symlinks from the old library name to the new
+(libgoogle-gflags.so -> libgflags.so), but that is beyond my knowledge
+of how to make .debs.
+
+If you've tried to install a .rpm or .deb and it doesn't work for you,
+let me know.  I'm excited to finally have 64-bit package files, but
+there may still be some wrinkles in the new system to iron out.
+
+1 October 2008
+--------------
+
+gflags 1.0rc2 was out for a few weeks without any issues, so gflags
+1.0 is now released.  This is much like gflags 0.9.  The major change
+is that the .h files have been moved from `/usr/include/google` to
+`/usr/include/gflags`.  While I have backwards-compatibility
+forwarding headeds in place, please rewrite existing code to say
+```
+   #include <gflags/gflags.h>
+```
+instead of
+```
+   #include <google/gflags.h>
+```
+
+I've kept the default namespace to google.  You can still change with
+with the appropriate flag to the configure script (`./configure
+--help` to see the flags).  If you have feedback as to whether the
+default namespace should change to gflags, which would be a
+non-backwards-compatible change, send mail to
+`google-gflags@googlegroups.com`!
+
+Version 1.0 also has some neat new features, like support for bash
+commandline-completion of help flags.  See the [ChangeLog](ChangeLog.txt)
+for more details.
+
+If I don't hear any bad news for a few weeks, I'll release 1.0-final.
index 5e04772c9a35af43616f3734ba25c782745a80cd..357eec6be7ce2f714db9c5e9cdbab78b113337f6 100644 (file)
@@ -86,7 +86,7 @@
 
 // We always want to export variables defined in user code
 #ifndef GFLAGS_DLL_DEFINE_FLAG
-#  if 0 && defined(_MSC_VER)
+#  ifdef _MSC_VER
 #    define GFLAGS_DLL_DEFINE_FLAG __declspec(dllexport)
 #  else
 #    define GFLAGS_DLL_DEFINE_FLAG
index 197197dcbc935c18810f41547ffdb5f6815c904e..9b85f46cfdc7fa260d0017e53f120fd8459d0dc9 100644 (file)
@@ -47,7 +47,7 @@
 
 // We always want to import the symbols of the gflags library
 #ifndef GFLAGS_DLL_DECL
-#  if 0 && defined(_MSC_VER)
+#  if 1 && defined(_MSC_VER)
 #    define GFLAGS_DLL_DECL __declspec(dllimport)
 #  else
 #    define GFLAGS_DLL_DECL
@@ -56,7 +56,7 @@
 
 // We always want to import variables declared in user code
 #ifndef GFLAGS_DLL_DECLARE_FLAG
-#  if 0 && defined(_MSC_VER)
+#  ifdef _MSC_VER
 #    define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport)
 #  else
 #    define GFLAGS_DLL_DECLARE_FLAG
index ee92be88dcf11ca104c765ee339b69f8c5b90d8d..72959a02585dc522a0d7d08d13c39831f2a064f4 100644 (file)
@@ -1,2 +1,18 @@
-opensource@google.com
+# This is the official list of glog authors for copyright purposes.
+# This file is distinct from the CONTRIBUTORS files.
+# See the latter for an explanation.
+#
+# Names should be added to this file as:
+#      Name or Organization <email address>
+# The email address is not required for organizations.
+#
+# Please keep the list sorted.
 
+Abhishek Parmar <abhishek@orng.net>
+Brian Silverman <bsilver16384@gmail.com>
+Google Inc.
+Michael Tanner <michael@tannertaxpro.com>
+romange <romange@users.noreply.github.com>
+Sergiu Dotenco <sergiu.dotenco@th-nuernberg.de>
+tbennun <tbennun@gmail.com>
+Teddy Reed <teddy@prosauce.org>
diff --git a/extern/libmv/third_party/glog/CMakeLists.txt b/extern/libmv/third_party/glog/CMakeLists.txt
new file mode 100644 (file)
index 0000000..469df11
--- /dev/null
@@ -0,0 +1,89 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2016, Blender Foundation
+# All rights reserved.
+#
+# Contributor(s): Blender Foundation,
+#                 Sergey Sharybin
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+       src
+       ../gflags
+)
+
+set(INC_SYS
+)
+
+set(SRC
+       src/logging.cc
+       src/raw_logging.cc
+       src/utilities.cc
+       src/vlog_is_on.cc
+
+       src/utilities.h
+
+       src/config.h
+       src/config_freebsd.h
+       src/config_hurd.h
+       src/config_linux.h
+       src/config_mac.h
+
+       src/base/commandlineflags.h
+       src/base/googleinit.h
+       src/base/mutex.h
+
+       src/stacktrace.h
+       src/stacktrace_generic-inl.h
+       src/stacktrace_libunwind-inl.h
+       src/stacktrace_powerpc-inl.h
+       src/stacktrace_x86_64-inl.h
+       src/stacktrace_x86-inl.h
+)
+
+if(WIN32)
+       list(APPEND SRC
+               src/windows/port.cc
+
+               src/windows/glog/raw_logging.h
+               src/windows/glog/vlog_is_on.h
+               src/windows/glog/logging.h
+               src/windows/glog/log_severity.h
+               src/windows/port.h
+               src/windows/config.h
+       )
+
+       list(APPEND INC
+               src/windows
+       )
+else()
+       list(APPEND SRC
+               src/demangle.cc
+               src/signalhandler.cc
+               src/symbolize.cc
+
+               src/demangle.h
+               src/glog/logging.h
+               src/glog/log_severity.h
+               src/glog/raw_logging.h
+               src/glog/vlog_is_on.h
+               src/symbolize.h
+       )
+endif()
+
+blender_add_lib(extern_glog "${SRC}" "${INC}" "${INC_SYS}")
index 43ee532b6ebdaadcc40e5e6160c127f02fc315bd..6e82cbbacdffc7925e8d8c0afb96649782d267ba 100644 (file)
@@ -5,3 +5,5 @@ Upstream version: 0.3.4, 4d391fe
 Local modifications:
 * Added per-platform config.h files so no configuration-time
   checks for functions and so are needed.
+* Applied changes from a fork https://github.com/Nazg-Gul/glog
+  (see https://github.com/google/glog/pull/81)
index 529540ea461b0cca36d3a559e87a9b08b743cc7f..c8d50890269a8f94f19fd883c9766625231fe786 100644 (file)
@@ -48,7 +48,7 @@
 #ifndef BASE_COMMANDLINEFLAGS_H__
 #define BASE_COMMANDLINEFLAGS_H__
 
-#include "../config.h"
+#include "config.h"
 #include <string>
 #include <string.h>               // for memchr
 #include <stdlib.h>               // for getenv
index 00da50580b3210fa510335a31b4db4afe99be782..ced2b9950edc28c60e3b753f0518832c12f72263 100644 (file)
 #ifndef GOOGLE_MUTEX_H_
 #define GOOGLE_MUTEX_H_
 
-#include "../config.h"           // to figure out pthreads support
+#include "config.h"           // to figure out pthreads support
 
 #if defined(NO_THREADS)
   typedef int MutexType;      // to keep a lock-count
index fec5d7672cd429f296744147b2be640dc3eb75f5..50135329d773834c2e4ef483d19555cd9414ef31 100644 (file)
@@ -54,7 +54,7 @@
 
 // Annoying stuff for windows -- makes sure clients can import these functions
 #ifndef GOOGLE_GLOG_DLL_DECL
-# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+# if defined(_WIN32) && !defined(__CYGWIN__)
 #   define GOOGLE_GLOG_DLL_DECL  __declspec(dllimport)
 # else
 #   define GOOGLE_GLOG_DLL_DECL
 // Note: these commands below may look like "#if 1" or "#if 0", but
 // that's because they were constructed that way at ./configure time.
 // Look at logging.h.in to see how they're calculated (based on your config).
-#if 0
+#ifdef __MINGW32__
 #include <stdint.h>             // the normal place uint16_t is defined
 #endif
-#if 0
+#ifdef __MINGW32__
 #include <sys/types.h>          // the normal place u_int16_t is defined
 #endif
-#if 0
+#ifdef __MINGW32__
 #include <inttypes.h>           // a third place for uint16_t or u_int16_t
 #endif
 
@@ -92,9 +92,6 @@
 #ifdef __MINGW32__
 #  include <stdlib.h>
 #  include <unistd.h>
-#  include <stdint.h>             // the normal place uint16_t is defined
-#  include <sys/types.h>          // the normal place u_int16_t is defined
-#  include <inttypes.h>           // a third place for uint16_t or u_int16_t
 #  define _exit(x) exit(x)
 #endif
 
index a2f8395de1d1ac7cf682c8e90fbbeb60f25836b1..d9943254ee5d54738afa5e612150e606f67a64cd 100644 (file)
@@ -36,7 +36,7 @@
 # error You should only be including windows/port.cc in a windows environment!
 #endif
 
-#include "../config.h"
+#include "config.h"
 #include <stdarg.h>    // for va_list, va_start, va_end
 #include <string.h>    // for strstr()
 #include <assert.h>
index 3be525e8ce9ff727df59242d738874bbdda7f94d..d78a1854f46af6e6b78eedb1a7650164b530f48e 100644 (file)
@@ -41,7 +41,7 @@
 #ifndef CTEMPLATE_WINDOWS_PORT_H_
 #define CTEMPLATE_WINDOWS_PORT_H_
 
-#include "../config.h"
+#include "config.h"
 
 #ifdef _WIN32
 
index deb702f005c5cc07b0c960a30612fe8ce83cd660..c4ae82cf1aa8b9a84e2379782e1a4b53303603eb 100644 (file)
@@ -175,6 +175,7 @@ endif()
                extern_wcwidth
                extern_libmv
                extern_glog
+               extern_gflags
                extern_sdlew
        )