diff options
author | Nick Samarin <nicks1987@bigmir.net> | 2011-06-05 22:51:00 +0400 |
---|---|---|
committer | Nick Samarin <nicks1987@bigmir.net> | 2011-06-05 22:51:00 +0400 |
commit | 5ceb8b3d35706e13580d4eed0f24acc8e57f3464 (patch) | |
tree | 8f7a8078b94bc7512abc37baaadedd7ff5fad7f4 /source/creator | |
parent | a918040902bdeb7c9793168710871e4a3b7777a3 (diff) | |
parent | 08f44adba965dbf4f7c56eb096b0e2709df80e5c (diff) |
synched with trunk at revision 37212
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/CMakeLists.txt | 214 | ||||
-rw-r--r-- | source/creator/creator.c | 22 |
2 files changed, 110 insertions, 126 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 5ea0c28d347..9c9f0d0905c 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -81,6 +81,10 @@ if(WITH_PYTHON) endif() endif() +if(WITH_HEADLESS) + add_definitions(-DWITH_HEADLESS) +endif() + if(WITH_GAMEENGINE) blender_include_dirs(../gameengine/BlenderRoutines) @@ -191,10 +195,10 @@ if(WITH_PYTHON_MODULE) set_target_properties( blender PROPERTIES - PREFIX "" - OUTPUT_NAME bpy - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/ - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/ # only needed on windows + PREFIX "" + OUTPUT_NAME bpy + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin # only needed on windows ) if(WIN32) @@ -202,7 +206,7 @@ if(WITH_PYTHON_MODULE) set_target_properties( blender PROPERTIES - SUFFIX ".pyd" + SUFFIX ".pyd" ) endif() @@ -233,7 +237,11 @@ if(UNIX AND NOT APPLE) if(WITH_INSTALL_PORTABLE) set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION}) else() - set(TARGETDIR_VER ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION}) + if(WITH_PYTHON_MODULE) + set(TARGETDIR_VER ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/${BLENDER_VERSION}) + else() + set(TARGETDIR_VER ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION}) + endif() endif() # important to make a clean install each time @@ -253,9 +261,9 @@ if(UNIX AND NOT APPLE) if(WITH_INSTALL_PORTABLE) install( FILES - ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop - ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg - ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1 + ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop + ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg + ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1 DESTINATION ${TARGETDIR} ) @@ -266,17 +274,26 @@ if(UNIX AND NOT APPLE) ) install( - DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/ + DIRECTORY ${CMAKE_SOURCE_DIR}/release/text DESTINATION ${TARGETDIR} PATTERN ".svn" EXCLUDE ) else() # main blender binary - install( - PROGRAMS ${TARGETDIR}/blender - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin - ) + if(WITH_PYTHON_MODULE) + install( + TARGETS blender + LIBRARY + DESTINATION ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages + ) + else() + install( + PROGRAMS ${TARGETDIR}/blender + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + ) + endif() + if(WITH_GAMEENGINE AND WITH_PLAYER) install( @@ -292,13 +309,13 @@ if(UNIX AND NOT APPLE) ) install( DIRECTORY - ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/16x16 - ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/22x22 - ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/24x24 - ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32 - ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48 - ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256 - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/ + ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/16x16 + ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/22x22 + ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/24x24 + ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32 + ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48 + ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256 + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor PATTERN ".svn" EXCLUDE PATTERN "*.svg" EXCLUDE ) @@ -315,7 +332,7 @@ if(UNIX AND NOT APPLE) DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1 ) install( - DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/ + DIRECTORY ${CMAKE_SOURCE_DIR}/release/text DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender PATTERN ".svn" EXCLUDE ) @@ -334,7 +351,7 @@ if(UNIX AND NOT APPLE) install( DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale - DESTINATION ${TARGETDIR_VER}/datafiles/ + DESTINATION ${TARGETDIR_VER}/datafiles PATTERN ".svn" EXCLUDE ) endif() @@ -343,7 +360,7 @@ if(UNIX AND NOT APPLE) # # install( # DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins - # DESTINATION ${TARGETDIR_VER}/ + # DESTINATION ${TARGETDIR_VER} # PATTERN ".svn" EXCLUDE # ) @@ -351,7 +368,7 @@ if(UNIX AND NOT APPLE) # install(CODE "message(\"copying blender scripts...\")") install( DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts - DESTINATION ${TARGETDIR_VER}/ + DESTINATION ${TARGETDIR_VER} PATTERN ".svn" EXCLUDE PATTERN "__pycache__" EXCLUDE ) @@ -362,9 +379,9 @@ if(UNIX AND NOT APPLE) # install(CODE "message(\"copying a subset of the systems python...\")") install( DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION} - DESTINATION ${TARGETDIR_VER}/python/lib/ + DESTINATION ${TARGETDIR_VER}/python/lib PATTERN ".svn" EXCLUDE - PATTERN "__pycache__" EXCLUDE # ./distutils + PATTERN "__pycache__" EXCLUDE # * any cache * PATTERN "distutils" EXCLUDE # ./distutils PATTERN "lib2to3" EXCLUDE # ./lib2to3 PATTERN "config" EXCLUDE # ./config @@ -372,8 +389,10 @@ if(UNIX AND NOT APPLE) PATTERN "site-packages/*" EXCLUDE # ./site-packages/* PATTERN "tkinter" EXCLUDE # ./tkinter PATTERN "lib-dynload/_tkinter.*" EXCLUDE # ./lib-dynload/_tkinter.co + PATTERN "idlelib" EXCLUDE # ./idlelib PATTERN "test" EXCLUDE # ./test PATTERN "turtledemo" EXCLUDE # ./turtledemo + PATTERN "turtle.py" EXCLUDE # ./turtle.py ) # # doesnt work, todo @@ -390,8 +409,8 @@ elseif(WIN32) ) install( # same as linux!, deduplicate - DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/ - DESTINATION ${TARGETDIR}/ + DIRECTORY ${CMAKE_SOURCE_DIR}/release/text + DESTINATION ${TARGETDIR} PATTERN ".svn" EXCLUDE ) @@ -407,25 +426,25 @@ elseif(WIN32) ) install( DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale - DESTINATION ${TARGETDIR_VER}/datafiles/ + DESTINATION ${TARGETDIR_VER}/datafiles PATTERN ".svn" EXCLUDE ) if(NOT CMAKE_CL_64) install( FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll - DESTINATION ${TARGETDIR}/ + DESTINATION ${TARGETDIR} ) install( FILES ${LIBDIR}/iconv/lib/iconv.dll - DESTINATION ${TARGETDIR}/ + DESTINATION ${TARGETDIR} ) endif() endif() install( # same as linux!, deduplicate - DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale/ + DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale DESTINATION ${TARGETDIR_VER}/datafiles/locale PATTERN ".svn" EXCLUDE ) @@ -434,7 +453,7 @@ elseif(WIN32) # # install( # DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins - # DESTINATION ${TARGETDIR_VER}/ + # DESTINATION ${TARGETDIR_VER} # PATTERN ".svn" EXCLUDE # ) @@ -442,64 +461,48 @@ elseif(WIN32) # install(CODE "message(\"copying blender scripts...\")") install( # same as linux!, deduplicate DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts - DESTINATION ${TARGETDIR_VER}/ + DESTINATION ${TARGETDIR_VER} PATTERN ".svn" EXCLUDE PATTERN "__pycache__" EXCLUDE ) - # TODO, multiple targets? - install(FILES ${LIBDIR}/python/lib/python32.dll DESTINATION ${TARGETDIR}/ CONFIGURATIONS Release) - install(FILES ${LIBDIR}/python/lib/python32.dll DESTINATION ${TARGETDIR}/ CONFIGURATIONS RelWithDebInfo) - install(FILES ${LIBDIR}/python/lib/python32.dll DESTINATION ${TARGETDIR}/ CONFIGURATIONS MinSizeRel) + install( + FILES ${LIBDIR}/python/lib/python32.dll + DESTINATION ${TARGETDIR} + CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel + ) install( FILES ${LIBDIR}/python/lib/python32_d.dll - DESTINATION ${TARGETDIR}/ + DESTINATION ${TARGETDIR} CONFIGURATIONS Debug ) if(WITH_PYTHON_INSTALL) - #~ # note, as far as python is concerned 'RelWithDebInfo' is not debug since its without debug flags. + # note, as far as python is concerned 'RelWithDebInfo' is not debug since its without debug flags. # create the directory in multiple steps, so it actually gets created when it doesn't exist yet - install(CODE " - message(\"creating ${TARGETDIR_VER}/python/lib\") - file(MAKE_DIRECTORY ${TARGETDIR_VER}/python/) - file(MAKE_DIRECTORY ${TARGETDIR_VER}/python/lib/) - message(\"done creating dir\") - ") - - install( - CODE - " - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib/\" - \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32.tar.gz\") - " - CONFIGURATIONS Release - ) install( CODE " - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib/\" - \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32.tar.gz\") + message(\"creating ${TARGETDIR_VER}/python/lib\") + file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python\") + file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python/lib\") + message(\"done creating dir\") " - CONFIGURATIONS RelWithDebInfo - ) - install( - CODE - " - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib/\" - \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32.tar.gz\") - " - CONFIGURATIONS MinSizeRel ) + install( CODE " - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib/\" - \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32_d.tar.gz\") + if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" STREQUAL \"Debug\") + execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\" + \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32_d.tar.gz\") + else() + execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\" + \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32.tar.gz\") + endif() " - CONFIGURATIONS Debug ) # doesnt work, todo @@ -511,82 +514,78 @@ elseif(WIN32) # gettext and png are statically linked on win64 install( FILES ${LIBDIR}/zlib/lib/zlib.dll - DESTINATION ${TARGETDIR}/ + DESTINATION ${TARGETDIR} ) else() install( FILES - ${LIBDIR}/png/lib/libpng.dll - ${LIBDIR}/zlib/lib/zlib.dll - DESTINATION ${TARGETDIR}/ + ${LIBDIR}/png/lib/libpng.dll + ${LIBDIR}/zlib/lib/zlib.dll + DESTINATION ${TARGETDIR} ) endif() if(MSVC) install( FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll - DESTINATION ${TARGETDIR}/ + DESTINATION ${TARGETDIR} ) else() install( FILES ${LIBDIR}/pthreads/lib/pthreadGC2.dll - DESTINATION ${TARGETDIR}/ + DESTINATION ${TARGETDIR} ) endif() if(WITH_CODEC_FFMPEG) install( FILES - ${LIBDIR}/ffmpeg/lib/avcodec-52.dll - ${LIBDIR}/ffmpeg/lib/avformat-52.dll - ${LIBDIR}/ffmpeg/lib/avdevice-52.dll - ${LIBDIR}/ffmpeg/lib/avutil-50.dll - ${LIBDIR}/ffmpeg/lib/swscale-0.dll - DESTINATION ${TARGETDIR}/ + ${LIBDIR}/ffmpeg/lib/avcodec-52.dll + ${LIBDIR}/ffmpeg/lib/avformat-52.dll + ${LIBDIR}/ffmpeg/lib/avdevice-52.dll + ${LIBDIR}/ffmpeg/lib/avutil-50.dll + ${LIBDIR}/ffmpeg/lib/swscale-0.dll + DESTINATION ${TARGETDIR} ) endif() if(WITH_CODEC_SNDFILE) install( - FILES - ${LIBDIR}/sndfile/lib/libsndfile-1.dll - DESTINATION ${TARGETDIR}/ + FILES ${LIBDIR}/sndfile/lib/libsndfile-1.dll + DESTINATION ${TARGETDIR} ) endif() if(WITH_OPENAL) install( FILES - ${LIBDIR}/openal/lib/OpenAL32.dll - ${LIBDIR}/openal/lib/wrap_oal.dll - DESTINATION ${TARGETDIR}/ + ${LIBDIR}/openal/lib/OpenAL32.dll + ${LIBDIR}/openal/lib/wrap_oal.dll + DESTINATION ${TARGETDIR} ) endif() if(WITH_SDL) if(NOT CMAKE_CL_64) install( - FILES - ${LIBDIR}/sdl/lib/SDL.dll - DESTINATION ${TARGETDIR}/ + FILES ${LIBDIR}/sdl/lib/SDL.dll + DESTINATION ${TARGETDIR} ) endif() endif() - if(NOT CMAKE_CL_64) + if(NOT CMAKE_CL_64) install( - FILES - ${LIBDIR}/thumbhandler/lib/BlendThumb.dll - DESTINATION ${TARGETDIR}/ - ) - else() + FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll + DESTINATION ${TARGETDIR} + ) + else() install( - FILES - ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll - DESTINATION ${TARGETDIR}/ - ) - endif() + FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll + DESTINATION ${TARGETDIR} + ) + endif() elseif(APPLE) set(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app) @@ -638,7 +637,7 @@ elseif(APPLE) install( FILES ${SOURCEDIR}/Contents/PkgInfo - DESTINATION ${TARGETDIR}/blender.app/Contents/ + DESTINATION ${TARGETDIR}/blender.app/Contents ) install_dir( @@ -771,7 +770,6 @@ endif() bf_imbuf_cineon bf_imbuf_openexr bf_imbuf_dds - bf_readblenfile bf_collada bf_intern_bsp bf_intern_bop @@ -812,13 +810,13 @@ endif() bf_intern_mikktspace ) - if(WITH_MOD_CLOTH_ELTOPO) + if(WITH_MOD_CLOTH_ELTOPO) list(APPEND BLENDER_SORTED_LIBS extern_eltopo) - endif() + endif() - if(WITH_BUILTIN_GLEW) + if(WITH_BUILTIN_GLEW) list(APPEND BLENDER_SORTED_LIBS extern_glew) - endif() + endif() if(WITH_BINRELOC) list(APPEND BLENDER_SORTED_LIBS extern_binreloc) diff --git a/source/creator/creator.c b/source/creator/creator.c index 2b146822194..fe9bd57d035 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -151,7 +151,7 @@ char btempdir[FILE_MAX]; #define BLEND_VERSION_STRING_FMT "Blender %d.%02d (sub %d)\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION -/* Initialise callbacks for the modules that need them */ +/* Initialize callbacks for the modules that need them */ static void setCallbacks(void); /* set breakpoints here when running in debug mode, useful to catch floating point errors */ @@ -314,7 +314,6 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data) printf ("\nEnvironment Variables:\n"); printf (" $BLENDER_USER_CONFIG Directory for user configuration files.\n"); - printf (" $BLENDER_SYSTEM_CONFIG Directory for system wide configuration files.\n"); printf (" $BLENDER_USER_SCRIPTS Directory for user scripts.\n"); printf (" $BLENDER_SYSTEM_SCRIPTS Directory for system wide scripts.\n"); printf (" $BLENDER_USER_DATAFILES Directory for user data files (icons, translations, ..).\n"); @@ -338,18 +337,6 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data) double PIL_check_seconds_timer(void); -/* XXX This was here to fix a crash when running python scripts - * with -P that used the screen. - * - * static void main_init_screen( void ) -{ - setscreen(G.curscreen); - - if(G.main->scene.first==0) { - set_scene( add_scene("1") ); - } -}*/ - static int end_arguments(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) { return -1; @@ -641,7 +628,7 @@ static int set_image_type(int argc, const char **argv, void *data) else if (!strcmp(imtype,"CINEON")) scene->r.imtype = R_CINEON; else if (!strcmp(imtype,"DPX")) scene->r.imtype = R_DPX; #endif -#if WITH_OPENJPEG +#ifdef WITH_OPENJPEG else if (!strcmp(imtype,"JP2")) scene->r.imtype = R_JP2; #endif else printf("\nError: Format from '-F / --render-format' not known or not compiled in this release.\n"); @@ -1060,7 +1047,7 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) static char debug_doc[] = "\n\tTurn debugging on\n" "\n\t* Prints every operator call and their arguments" "\n\t* Disables mouse grab (to interact with a debugger in some cases)" - "\n\t* Keeps python sys.stdin rather then setting it to None"; + "\n\t* Keeps python sys.stdin rather than setting it to None"; //BLI_argsAdd(ba, pass, short_arg, long_arg, doc, cb, C); @@ -1099,7 +1086,6 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) BLI_argsAdd(ba, 1, NULL, "--factory-startup", "\n\tSkip reading the "STRINGIFY(BLENDER_STARTUP_FILE)" in the users home directory", set_factory_startup, NULL); /* TODO, add user env vars? */ - BLI_argsAdd(ba, 1, NULL, "--env-system-config", "\n\tSet the "STRINGIFY_ARG(BLENDER_SYSTEM_CONFIG)" environment variable", set_env, NULL); BLI_argsAdd(ba, 1, NULL, "--env-system-datafiles", "\n\tSet the "STRINGIFY_ARG(BLENDER_SYSTEM_DATAFILES)" environment variable", set_env, NULL); BLI_argsAdd(ba, 1, NULL, "--env-system-scripts", "\n\tSet the "STRINGIFY_ARG(BLENDER_SYSTEM_SCRIPTS)" environment variable", set_env, NULL); BLI_argsAdd(ba, 1, NULL, "--env-system-plugins", "\n\tSet the "STRINGIFY_ARG(BLENDER_SYSTEM_PLUGINS)" environment variable", set_env, NULL); @@ -1229,7 +1215,7 @@ int main(int argc, const char **argv) setuid(getuid()); /* end superuser */ #endif -#ifdef WITH_PYTHON_MODULE +#if defined(WITH_PYTHON_MODULE) || defined(WITH_HEADLESS) G.background= 1; /* python module mode ALWAYS runs in background mode (for now) */ #else /* for all platforms, even windos has it! */ |