From 06b04fa8862eee030ea4024f020992664c3457fe Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 25 Mar 2011 05:23:58 +0000 Subject: dont return a system path if cmake's 'WITH_INSTALL_PORTABLE' is enabled. this way portable builds wont find scripts in /usr/share. --- CMakeLists.txt | 6 +----- intern/ghost/CMakeLists.txt | 4 +++- intern/ghost/intern/GHOST_SystemPathsX11.cpp | 10 +++++----- intern/ghost/intern/GHOST_SystemX11.cpp | 4 ---- intern/ghost/intern/GHOST_WindowX11.cpp | 2 +- 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73437c63635..81263095bf8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,11 +111,7 @@ endif() # 3D format support # disable opencollada on non-apple unix because opencollada has no package for debian -if(UNIX AND NOT APPLE) - option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" OFF) -else() - option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" OFF) -endif() +option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" OFF) # Sound output option(WITH_SDL "Enable SDL for sound and joystick support" ON) diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index d629b44a106..6c86cf82f0e 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -137,7 +137,9 @@ elseif(UNIX) intern/GHOST_WindowX11.h ) - add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}") + if(NOT WITH_INSTALL_PORTABLE) + add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}") + endif() if(X11_XF86keysym_INCLUDE_PATH) add_definitions(-DWITH_XF86KEYSYM) diff --git a/intern/ghost/intern/GHOST_SystemPathsX11.cpp b/intern/ghost/intern/GHOST_SystemPathsX11.cpp index 30c45de47bc..dd8935732c5 100644 --- a/intern/ghost/intern/GHOST_SystemPathsX11.cpp +++ b/intern/ghost/intern/GHOST_SystemPathsX11.cpp @@ -43,11 +43,6 @@ #include // for fprintf only #include // for exit -#ifndef PREFIX -# define PREFIX "/usr/local" -#endif - - using namespace std; GHOST_SystemPathsX11::GHOST_SystemPathsX11() @@ -60,7 +55,12 @@ GHOST_SystemPathsX11::~GHOST_SystemPathsX11() const GHOST_TUns8* GHOST_SystemPathsX11::getSystemDir() const { + /* no prefix assumes a portable build which only uses bundled scripts */ +#ifdef PREFIX return (GHOST_TUns8*) PREFIX "/share"; +#else + return NULL; +#endif } const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 36748b9f295..e2ee7044392 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -76,10 +76,6 @@ #include // for fprintf only #include // for exit -#ifndef PREFIX -#error "PREFIX not defined" -#endif - typedef struct NDOFPlatformInfo { Display *display; Window window; diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index 3578ae8619f..aea5b5156d9 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -455,6 +455,7 @@ GHOST_WindowX11( XFlush(m_display); } +#ifdef WITH_X11_XINPUT /* Dummy function to get around IO Handler exiting if device invalid Basically it will not crash blender now if you have a X device that @@ -495,7 +496,6 @@ static bool match_token(const char *haystack, const char *needle) return FALSE; } -#ifdef WITH_X11_XINPUT /* Determining if an X device is a Tablet style device is an imperfect science. ** We rely on common conventions around device names as well as the type reported -- cgit v1.2.3