Fix blender detection and build errors on linux

This commit is contained in:
Phillip Stephens 2018-01-11 08:28:44 -08:00
parent 60c6a6bf2b
commit 1b2ee6749d
2 changed files with 12 additions and 0 deletions

View File

@ -12,6 +12,8 @@ if(APPLE)
set(PLAT_SRCS MacOSSystemVersion.hpp MacOSSystemVersion.mm)
find_library(FOUNDATION_LIBRARY Foundation)
set(PLAT_LIBS ${FOUNDATION_LIBRARY})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(PLAT_LIBS pthread dl)
endif()
if(WIN32)

View File

@ -7,6 +7,8 @@ namespace hecl::blender
#ifdef __APPLE__
#define DEFAULT_BLENDER_BIN "/Applications/Blender.app/Contents/MacOS/blender"
#elif __linux__
#define DEFAULT_BLENDER_BIN "/usr/bin/blender"
#else
#define DEFAULT_BLENDER_BIN "blender"
#endif
@ -87,6 +89,14 @@ hecl::SystemString FindBlender(int& major, int& minor)
}
}
}
else
{
blenderBin = DEFAULT_BLENDER_BIN;
if (!RegFileExists(blenderBin))
{
blenderBin = nullptr;
}
}
}
#endif