Move GLog/GFlags to extern/

This is where the libraries belongs to actually, they are not only used by
Libmv now, but also by tests and Cycles.
This commit is contained in:
Sergey Sharybin 2016-01-04 16:47:36 +05:00
parent 69f4080839
commit 0b856dd97e
71 changed files with 78 additions and 114 deletions

@ -2585,6 +2585,21 @@ if(WITH_PYTHON_MODULE)
add_definitions(-DPy_ENABLE_SHARED) add_definitions(-DPy_ENABLE_SHARED)
endif() endif()
#-----------------------------------------------------------------------------
# Configure GLog/GFlags
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
set(GLOG_DEFINES
-DGOOGLE_GLOG_DLL_DECL=
)
set(GFLAGS_DEFINES
-DGFLAGS_DLL_DEFINE_FLAG=
-DGFLAGS_DLL_DECLARE_FLAG=
-DGFLAGS_DLL_DECL=
)
endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Extra compile flags # Extra compile flags

@ -86,6 +86,11 @@ if(WITH_X11 AND WITH_GHOST_XDND)
add_subdirectory(xdnd) add_subdirectory(xdnd)
endif() endif()
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
add_subdirectory(gflags)
add_subdirectory(glog)
endif()
if(WITH_GTESTS) if(WITH_GTESTS)
add_subdirectory(gtest) add_subdirectory(gtest)
endif() endif()

@ -23,32 +23,34 @@
# ***** END GPL LICENSE BLOCK ***** # ***** END GPL LICENSE BLOCK *****
set(INC set(INC
. src
gflags src/gflags
) )
set(INC_SYS set(INC_SYS
) )
set(SRC set(SRC
gflags.cc src/gflags.cc
gflags_completions.cc src/gflags_completions.cc
gflags_reporting.cc src/gflags_reporting.cc
config.h src/config.h
gflags/gflags_completions.h src/gflags/gflags_completions.h
gflags/gflags_declare.h src/gflags/gflags_declare.h
gflags/gflags_gflags.h src/gflags/gflags_gflags.h
gflags/gflags.h src/gflags/gflags.h
mutex.h src/mutex.h
util.h src/util.h
) )
if(WIN32) if(WIN32)
list(APPEND SRC list(APPEND SRC
windows_port.cc src/windows_port.cc
windows_port.h src/windows_port.h
) )
endif() endif()
add_definitions(${GFLAGS_DEFINES})
blender_add_lib(extern_gflags "${SRC}" "${INC}" "${INC_SYS}") blender_add_lib(extern_gflags "${SRC}" "${INC}" "${INC_SYS}")

@ -24,7 +24,7 @@
set(INC set(INC
src src
../gflags ../gflags/src
) )
set(INC_SYS set(INC_SYS
@ -86,4 +86,7 @@ else()
) )
endif() endif()
add_definitions(${GFLAGS_DEFINES})
add_definitions(${GLOG_DEFINES})
blender_add_lib(extern_glog "${SRC}" "${INC}" "${INC_SYS}") blender_add_lib(extern_glog "${SRC}" "${INC}" "${INC_SYS}")

@ -49,17 +49,15 @@ else()
message(FATAL_ERROR "Unable to find shared_ptr.") message(FATAL_ERROR "Unable to find shared_ptr.")
endif() endif()
add_definitions(-DGOOGLE_GLOG_DLL_DECL=) add_definitions(${GFLAGS_DEFINES})
add_definitions(-DGFLAGS_DLL_DEFINE_FLAG=) add_definitions(${GLOG_DEFINES})
add_definitions(-DGFLAGS_DLL_DECLARE_FLAG=)
add_definitions(-DGFLAGS_DLL_DECL=)
add_subdirectory(third_party) add_subdirectory(third_party)
if(WITH_LIBMV) if(WITH_LIBMV)
list(APPEND INC list(APPEND INC
third_party/gflags ../gflags/src
third_party/glog/src ../glog/src
third_party/ceres/include third_party/ceres/include
third_party/ceres/config third_party/ceres/config
../../intern/guardedalloc ../../intern/guardedalloc

@ -19,10 +19,7 @@ git --git-dir $tmp/libmv/.git --work-tree $tmp/libmv log -n 50 > ChangeLog
find libmv -type f -exec rm -rf {} \; find libmv -type f -exec rm -rf {} \;
find third_party -type f \ find third_party -type f \
-not -iwholename '*third_party/ceres*' \ -not -iwholename '*third_party/ceres*' \
-not -iwholename '*third_party/SConscript*' \
-not -iwholename '*third_party/CMakeLists.txt*' \ -not -iwholename '*third_party/CMakeLists.txt*' \
-not -iwholename '*third_party/gflags/CMakeLists.txt*' \
-not -iwholename '*third_party/glog/CMakeLists.txt*' \
-exec rm -rf {} \; -exec rm -rf {} \;
cat "files.txt" | while read f; do cat "files.txt" | while read f; do
@ -32,19 +29,11 @@ done
rm -rf $tmp rm -rf $tmp
chmod 664 ./third_party/glog/src/windows/*.cc ./third_party/glog/src/windows/*.h ./third_party/glog/src/windows/glog/*.h
sources=`find ./libmv -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep -v _test.cc | grep -v test_data_sets | sed -r 's/^\.\//\t\t/' | sort -d` sources=`find ./libmv -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep -v _test.cc | grep -v test_data_sets | sed -r 's/^\.\//\t\t/' | sort -d`
headers=`find ./libmv -type f -iname '*.h' | grep -v test_data_sets | sed -r 's/^\.\//\t\t/' | sort -d` headers=`find ./libmv -type f -iname '*.h' | grep -v test_data_sets | sed -r 's/^\.\//\t\t/' | sort -d`
third_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep -v glog | grep -v gflags | grep -v ceres | sed -r 's/^\.\//\t\t/' | sort -d` third_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep -v ceres | sed -r 's/^\.\//\t\t/' | sort -d`
third_headers=`find ./third_party -type f -iname '*.h' | grep -v glog | grep -v gflags | grep -v ceres | sed -r 's/^\.\//\t\t/' | sort -d` third_headers=`find ./third_party -type f -iname '*.h' | grep -v ceres | sed -r 's/^\.\//\t\t/' | sort -d`
third_glog_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep glog | grep -v windows | sed -r 's/^\.\//\t\t\t/' | sort -d`
third_glog_headers=`find ./third_party -type f -iname '*.h' | grep glog | grep -v windows | sed -r 's/^\.\//\t\t\t/' | sort -d`
third_gflags_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep gflags | grep -v windows | sed -r 's/^\.\//\t\t/' | sort -d`
third_gflags_headers=`find ./third_party -type f -iname '*.h' | grep gflags | grep -v windows | sed -r 's/^\.\//\t\t/' | sort -d`
tests=`find ./libmv -type f -iname '*_test.cc' | sort -d | awk ' { name=gensub(".*/([A-Za-z_]+)_test.cc", "\\\\1", $1); printf("\t\tBLENDER_SRC_GTEST(\"libmv_%s\" \"%s\" \"libmv_test_dataset;extern_libmv;extern_ceres\")\n", name, $1) } '` tests=`find ./libmv -type f -iname '*_test.cc' | sort -d | awk ' { name=gensub(".*/([A-Za-z_]+)_test.cc", "\\\\1", $1); printf("\t\tBLENDER_SRC_GTEST(\"libmv_%s\" \"%s\" \"libmv_test_dataset;extern_libmv;extern_ceres\")\n", name, $1) } '`
@ -55,10 +44,6 @@ win_src=""
for x in $src_dir $src_third_dir; do for x in $src_dir $src_third_dir; do
t="" t=""
if test `echo "$x" | grep -c glog ` -eq 1; then
continue;
fi
if stat $x/*.cpp > /dev/null 2>&1; then if stat $x/*.cpp > /dev/null 2>&1; then
t=" src += env.Glob('`echo $x'/*.cpp'`')" t=" src += env.Glob('`echo $x'/*.cpp'`')"
fi fi
@ -155,8 +140,8 @@ add_subdirectory(third_party)
if(WITH_LIBMV) if(WITH_LIBMV)
list(APPEND INC list(APPEND INC
third_party/gflags ../gflags
third_party/glog/src ../glog/src
third_party/ceres/include third_party/ceres/include
third_party/ceres/config third_party/ceres/config
../../intern/guardedalloc ../../intern/guardedalloc

@ -133,66 +133,6 @@ libmv/tracking/track_region.cc
libmv/tracking/track_region.h libmv/tracking/track_region.h
libmv/tracking/trklt_region_tracker.cc libmv/tracking/trklt_region_tracker.cc
libmv/tracking/trklt_region_tracker.h libmv/tracking/trklt_region_tracker.h
third_party/gflags/AUTHORS.txt
third_party/gflags/ChangeLog.txt
third_party/gflags/config.h
third_party/gflags/COPYING.txt
third_party/gflags/gflags.cc
third_party/gflags/gflags_completions.cc
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/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
third_party/glog/AUTHORS
third_party/glog/ChangeLog
third_party/glog/COPYING
third_party/glog/NEWS
third_party/glog/README
third_party/glog/README.libmv
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.cc
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/logging.cc
third_party/glog/src/raw_logging.cc
third_party/glog/src/signalhandler.cc
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.cc
third_party/glog/src/symbolize.h
third_party/glog/src/utilities.cc
third_party/glog/src/utilities.h
third_party/glog/src/vlog_is_on.cc
third_party/glog/src/windows/config.h
third_party/glog/src/windows/glog/logging.h
third_party/glog/src/windows/glog/log_severity.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/port.cc
third_party/glog/src/windows/port.h
third_party/glog/src/windows/preprocess.sh
third_party/msinttypes/inttypes.h third_party/msinttypes/inttypes.h
third_party/msinttypes/README.libmv third_party/msinttypes/README.libmv
third_party/msinttypes/stdint.h third_party/msinttypes/stdint.h

@ -3,6 +3,4 @@
find ./libmv/ -type f | sed -r 's/^\.\///' | sort > files.txt find ./libmv/ -type f | sed -r 's/^\.\///' | sort > files.txt
find ./third_party/ -mindepth 2 -type f | \ find ./third_party/ -mindepth 2 -type f | \
grep -v third_party/ceres | \ 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 sed -r 's/^\.\///' | sort >> files.txt

@ -1,8 +1,26 @@
# ***** 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): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
if(WITH_LIBMV) if(WITH_LIBMV)
add_subdirectory(ceres) add_subdirectory(ceres)
endif() endif()
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
add_subdirectory(gflags)
add_subdirectory(glog)
endif()

@ -31,7 +31,7 @@ set(INC
include include
internal internal
config config
../gflags ../../../gflags/src
../../ ../../
) )
@ -298,7 +298,7 @@ endif()
if(WIN32) if(WIN32)
list(APPEND INC list(APPEND INC
../glog/src/windows ../../../glog/src/windows
) )
if(NOT MINGW) if(NOT MINGW)
@ -308,7 +308,7 @@ if(WIN32)
endif() endif()
else() else()
list(APPEND INC list(APPEND INC
../glog/src ../../../glog/src
) )
endif() endif()

@ -132,11 +132,11 @@ if(CYCLES_STANDALONE_REPOSITORY)
unset(_lib_DIR) unset(_lib_DIR)
else() else()
if(WIN32) if(WIN32)
set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/libmv/third_party/glog/src/windows) set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src/windows)
set(GFLAGS_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/libmv/third_party/gflags) set(GFLAGS_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/gflags/src)
else() else()
set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/libmv/third_party/glog/src) set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src)
set(GFLAGS_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/libmv/third_party/gflags) set(GFLAGS_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/gflags/src)
endif() endif()
set(GFLAGS_NAMESPACE "gflags") set(GFLAGS_NAMESPACE "gflags")
set(LLVM_LIBRARIES ${LLVM_LIBRARY}) set(LLVM_LIBRARIES ${LLVM_LIBRARY})