# 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) add_subdirectory(params) install(FILES COPYING logo.bmp xtrkcad.xtq xtrkcad.upd DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR} ) # install parameter files install(DIRECTORY params DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR} FILES_MATCHING PATTERN "*.xtp") # install demos install(DIRECTORY demos DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR} FILES_MATCHING PATTERN "*.xtr") # install example layouts install(DIRECTORY examples DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR} FILES_MATCHING PATTERN "*.xtc") # install release documentation Readme and CHANGELOG # depends on pandoc # 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(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 and CHANGELOG.txt are not generated!") endif() if(UNIX AND NOT APPLE) install(PROGRAMS xdg-open xtrkcad-setup DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR} ) install(FILES xtrkcad${XTRKCAD_BETA}.desktop DESTINATION "${XTRKCAD_SHARE_INSTALL_DIR}/applications" RENAME xtrkcad.desktop ) install(FILES xtrkcad.xml DESTINATION "${XTRKCAD_SHARE_INSTALL_DIR}/applications" ) install(FILES xtrkcad.png DESTINATION "${XTRKCAD_SHARE_INSTALL_DIR}/pixmaps" ) endif()