Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Commit

Permalink
Building: avoid full rebuild when changing YAF_RUNTIME_SEARCH_PLUGIN_…
Browse files Browse the repository at this point in the history
…DIR CMake variable
  • Loading branch information
DavidBluecame committed Mar 14, 2017
1 parent 11551b7 commit 8c374d3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CMakeConfig/templates/yaf_version.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
// the intention is to link the YafaRay Core version to the git information obtained, for example with:
// cmake /yafaray/src/Core -DYAFARAY_CORE_VERSION=`git --git-dir=/yafaray/src/Core/.git --work-tree=/yafaray/src/Core describe --dirty --always --tags --long`

// This file is now also used to store the runtime search path for the plugins, if needed

#ifndef Y_VERSION_H
#define Y_VERSION_H
#define YAFARAY_CORE_VERSION "@YAFARAY_CORE_VERSION@@DEBUG@"
#define YAF_RUNTIME_SEARCH_PLUGIN_DIR "@YAF_RUNTIME_SEARCH_PLUGIN_DIR@"
#endif
2 changes: 0 additions & 2 deletions CMakeConfig/templates/yafray_config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include <core_api/color_console.h>
#include <core_api/session.h>

#define YAF_RUNTIME_SEARCH_PLUGIN_DIR "@YAF_RUNTIME_SEARCH_PLUGIN_DIR@"

#define MIN_RAYDIST @YAF_MIN_RAY_DIST@
#define YAF_SHADOW_BIAS @YAF_SHADOW_BIAS@

Expand Down
1 change: 1 addition & 0 deletions include/core_api/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class YAFRAYCORE_EXPORT session_t
float currentPassPercent();
bool isInteractive();
std::string getPathYafaRayXml();
std::string getConfiguredRuntimeSearchPathYafaRayPlugins();
std::string getPathImageOutput();
std::string getYafaRayCoreVersion();

Expand Down
2 changes: 1 addition & 1 deletion src/yafraycore/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ bool renderEnvironment_t::getPluginPath(std::string &path)
}

// If the previous checks do not work, check if the plugins path is in the plugins search directory defined in CMake during the building process
path = std::string(YAF_RUNTIME_SEARCH_PLUGIN_DIR);
path = std::string(session.getConfiguredRuntimeSearchPathYafaRayPlugins());
if ( boost::filesystem::exists( path ) )
{
Y_VERBOSE_ENV << "Plugins path found: '" << path << "'" << yendl;
Expand Down
5 changes: 5 additions & 0 deletions src/yafraycore/session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ std::string session_t::getPathYafaRayXml()
return mPathYafaRayXml;
}

std::string session_t::getConfiguredRuntimeSearchPathYafaRayPlugins()
{
return YAF_RUNTIME_SEARCH_PLUGIN_DIR;
}

std::string session_t::getPathImageOutput()
{
if(mPathImageOutput.empty())
Expand Down

0 comments on commit 8c374d3

Please sign in to comment.