[Bf-blender-cvs] [c007ca6] cmake_libmv_reorganize: Re-organize structure of GLog/GFlags CMake libraries

Sergey Sharybin noreply at git.blender.org
Mon Jan 4 14:36:09 CET 2016


Commit: c007ca6b5fd2404380a8d3a29e984c4d79425b23
Author: Sergey Sharybin
Date:   Sun Jan 3 15:07:30 2016 +0500
Branches: cmake_libmv_reorganize
https://developer.blender.org/rBc007ca6b5fd2404380a8d3a29e984c4d79425b23

Re-organize structure of GLog/GFlags CMake libraries

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

===================================================================

M	build_files/cmake/Modules/GTestTesting.cmake
M	build_files/cmake/macros.cmake
M	extern/libmv/CMakeLists.txt
M	extern/libmv/ChangeLog
M	extern/libmv/bundle.sh
M	extern/libmv/files.txt
M	extern/libmv/mkfiles.sh
M	extern/libmv/third_party/CMakeLists.txt
A	extern/libmv/third_party/gflags/CMakeLists.txt
M	extern/libmv/third_party/gflags/README.libmv
A	extern/libmv/third_party/gflags/README.md
M	extern/libmv/third_party/gflags/gflags/gflags.h
M	extern/libmv/third_party/gflags/gflags/gflags_declare.h
M	extern/libmv/third_party/glog/AUTHORS
A	extern/libmv/third_party/glog/CMakeLists.txt
M	extern/libmv/third_party/glog/README.libmv
M	extern/libmv/third_party/glog/src/base/commandlineflags.h
M	extern/libmv/third_party/glog/src/base/mutex.h
M	extern/libmv/third_party/glog/src/windows/glog/logging.h
M	extern/libmv/third_party/glog/src/windows/port.cc
M	extern/libmv/third_party/glog/src/windows/port.h
M	source/blenderplayer/CMakeLists.txt

===================================================================

diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake
index b98d15e..cb0d33d 100644
--- a/build_files/cmake/Modules/GTestTesting.cmake
+++ b/build_files/cmake/Modules/GTestTesting.cmake
@@ -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}"
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 12b7e66..e57f93e 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -630,6 +630,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
 		extern_wcwidth
 		extern_libmv
 		extern_glog
+		extern_gflags
 		extern_sdlew
 
 		bf_intern_glew_mx
diff --git a/extern/libmv/CMakeLists.txt b/extern/libmv/CMakeLists.txt
index fd559c8..a222c22 100644
--- a/extern/libmv/CMakeLists.txt
+++ b/extern/libmv/CMakeLists.txt
@@ -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()
diff --git a/extern/libmv/ChangeLog b/extern/libmv/ChangeLog
index e04defd..63c9963 100644
--- a/extern/libmv/ChangeLog
+++ b/extern/libmv/ChangeLog
@@ -1,3 +1,25 @@
+commit d3537e3709fe11f42312e82cb1c9837c9e742385
+Author: Sergey Sharybin <sergey.vfx at 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 at gmail.com>
+Date:   Sat Jan 2 12:42:55 2016 +0500
+
+    GFlags linking errors fix for MSVC
+
 commit df7642b270e8e43685e9ffb404b59d7b226a9f60
 Author: Sergey Sharybin <sergey.vfx at 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 at 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 at 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
diff --git a/extern/libmv/bundle.sh b/extern/libmv/bundle.sh
index e9fb33e..53686f4 100755
--- a/extern/libmv/bundle.sh
+++ b/extern/libmv/bundle.sh
@@ -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_p

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list