- fix for cmake when there is no version character.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 12 Apr 2011 16:20:41 +0000 (16:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 12 Apr 2011 16:20:41 +0000 (16:20 +0000)
- link to release docs correctly from the splash page.

build_files/cmake/macros.cmake
source/blender/windowmanager/intern/wm_operators.c

index a4a6922bca3d9a210d4a2b72a13494d5b4ac87e5..ca1dd79cd8e6020a190f01f53f0a8f99e5951ed2 100644 (file)
@@ -376,7 +376,8 @@ macro(get_blender_version)
        set(BLENDER_VERSION_CYCLE ${_out_version_cycle})
 
        # for packaging, alpha to numbers
-       if(${BLENDER_VERSION_CHAR})
+       string(COMPARE EQUAL "${BLENDER_VERSION_CHAR}" "" _out_version_char_empty)
+       if(${_out_version_char_empty})
                set(BLENDER_VERSION_CHAR_INDEX "0")
        else()
                set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w q y z)
@@ -388,6 +389,7 @@ macro(get_blender_version)
 
        unset(_out_subversion)
        unset(_out_version_char)
+       unset(_out_version_char_empty)
        unset(_out_version_cycle)
 
        # message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
index d4e5be61b23d0232c47c912af7e21d0857400fd7..8ec539c0d77a7ef321f2f2becda90bb642c257c5 100644 (file)
@@ -1139,7 +1139,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
        struct RecentFile *recent;
        int i;
        MenuType *mt= WM_menutype_find("USERPREF_MT_splash", TRUE);
-       char url[64];
+       char url[96];
        
 #ifdef NAN_BUILDINFO
        int ver_width, rev_width;
@@ -1197,7 +1197,12 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
        uiItemStringO(col, "Manual", ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:Manual");
        uiItemStringO(col, "Blender Website", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/");
        uiItemStringO(col, "User Community", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community/"); // 
-       BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d_%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
+       if(strcmp(STRINGIFY(BLENDER_VERSION_CYCLE), "release")==0) {
+               BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d" STRINGIFY(BLENDER_VERSION_CHAR) "_release", BLENDER_VERSION/100, BLENDER_VERSION%100);
+       }
+       else {
+               BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d_%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
+       }
        uiItemStringO(col, "Python API Reference", ICON_URL, "WM_OT_url_open", "url", url);
        uiItemL(col, "", ICON_NONE);