Rather then hard coded /usr/share, use CMAKE_INSTALL_PREFIX to set the PREFIX, could...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 15 Jul 2010 20:25:09 +0000 (20:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 15 Jul 2010 20:25:09 +0000 (20:25 +0000)
intern/ghost/CMakeLists.txt
intern/ghost/intern/GHOST_SystemX11.cpp

index 1a7627c..c262ea8 100644 (file)
@@ -85,6 +85,9 @@ ELSEIF(UNIX)
                ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp
                ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp
        )
+
+       ADD_DEFINITIONS(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
+
 ENDIF(APPLE)
 
 BLENDERLIB(bf_ghost "${SRC}" "${INC}")
index c9228e6..961a637 100644 (file)
 #include <stdio.h> // for fprintf only
 #include <cstdlib> // for exit
 
+#ifndef PREFIX
+#  define PREFIX "/usr/local"
+#endif
+
 typedef struct NDOFPlatformInfo {
        Display *display;
        Window window;
@@ -1461,7 +1465,7 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
 
 const GHOST_TUns8* GHOST_SystemX11::getSystemDir() const
 {
-       return (GHOST_TUns8*)"/usr/share";
+       return (GHOST_TUns8*) PREFIX "/share";
 }
 
 const GHOST_TUns8* GHOST_SystemX11::getUserDir() const