Commit [r7635] Maximize Restore History

* Better processing of translations

* Build and install the documentation
* other minor changes

plcl 2006-11-13

added /branches/reorganisation/rosegarden/docs/CMakeLists.txt
changed /branches/reorganisation/rosegarden/CMakeLists.txt
changed /branches/reorganisation/rosegarden/po/CMakeLists.txt
changed /branches/reorganisation/rosegarden/src/CMakeLists.txt
copied /branches/reorganisation/rosegarden/cmake_admin/FindLO.cmake -> /branches/reorganisation/rosegarden/cmake_admin/FindLIBLO.cmake
copied /branches/reorganisation/rosegarden/cmake_admin/FindLO.cmake -> /branches/reorganisation/rosegarden/cmake_admin/FindMSGFMT.cmake
copied /branches/reorganisation/rosegarden/cmake_admin/FindMsgfmt.cmake -> /branches/reorganisation/rosegarden/cmake_admin/FindMEINPROC.cmake
/branches/reorganisation/rosegarden/docs/CMakeLists.txt Diff Switch to side-by-side view
Loading...
/branches/reorganisation/rosegarden/CMakeLists.txt Diff Switch to side-by-side view
Loading...
/branches/reorganisation/rosegarden/po/CMakeLists.txt Diff Switch to side-by-side view
Loading...
/branches/reorganisation/rosegarden/src/CMakeLists.txt Diff Switch to side-by-side view
Loading...
/branches/reorganisation/rosegarden/cmake_admin/FindLO.cmake to /branches/reorganisation/rosegarden/cmake_admin/FindMSGFMT.cmake
--- a/branches/reorganisation/rosegarden/cmake_admin/FindLO.cmake
+++ b/branches/reorganisation/rosegarden/cmake_admin/FindMSGFMT.cmake
@@ -1,40 +1,46 @@
-# - Try to find liblo 0.7
-# Once done this will define:
 #
-#  LO_FOUND - system has LO
-#  LO_LIBRARY - LO library name
-#  LO_CFLAGS - Compiler switches required for using LO
-#  LO_LIBS - Linker flags
-#  LO_LIB_DIR - Library directory
-#  LO_INC_DIR - Include diretory
-#  LO_VERSION - LO version found
+# Find the msgfmt program
+#
+# Defined variables:
+#  MSGFMT_FOUND
+#  MSGFMT_EXECUTABLE
+#
+# Macro:
+#  ADD_TRANSLATIONS
+#
 
-SET(CMAKE_INCLUDE_PATH ".")
-INCLUDE(PkgConfigV)
+IF(MSGFMT_EXECUTABLE)
+    SET(MSGFMT_FOUND TRUE)
+ELSE(MSGFMT_EXECUTABLE)
+    FIND_PROGRAM(MSGFMT_EXECUTABLE
+	NAMES msgfmt gmsgfmt
+	PATHS /bin /usr/bin /usr/local/bin )
+    IF(MSGFMT_EXECUTABLE)
+        SET(MSGFMT_FOUND TRUE)
+    ELSE(MSGFMT_EXECUTABLE)
+	IF(NOT MSGFMT_FIND_QUIETLY)
+	    IF(MSGFMT_FIND_REQUIRED)
+		MESSAGE(FATAL_ERROR "msgfmt program couldn't be found")
+	    ENDIF(MSGFMT_FIND_REQUIRED)
+	ENDIF(NOT MSGFMT_FIND_QUIETLY)
+    ENDIF(MSGFMT_EXECUTABLE)
+    MARK_AS_ADVANCED(MSGFMT_EXECUTABLE)
+ENDIF (MSGFMT_EXECUTABLE)
 
-PKGCONFIGV(liblo 0.7 _LOVersion _LOIncDir _LOLinkDir _LOLinkFlags _LOCflags)
-
-SET(LO_CFLAGS ${_LOCflags})
-SET(LO_LIBS ${_LOLinkFlags})
-SET(LO_LIB_DIR ${_LOLinkDir})
-SET(LO_INC_DIR ${_LOIncDir})
-SET(LO_VERSION ${_LOVersion})
-
-SEPARATE_ARGUMENTS(LO_LIBS)
-
-FIND_LIBRARY(LO_LIBRARY
-  NAMES lo
-  PATHS ${_LOLinkDir} /usr/lib /usr/local/lib
-)
-
-IF(LO_LIBRARY)
-    SET(LO_FOUND TRUE)
-ENDIF(LO_LIBRARY)
-
-IF(NOT LO_FOUND)
-    IF(LO_FIND_REQUIRED)
-	MESSAGE(FATAL_ERROR "Could not find liblo >= 0.7")
-    ENDIF(LO_FIND_REQUIRED)
-ENDIF(NOT LO_FOUND)
-
-MARK_AS_ADVANCED(LO_LIBRARY LO_CFLAGS LO_LIBS)
+MACRO(ADD_TRANSLATIONS _baseName)
+    SET(_outputs)
+    FOREACH(_file ${ARGN})
+		GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE)
+		SET(_out "${CMAKE_CURRENT_BINARY_DIR}/${_file_we}.gmo")
+		SET(_in  "${CMAKE_CURRENT_SOURCE_DIR}/${_file_we}.po")
+		ADD_CUSTOM_COMMAND(
+		    OUTPUT ${_out}
+		    COMMAND ${MSGFMT_EXECUTABLE} -o ${_out} ${_in}
+		    DEPENDS ${_in} )
+		INSTALL(FILES ${_out}
+		    DESTINATION share/locale/${_file_we}/LC_MESSAGES/
+		    RENAME ${_baseName}.mo )
+		SET(_outputs ${_outputs} ${_out})
+    ENDFOREACH(_file)
+    ADD_CUSTOM_TARGET(translations ALL DEPENDS ${_outputs})
+ENDMACRO(ADD_TRANSLATIONS)
/branches/reorganisation/rosegarden/cmake_admin/FindMsgfmt.cmake to /branches/reorganisation/rosegarden/cmake_admin/FindMEINPROC.cmake
--- a/branches/reorganisation/rosegarden/cmake_admin/FindMsgfmt.cmake
+++ b/branches/reorganisation/rosegarden/cmake_admin/FindMEINPROC.cmake
@@ -1,22 +1,51 @@
-# Find the msgfmt executable
+# Find the MEINPROC program
 #
-# It will set the following variables:
-#  MSGFMT_FOUND
-#  MSGFMT_EXECUTABLE
+# Defined variables:
+#  MEINPROC_FOUND
+#  MEINPROC_EXECUTABLE
 #
+# Macro:
+#  ADD_DOCS
 
-IF (MSGFMT_EXECUTABLE)
-    SET(MSGFMT_FOUND TRUE)
-ELSE (MSGFMT_EXECUTABLE)
-    FIND_PROGRAM(MSGFMT_EXECUTABLE
-        NAMES msgfmt
-        PATHS /bin /usr/bin /usr/local/bin )
-    IF(MSGFMT_EXECUTABLE)
-        SET(MSGFMT_FOUND TRUE)
-    ELSE(MSGFMT_EXECUTABLE)
-    	IF(MSGFMT_FIND_REQUIRED)
-            MESSAGE(FATAL_ERROR "Could not find msgfmt program.")
-        ENDIF(MSGFMT_FIND_REQUIRED)
-    ENDIF(MSGFMT_EXECUTABLE)
-    MARK_AS_ADVANCED(MSGFMT_EXECUTABLE)
-ENDIF (MSGFMT_EXECUTABLE)
+IF(MEINPROC_EXECUTABLE)
+    SET(MEINPROC_FOUND TRUE)
+ELSE(MEINPROC_EXECUTABLE)
+    FIND_PROGRAM(MEINPROC_EXECUTABLE
+        NAME meinproc 
+	PATHS ${KDE3_BIN_INSTALL_DIR}
+         $ENV{KDEDIR}/bin
+	 /usr/bin
+	 /usr/local/bin
+	 /opt/kde/bin
+         /opt/kde3/bin )
+    IF(MEINPROC_EXECUTABLE)
+        SET(MEINPROC_FOUND TRUE)
+    ELSE(MEINPROC_EXECUTABLE)
+	IF(NOT MEINPROC_FIND_QUIETLY)
+	    IF(MEINPROC_FIND_REQUIRED)
+		MESSAGE(FATAL_ERROR "Program meinproc couldn't be found")
+	    ENDIF(MEINPROC_FIND_REQUIRED)
+	ENDIF(NOT MEINPROC_FIND_QUIETLY)
+    ENDIF(MEINPROC_EXECUTABLE)
+    MARK_AS_ADVANCED(MEINPROC_EXECUTABLE)
+ENDIF (MEINPROC_EXECUTABLE)
+
+MACRO(ADD_DOCS _baseName)
+    SET(_outputs)
+    FOREACH(_dir ${ARGN})
+	SET(_out "${CMAKE_CURRENT_BINARY_DIR}/${_dir}_index.cache.bz2")
+	SET(_in  "${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/index.docbook")
+	FILE(GLOB _images ${_dir}/*.png)
+	ADD_CUSTOM_COMMAND(OUTPUT ${_out}
+	    COMMAND ${MEINPROC_EXECUTABLE}
+	    ARGS --check --cache ${_out} ${_in}
+    	    DEPENDS ${_in} )
+	INSTALL(FILES ${_out}
+    	    DESTINATION share/doc/HTML/${_dir}/${_baseName}
+	    RENAME index.cache.bz2)
+	INSTALL(FILES ${_in} ${_images}
+    	    DESTINATION share/doc/HTML/${_dir}/${_baseName})
+	SET(_outputs ${_outputs} ${_out})
+    ENDFOREACH(_dir)
+    ADD_CUSTOM_TARGET(documentation ALL DEPENDS ${_outputs})
+ENDMACRO(ADD_DOCS)