dont return a system path if cmake's 'WITH_INSTALL_PORTABLE' is enabled. this way...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 25 Mar 2011 05:23:58 +0000 (05:23 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 25 Mar 2011 05:23:58 +0000 (05:23 +0000)
CMakeLists.txt
intern/ghost/CMakeLists.txt
intern/ghost/intern/GHOST_SystemPathsX11.cpp
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_WindowX11.cpp

index 73437c6..8126309 100644 (file)
@@ -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)
index d629b44..6c86cf8 100644 (file)
@@ -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)
index 30c45de..dd89357 100644 (file)
 #include <stdio.h> // for fprintf only
 #include <cstdlib> // 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
index 36748b9..e2ee704 100644 (file)
 #include <stdio.h> // for fprintf only
 #include <cstdlib> // for exit
 
-#ifndef PREFIX
-#error "PREFIX not defined"
-#endif
-
 typedef struct NDOFPlatformInfo {
        Display *display;
        Window window;
index 3578ae8..aea5b51 100644 (file)
@@ -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