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:
-rw-r--r--CMakeLists.txt1
-rw-r--r--intern/cycles/app/CMakeLists.txt2
-rw-r--r--intern/cycles/app/cycles_standalone.cpp24
-rw-r--r--intern/cycles/cmake/external_libs.cmake2
-rw-r--r--intern/cycles/util/CMakeLists.txt2
5 files changed, 24 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a8df8301584..c956fb2ca8c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -262,6 +262,7 @@ mark_as_advanced(PYTHON_NUMPY_PATH)
# Cycles
option(WITH_CYCLES "Enable cycles Render Engine" ON)
option(WITH_CYCLES_STANDALONE "Build cycles standalone application" OFF)
+option(WITH_CYCLES_STANDALONE_GUI "Build cycles standalone with GUI" OFF)
option(WITH_CYCLES_OSL "Build Cycles with OSL support" OFF)
option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF)
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 CACHE STRING "CUDA architectures to build binaries for")
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt
index 347da075d05..ded00f61b36 100644
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@ -27,7 +27,7 @@ set(LIBRARIES
link_directories(${OPENIMAGEIO_LIBPATH} ${BOOST_LIBPATH})
-if(WITH_CYCLES_STANDALONE)
+if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
list(APPEND LIBRARIES ${GLUT_LIBRARIES})
endif()
diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles_standalone.cpp
index 9a193548d7a..2a438397ae0 100644
--- a/intern/cycles/app/cycles_standalone.cpp
+++ b/intern/cycles/app/cycles_standalone.cpp
@@ -29,7 +29,10 @@
#include "util_progress.h"
#include "util_string.h"
#include "util_time.h"
+
+#ifdef WITH_CYCLES_STANDALONE_GUI
#include "util_view.h"
+#endif
#include "cycles_xml.h"
@@ -100,8 +103,10 @@ static void session_init()
if(options.session_params.background && !options.quiet)
options.session->progress.set_update_callback(function_bind(&session_print_status));
+#ifdef WITH_CYCLES_STANDALONE_GUI
else
options.session->progress.set_update_callback(function_bind(&view_redraw));
+#endif
options.session->start();
@@ -136,6 +141,7 @@ static void session_exit()
}
}
+#ifdef WITH_CYCLES_STANDALONE_GUI
static void display_info(Progress& progress)
{
static double latency = 0.0;
@@ -186,6 +192,7 @@ static void keyboard(unsigned char key)
else if(key == 27) // escape
options.session->progress.set_cancel("Cancelled");
}
+#endif
static int files_parse(int argc, const char *argv[])
{
@@ -271,8 +278,14 @@ static void options_parse(int argc, const char **argv)
else if(ssname == "svm")
options.scene_params.shadingsystem = SceneParams::SVM;
- /* Progressive rendering */
- options.session_params.progressive = true;
+#ifdef WITH_CYCLES_STANDALONE_GUI
+ /* Progressive rendering for GUI */
+ if(!options.session_params.background)
+ options.session_params.progressive = true;
+#else
+ /* When building without GUI, set background */
+ options.session_params.background = true;
+#endif
/* find matching device */
DeviceType device_type = Device::type_from_string(devicename.c_str());
@@ -325,13 +338,15 @@ using namespace ccl;
int main(int argc, const char **argv)
{
path_init();
-
options_parse(argc, argv);
-
+
+#ifdef WITH_CYCLES_STANDALONE_GUI
if(options.session_params.background) {
+#endif
session_init();
options.session->wait();
session_exit();
+#ifdef WITH_CYCLES_STANDALONE_GUI
}
else {
string title = "Cycles: " + path_filename(options.filepath);
@@ -340,6 +355,7 @@ int main(int argc, const char **argv)
view_main_loop(title.c_str(), options.width, options.height,
session_init, session_exit, resize, display, keyboard);
}
+#endif
return 0;
}
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index 6164572c264..8753ff4bf84 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -2,7 +2,7 @@
###########################################################################
# GLUT
-if(WITH_CYCLES_STANDALONE)
+if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
set(GLUT_ROOT_PATH ${CYCLES_GLUT})
find_package(GLUT)
diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt
index 36c89b979e2..ce5ba44abe9 100644
--- a/intern/cycles/util/CMakeLists.txt
+++ b/intern/cycles/util/CMakeLists.txt
@@ -22,7 +22,7 @@ set(SRC
util_transform.cpp
)
-if(WITH_CYCLES_STANDALONE)
+if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
list(APPEND SRC
util_view.cpp
)