Better unix filesystem integration as documented here

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/Unix_FHS

for scons WITH_BF_FHS enabled an alternative layout eg.
scons WITH_BF_FHS=1 BF_INSTALLDIR="/usr/local"

for CMake just run "make install" after make (CMAKE_INSTALL_PREFIX is used for the base path)

Currently only scripts use both the system and user path correctly, other areas of blender have their own path code inline with lots of ifdefs, needs to be carefully updated.
This commit is contained in:
Campbell Barton
2009-09-21 03:16:26 +00:00
parent 6c655aa2a7
commit e7abdd7d56
20 changed files with 273 additions and 163 deletions

View File

@@ -66,6 +66,13 @@ IF(NOT WITH_SDL)
ADD_DEFINITIONS(-DDISABLE_SDL)
ENDIF(NOT WITH_SDL)
IF(UNIX AND NOT APPLE)
SET(BLENDERPATH ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION})
CMAKE_POLICY(SET CMP0005 NEW)
# blender_path in creator.c
ADD_DEFINITIONS(-DBLENDERPATH="${BLENDERPATH}")
ENDIF(UNIX AND NOT APPLE)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
ADD_DEFINITIONS(-DWITH_BINRELOC)
INCLUDE_DIRECTORIES(${BINRELOC_INC})
@@ -96,6 +103,9 @@ IF(WITH_INSTALL)
ENDIF(UNIX)
IF(UNIX AND NOT APPLE)
# Local installation, "make install" can be done after this optionally
ADD_CUSTOM_COMMAND(
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
COMMAND rm -Rf ${TARGETDIR}/.blender
@@ -152,6 +162,27 @@ IF(WITH_INSTALL)
COMMAND find ${TARGETDIR} -name .svn -prune -exec rm -rf {} "\;"
)
# Above we bundle a portable distrobution in ./bin
# This is an optional "make install" which installs blender on the system.
INSTALL(
PROGRAMS ${TARGETDIR}/blender
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
IF(WITH_GAMEENGINE AND WITH_PLAYER)
INSTALL(
PROGRAMS ${TARGETDIR}/blenderplayer
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
ENDIF(WITH_GAMEENGINE AND WITH_PLAYER)
INSTALL(
DIRECTORY ${TARGETDIR}/.blender/
DESTINATION ${BLENDERPATH}
)
# end "make install"
ENDIF(UNIX AND NOT APPLE)
IF(APPLE)