summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomáš Chvátal <scarabeus@gentoo.org>2009-05-22 16:36:49 +0200
committerTomáš Chvátal <scarabeus@gentoo.org>2009-05-22 16:36:49 +0200
commit1a20b9d154051db97fe1bb72dba6e521db670d32 (patch)
tree7fb51a4cf4a105b6a905aab6e5af8656a89fa73e
parent52671935e3337cf0b76259964aa539a72869f486 (diff)
Compress documentation by default.
-rw-r--r--CMakeLists.txt25
-rw-r--r--cmake/FindBZIP2.cmake12
-rw-r--r--po/CMakeLists.txt2
3 files changed, 32 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 66d1bb8..cca4ad5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -193,12 +193,25 @@ ADD_SUBDIRECTORY ( src )
# DATA INSTALLATION
###############################################################################
ADD_SUBDIRECTORY ( data )
-INSTALL ( FILES ${CMAKE_SOURCE_DIR}/LICENCE
- DESTINATION ${CMAKE_INSTALL_DOCDIR}/ )
-INSTALL ( FILES ${CMAKE_SOURCE_DIR}/AUTHORS
- DESTINATION ${CMAKE_INSTALL_DOCDIR}/ )
-INSTALL ( FILES ${CMAKE_SOURCE_DIR}/README
- DESTINATION ${CMAKE_INSTALL_DOCDIR}/ )
+# install the doc data compressed
+FIND_PACKAGE ( BZIP2 REQUIRED )
+SET ( tuxanci_docs
+ ${CMAKE_CURRENT_SOURCE_DIR}/LICENCE
+ ${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS
+ ${CMAKE_CURRENT_SOURCE_DIR}/README
+)
+FOREACH ( doc ${tuxanci_docs} )
+ GET_FILENAME_COMPONENT( _doc ${doc} NAME_WE )
+ ADD_CUSTOM_COMMAND ( OUTPUT ${_doc}.bz2
+ COMMAND ${BZIP2_TOOL} -c ${doc} > ${_doc}.bz2
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ DEPENDS ${doc}
+ )
+ INSTALL ( FILES ${CMAKE_BINARY_DIR}/${_doc}.bz2
+ DESTINATION ${CMAKE_INSTALL_DOCDIR}/ )
+ LIST(APPEND _docFiles ${_doc}.bz2 )
+ENDFOREACH ( doc )
+ADD_CUSTOM_TARGET(docs ALL DEPENDS ${_docFiles})
###############################################################################
# GOODBYE INFORMATIONS (VARIABLES SETTINGS)
###############################################################################
diff --git a/cmake/FindBZIP2.cmake b/cmake/FindBZIP2.cmake
new file mode 100644
index 0000000..6b26aa1
--- /dev/null
+++ b/cmake/FindBZIP2.cmake
@@ -0,0 +1,12 @@
+# This scripts search up bzip2 binary and put it to the
+# BZIP2_TOOL varable.
+FIND_PROGRAM(BZIP2_TOOL
+ NAMES bzip2
+ PATHS
+ /bin
+ /usr/bin
+ /usr/local/bin
+)
+IF(NOT BZIP2_TOOL)
+ MESSAGE(FATAL_ERROR "Unable to find 'bzip2' executable")
+ENDIF(NOT BZIP2_TOOL)
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 54af949..165d352 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -12,7 +12,7 @@ SET ( _gmoFiles )
FOREACH ( _current_PO_FILE ${_po_files} )
GET_FILENAME_COMPONENT( _lang ${_current_PO_FILE} NAME_WE )
SET( _gmoFile ${CMAKE_BINARY_DIR}/po/${_lang}.gmo )
- add_custom_command( OUTPUT ${_gmoFile}
+ ADD_CUSTOM_COMMAND ( OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS ${_current_PO_FILE}