summaryrefslogtreecommitdiff
path: root/app/lib/CMakeLists.txt
blob: a2e823d405e01abf850ec49ff6d83d1255eb0c32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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(demos)
add_subdirectory(examples)
add_subdirectory(params)

install(FILES 
	COPYING
	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(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
		xtrkcad.png
		DESTINATION "/usr/share/pixmaps"
		)
endif()