[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30345] trunk/blender: CMake patch from Ralf H?\195?\182lzemer (cheleb)

Campbell Barton ideasman42 at gmail.com
Wed Jul 14 22:26:46 CEST 2010


Revision: 30345
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30345
Author:   campbellbarton
Date:     2010-07-14 22:26:46 +0200 (Wed, 14 Jul 2010)

Log Message:
-----------
CMake patch from Ralf H?\195?\182lzemer (cheleb)
[#22849] Fix cmake install target on linux
--- from the tracker ---
This patch fixes the install target for the linux platform. Since the new configuration path changes are in effect, files have to be installed in the correct places instead of just copying the local installation to $PREFIX/share/blender.

It also provides a new macro to determine the correct blender version values.

Changes in this patch include:

- the .desktop menu file is installed in $PREFIX/share/applications and points to the svg icon instead of a png one, which is also installed in $PREFIX/share/pixmaps
- docs are installed in $PREFIX/share/doc/blender
- scripts are installed in in $PREFIX/share/blender/x.xx/
- locales are installed in in $PREFIX/share/blender/x.xx/datafiles
- a new cmake macro determines and sets the correct values for BLENDER_VERSION_MAJOR, BLENDER_VERSION_MINOR, BLENDER_SUBVERSION, BLENDER_VERSION, BLENDER_MINVERSION_MAJOR, BLENDER_MINVERSION_MINOR, BLENDER_MINSUBVERSION and BLENDER_MINVERSION by parsing source/blender/blenkernel/BKE_blender.h and calculating major/minor values. This replaces the hardcoded value in the top CMakeLists file and is used by all platforms.

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/build_files/cmake/macros.cmake
    trunk/blender/release/freedesktop/blender.desktop
    trunk/blender/source/creator/CMakeLists.txt

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2010-07-14 20:19:53 UTC (rev 30344)
+++ trunk/blender/CMakeLists.txt	2010-07-14 20:26:46 UTC (rev 30345)
@@ -55,10 +55,6 @@
 SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
 SET(LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/lib)
 
-# Note! - Could create this from the blender version string
-# ...but thats quite involved, make sure this matches the blender version.
-SET(BLENDER_VERSION  2.5)
-
 #-----------------------------------------------------------------------------
 # Load some macros.
 INCLUDE(build_files/cmake/macros.cmake)
@@ -66,6 +62,8 @@
 #-----------------------------------------------------------------------------
 # Set default config options
 
+GET_BLENDER_VERSION()
+
 # Blender internal features
 OPTION(WITH_INTERNATIONAL "Enable I18N   (International fonts and text)" ON)
 OPTION(WITH_LCMS          "Enable color correction with lcms" OFF)

Modified: trunk/blender/build_files/cmake/macros.cmake
===================================================================
--- trunk/blender/build_files/cmake/macros.cmake	2010-07-14 20:19:53 UTC (rev 30344)
+++ trunk/blender/build_files/cmake/macros.cmake	2010-07-14 20:26:46 UTC (rev 30345)
@@ -198,3 +198,36 @@
 	SUPPORT_SSE_BUILD)
 ENDMACRO(TEST_SSE_SUPPORT)
 
+MACRO(GET_BLENDER_VERSION)
+	FILE(READ ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h CONTENT)
+	STRING(REGEX REPLACE "\n" ";" CONTENT "${CONTENT}")
+	STRING(REGEX REPLACE "\t" ";" CONTENT "${CONTENT}")
+	STRING(REGEX REPLACE " " ";" CONTENT "${CONTENT}")
+
+	FOREACH(ITEM ${CONTENT})
+		IF(LASTITEM MATCHES "BLENDER_VERSION")
+			MATH(EXPR BLENDER_VERSION_MAJOR "${ITEM} / 100")
+			MATH(EXPR BLENDER_VERSION_MINOR "${ITEM} % 100")
+			SET(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}")
+		ENDIF(LASTITEM MATCHES "BLENDER_VERSION")
+		
+		IF(LASTITEM MATCHES "BLENDER_SUBVERSION")
+			SET(BLENDER_SUBVERSION ${ITEM})
+		ENDIF(LASTITEM MATCHES "BLENDER_SUBVERSION")
+		
+		IF(LASTITEM MATCHES "BLENDER_MINVERSION")
+			MATH(EXPR BLENDER_MINVERSION_MAJOR "${ITEM} / 100")
+			MATH(EXPR BLENDER_MINVERSION_MINOR "${ITEM} % 100")
+			SET(BLENDER_MINVERSION "${BLENDER_MINVERSION_MAJOR}.${BLENDER_MINVERSION_MINOR}")
+		ENDIF(LASTITEM MATCHES "BLENDER_MINVERSION")
+		
+		IF(LASTITEM MATCHES "BLENDER_MINSUBVERSION")
+			SET(BLENDER_MINSUBVERSION ${ITEM})
+		ENDIF(LASTITEM MATCHES "BLENDER_MINSUBVERSION")
+
+		SET(LASTITEM ${ITEM})
+	ENDFOREACH(ITEM ${CONTENT})
+	
+	MESSAGE(STATUS "Version major: ${BLENDER_VERSION_MAJOR}, Version minor: ${BLENDER_VERSION_MINOR}, Subversion: ${BLENDER_SUBVERSION}, Version: ${BLENDER_VERSION}")
+	MESSAGE(STATUS "Minversion major: ${BLENDER_MINVERSION_MAJOR}, Minversion minor: ${BLENDER_MINVERSION_MINOR}, MinSubversion: ${BLENDER_MINSUBVERSION}, Minversion: ${BLENDER_MINVERSION}")
+ENDMACRO(GET_BLENDER_VERSION)

Modified: trunk/blender/release/freedesktop/blender.desktop
===================================================================
--- trunk/blender/release/freedesktop/blender.desktop	2010-07-14 20:19:53 UTC (rev 30344)
+++ trunk/blender/release/freedesktop/blender.desktop	2010-07-14 20:26:46 UTC (rev 30345)
@@ -3,7 +3,7 @@
 Name=Blender
 Comment=3D modeling, animation, rendering and post-production
 Exec=blender
-Icon=blender.png
+Icon=blender.svg
 Terminal=false
 Type=Application
 Categories=Graphics;3DGraphics;

Modified: trunk/blender/source/creator/CMakeLists.txt
===================================================================
--- trunk/blender/source/creator/CMakeLists.txt	2010-07-14 20:19:53 UTC (rev 30344)
+++ trunk/blender/source/creator/CMakeLists.txt	2010-07-14 20:26:46 UTC (rev 30345)
@@ -192,9 +192,31 @@
 		ENDIF(WITH_GAMEENGINE AND WITH_PLAYER)
 
 		INSTALL(
-			DIRECTORY ${TARGETDIR}/.blender/
-			DESTINATION ${BLENDERPATH}
-		)
+            FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
+            DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
+        )
+		INSTALL(
+            FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/blender.svg
+            DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps
+        )
+		INSTALL(
+            DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/
+            DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
+            PATTERN ".svn" EXCLUDE
+        )
+		INSTALL(
+            DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts/
+            DESTINATION ${BLENDERPATH}/scripts
+            PATTERN ".svn" EXCLUDE
+        )
+		IF(WITH_INTERNATIONAL)
+			INSTALL(
+    	        DIRECTORY ${CMAKE_SOURCE_DIR}/bin/.blender/locale/
+    	        DESTINATION ${BLENDERPATH}/datafiles/locale
+    	        PATTERN ".svn" EXCLUDE
+	        )
+		ENDIF(WITH_INTERNATIONAL)
+        
 		# end "make install"
     
 	ENDIF(UNIX AND NOT APPLE)





More information about the Bf-blender-cvs mailing list