From 1b2ee6749da66e87f905a9c46bc9a4bc44bd9f05 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 11 Jan 2018 08:28:44 -0800 Subject: [PATCH] Fix blender detection and build errors on linux --- hecl-gui/CMakeLists.txt | 2 ++ hecl-gui/FindBlender.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/hecl-gui/CMakeLists.txt b/hecl-gui/CMakeLists.txt index f40964b7f..03a913186 100644 --- a/hecl-gui/CMakeLists.txt +++ b/hecl-gui/CMakeLists.txt @@ -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) diff --git a/hecl-gui/FindBlender.cpp b/hecl-gui/FindBlender.cpp index 393c53003..c3fb36378 100644 --- a/hecl-gui/FindBlender.cpp +++ b/hecl-gui/FindBlender.cpp @@ -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