summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLassi Marttala <lassi.lm.marttala@partner.bmw.com>2012-03-01 15:14:01 +0100
committerLassi Marttala <lassi.lm.marttala@partner.bmw.com>2012-03-01 15:14:01 +0100
commit1b43465a52970c1799cae6df934958360217faa2 (patch)
tree50544ce3efac57a17367a60069cda30a027ee3d5
parent0cb2c97d63d6d297befc724b1d3fbbd37b8b529c (diff)
downloadDLT-daemon-1b43465a52970c1799cae6df934958360217faa2.tar.gz
First test using cmakelist
-rwxr-xr-xdoc/CMakeLists.txt53
-rw-r--r--doc/dummy.c0
2 files changed, 52 insertions, 1 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index aea40b2..555c381 100755
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -50,4 +50,55 @@ if(WITH_DOC)
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/doc/filetransfer_doxygen.cfg
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc
)
-endif(WITH_DOC) \ No newline at end of file
+endif(WITH_DOC)
+
+# Compress the man pages and install to proper place
+FIND_PROGRAM(GZIP_TOOL
+ NAMES gzip
+ PATHS /bin
+ /usr/bin
+ /usr/local/bin)
+
+IF(NOT GZIP_TOOL)
+ MESSAGE(FATAL_ERROR "Could not find gzip for man page compression.")
+ENDIF(NOT GZIP_TOOL)
+
+set(MAN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/dlt.conf.5
+ ${CMAKE_CURRENT_SOURCE_DIR}/dlt-system.conf.5
+ ${CMAKE_CURRENT_SOURCE_DIR}/dlt-convert.1
+ ${CMAKE_CURRENT_SOURCE_DIR}/dlt-daemon.1
+ ${CMAKE_CURRENT_SOURCE_DIR}/dlt-receive.1
+ ${CMAKE_CURRENT_SOURCE_DIR}/dlt-system.1)
+set(MAN_SRC_GZ dlt.conf.5.gz dlt-system.conf.5.gz dlt-convert.1.gz dlt-daemon.1.gz dlt-receive.1.gz dlt-system.1.gz)
+
+FOREACH(MAN ${MAN_SRC})
+ ADD_CUSTOM_COMMAND(OUTPUT ${MAN}.gz
+ COMMAND ${GZIP_TOOL} -c ${MAN} > ${MAN}.gz
+ DEPENDS ${MAN}
+ COMMENT "Compressing ${MAN}.gz")
+ENDFOREACH(MAN)
+
+# If user has not set the base dir for man pages, use a default location
+if(MAN_INSTALL_DIR)
+else()
+ if(WIN32)
+ set(MAN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/man)
+ else()
+ set(MAN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/man)
+ endif()
+endif()
+
+add_library(man_pages STATIC dummy.c ${MAN_SRC_GZ})
+
+INSTALL(FILES dlt.conf.5.gz
+ dlt-system.conf.5.gz
+ DESTINATION ${MAN_INSTALL_DIR}/man5
+)
+
+INSTALL(FILES dlt-convert.1.gz
+ dlt-daemon.1.gz
+ dlt-receive.1.gz
+ dlt-system.1.gz
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+)
+ \ No newline at end of file
diff --git a/doc/dummy.c b/doc/dummy.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/doc/dummy.c