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
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
1 files changed, 22 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a91e1b655a..748ed649800 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -363,6 +363,10 @@ option(WITH_LIBMV "Enable Libmv structure from motion library" ON)
option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." OFF)
mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
+# Logging/unbit test libraries.
+option(WITH_SYSTEM_GFLAGS "Use system-wide Gflags instead of a bundled one" OFF)
+mark_as_advanced(WITH_SYSTEM_GFLAGS)
+
# Freestyle
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
@@ -1317,15 +1321,27 @@ endif()
# Configure GLog/GFlags
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
+ if(WITH_SYSTEM_GFLAGS)
+ find_package(Gflags)
+ if(NOT GFLAGS_FOUND)
+ message(FATAL_ERROR "System wide Gflags is requested but was not found")
+ endif()
+ # FindGflags does not define this, and we are not even sure what to use here.
+ set(GFLAGS_DEFINES)
+ else()
+ set(GFLAGS_DEFINES
+ -DGFLAGS_DLL_DEFINE_FLAG=
+ -DGFLAGS_DLL_DECLARE_FLAG=
+ -DGFLAGS_DLL_DECL=
+ )
+ set(GFLAGS_NAMESPACE "gflags")
+ set(GFLAGS_LIBRARIES extern_gflags)
+ set(GFLAGS_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/extern/gflags/src")
+ endif()
+
set(GLOG_DEFINES
-DGOOGLE_GLOG_DLL_DECL=
)
-
- set(GFLAGS_DEFINES
- -DGFLAGS_DLL_DEFINE_FLAG=
- -DGFLAGS_DLL_DECLARE_FLAG=
- -DGFLAGS_DLL_DECL=
- )
endif()
#-----------------------------------------------------------------------------