summaryrefslogtreecommitdiff
path: root/app/lib/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/CMakeLists.txt')
-rw-r--r--app/lib/CMakeLists.txt54
1 files changed, 41 insertions, 13 deletions
diff --git a/app/lib/CMakeLists.txt b/app/lib/CMakeLists.txt
index 3de124e..a2e823d 100644
--- a/app/lib/CMakeLists.txt
+++ b/app/lib/CMakeLists.txt
@@ -1,28 +1,56 @@
-
-# $Header: /home/dmarkle/xtrkcad-fork-cvs/xtrkcad/app/lib/CMakeLists.txt,v 1.6 2008-03-27 18:17:16 m_fischer Exp $
+# CMakeList for the LIB directory
#
+# Include the subdirectories for params, examples and params
+# Generate and install a Readme.txt file from markdown if pandoc is available on the system
+# install desktop integration following freedesktop.org specification
+#
+project(lib)
-PROJECT(lib)
-
-ADD_SUBDIRECTORY(demos)
-ADD_SUBDIRECTORY(examples)
-ADD_SUBDIRECTORY(params)
+add_subdirectory(demos)
+add_subdirectory(examples)
+add_subdirectory(params)
-INSTALL(FILES
+install(FILES
COPYING
- Readme.txt
logo.bmp
xtrkcad.xtq
DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}
)
+
+set( infile "${CMAKE_CURRENT_SOURCE_DIR}/Readme.md" )
+set( outfile "${CMAKE_CURRENT_BINARY_DIR}/Readme.txt" )
+set( changelogin "${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md" )
+set( changelogout "${CMAKE_CURRENT_BINARY_DIR}/CHANGELOG.txt" )
-IF(UNIX AND NOT APPLE)
- INSTALL(FILES
+if(PANDOC_FOUND)
+ add_custom_command(OUTPUT "${outfile}"
+ COMMAND ${PANDOC_EXECUTABLE} "--from=Markdown" "--to=plain" "-o" ${outfile} ${infile}
+ DEPENDS "${infile}"
+ )
+ add_custom_target(CHANGELOG ALL DEPENDS ${changelogout})
+ add_custom_command(OUTPUT "${changelogout}"
+ COMMAND ${PANDOC_EXECUTABLE} "--from=Markdown" "--to=plain" "-o" ${changelogout} ${changelogin}
+ DEPENDS "${changelogin}"
+ )
+ add_custom_target(Readme ALL DEPENDS ${outfile})
+ install(FILES ${outfile} ${changelogout}
+ DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}
+ )
+else()
+ message(STATUS "Pandoc is not available on this system, Readme.txt is not generated!")
+endif()
+
+if(UNIX AND NOT APPLE)
+ install(PROGRAMS
+ xdg-open
+ DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}
+ )
+ install(FILES
xtrkcad.desktop
DESTINATION "/usr/share/applications"
)
- INSTALL(FILES
+ install(FILES
xtrkcad.png
DESTINATION "/usr/share/pixmaps"
)
-ENDIF(UNIX AND NOT APPLE) \ No newline at end of file
+endif() \ No newline at end of file