Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-04-21 11:58:01 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-04-21 13:01:27 +0300
commitc7a5c48cbad0062c55bf9fa6df2926646b2c3091 (patch)
treed53c082e2c1d58bea374017f435269ccc2892e7d /intern
parent55a3d48046377444a3c36ffe7a6164030d447f6f (diff)
CMake: Add option to link against system-wide Gflags library
It is disabled by default, so should not affect existing configurations. Main benefits of this goes as: - Linux distros can use that to avoid libraries duplication and link blender package against gflags package from the system. - It it easier to test whether Blender works with updated version of Gflags prior to re-bundling the library.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/app/CMakeLists.txt2
-rw-r--r--intern/cycles/cmake/external_libs.cmake3
-rw-r--r--intern/libmv/CMakeLists.txt3
-rwxr-xr-xintern/libmv/bundle.sh2
-rw-r--r--intern/libmv/intern/logging.cc22
5 files changed, 16 insertions, 16 deletions
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt
index aabb8f63640..231ef58f7ae 100644
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@ -45,7 +45,7 @@ if(CYCLES_STANDALONE_REPOSITORY)
else()
list(APPEND LIBRARIES bf_intern_glew_mx bf_intern_guardedalloc)
if(WITH_CYCLES_LOGGING)
- list(APPEND LIBRARIES extern_glog extern_gflags)
+ list(APPEND LIBRARIES extern_glog ${GFLAGS_LIBRARIES})
endif()
endif()
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index 403a0540963..68e7f0a6eac 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -137,11 +137,8 @@ if(CYCLES_STANDALONE_REPOSITORY)
else()
if(WIN32)
set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src/windows)
- set(GFLAGS_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/gflags/src)
else()
set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src)
- set(GFLAGS_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/gflags/src)
endif()
- set(GFLAGS_NAMESPACE "gflags")
set(LLVM_LIBRARIES ${LLVM_LIBRARY})
endif()
diff --git a/intern/libmv/CMakeLists.txt b/intern/libmv/CMakeLists.txt
index cd89f1d84b5..b67a23b4159 100644
--- a/intern/libmv/CMakeLists.txt
+++ b/intern/libmv/CMakeLists.txt
@@ -41,9 +41,10 @@ if(WITH_LIBMV)
add_definitions(${GFLAGS_DEFINES})
add_definitions(${GLOG_DEFINES})
add_definitions(${CERES_DEFINES})
+ add_definitions(-DLIBMV_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE})
list(APPEND INC
- ../../extern/gflags/src
+ ${GFLAGS_INCLUDE_DIRS}
../../extern/glog/src
../../extern/ceres/include
../../extern/ceres/config
diff --git a/intern/libmv/bundle.sh b/intern/libmv/bundle.sh
index b1a4be84e53..27e012f665f 100755
--- a/intern/libmv/bundle.sh
+++ b/intern/libmv/bundle.sh
@@ -122,7 +122,7 @@ if(WITH_LIBMV)
add_definitions(\${CERES_DEFINES})
list(APPEND INC
- ../../extern/gflags/src
+ \${GFLAGS_INCLUDE_DIRS}
../../extern/glog/src
../../extern/ceres/include
../../extern/ceres/config
diff --git a/intern/libmv/intern/logging.cc b/intern/libmv/intern/logging.cc
index 77b56ef4df3..9b8adf09a97 100644
--- a/intern/libmv/intern/logging.cc
+++ b/intern/libmv/intern/logging.cc
@@ -29,27 +29,29 @@
#include "libmv/logging/logging.h"
void libmv_initLogging(const char* argv0) {
+ using LIBMV_GFLAGS_NAMESPACE::SetCommandLineOption;
// Make it so FATAL messages are always print into console.
char severity_fatal[32];
snprintf(severity_fatal, sizeof(severity_fatal), "%d",
google::GLOG_FATAL);
-
google::InitGoogleLogging(argv0);
- gflags::SetCommandLineOption("logtostderr", "1");
- gflags::SetCommandLineOption("v", "0");
- gflags::SetCommandLineOption("stderrthreshold", severity_fatal);
- gflags::SetCommandLineOption("minloglevel", severity_fatal);
+ SetCommandLineOption("logtostderr", "1");
+ SetCommandLineOption("v", "0");
+ SetCommandLineOption("stderrthreshold", severity_fatal);
+ SetCommandLineOption("minloglevel", severity_fatal);
}
void libmv_startDebugLogging(void) {
- gflags::SetCommandLineOption("logtostderr", "1");
- gflags::SetCommandLineOption("v", "2");
- gflags::SetCommandLineOption("stderrthreshold", "1");
- gflags::SetCommandLineOption("minloglevel", "0");
+ using LIBMV_GFLAGS_NAMESPACE::SetCommandLineOption;
+ SetCommandLineOption("logtostderr", "1");
+ SetCommandLineOption("v", "2");
+ SetCommandLineOption("stderrthreshold", "1");
+ SetCommandLineOption("minloglevel", "0");
}
void libmv_setLoggingVerbosity(int verbosity) {
+ using LIBMV_GFLAGS_NAMESPACE::SetCommandLineOption;
char val[10];
snprintf(val, sizeof(val), "%d", verbosity);
- gflags::SetCommandLineOption("v", val);
+ SetCommandLineOption("v", val);
}