File: process-java-doc.cmake

package info (click to toggle)
libsbml 5.10.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 141,800 kB
  • ctags: 98,793
  • sloc: cpp: 804,405; xml: 206,907; ansic: 66,144; cs: 52,916; java: 25,093; python: 23,449; sh: 9,847; perl: 8,414; makefile: 7,580; ruby: 4,760; csh: 3
file content (78 lines) | stat: -rw-r--r-- 2,971 bytes parent folder | download
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#
# This file applies post processing to the generated java documentation.
# 
#
#
#

macro(merge_html sourceFile targetFile title)
	
	file(READ "libsbml-java-top.html" top)
	file(READ "${sourceFile}" source)
	file(READ "libsbml-java-bottom.html" bottom)
	file(READ "libsbml-java-footer.html" footer)
	
	set(content "${top}${source}${bottom}${footer}")

	string(REPLACE "%%title%%" "${title}" content "${content}")
	string(REPLACE "%%version%%" "${PACKAGE_VERSION}" content "${content}")
	
	file(WRITE "${targetFile}" "${content}")
	
endmacro()

macro(merge_html_verb sourceFile targetFile title)

	file(READ "libsbml-java-top.html" top)
	file(READ "libsbml-java-verb-top.html" verb)
	file(READ "${sourceFile}" source)
	file(READ "libsbml-java-verb-bottom.html" verb_bottom)
	file(READ "libsbml-java-bottom.html" bottom)
	file(READ "libsbml-java-footer.html" footer)

	set(content "${top}${verb}${source}${verb_bottom}${bottom}${footer}")

	string(REPLACE "%%title%%" "${title}" content "${content}")
	string(REPLACE "%%version%%" "${PACKAGE_VERSION}" content "${content}")

	file(WRITE "${targetFile}" "${content}")	
	
endmacro()

macro(insert_javascript directory)

	file(GLOB html_files ${directory}/*.html)
	
	foreach(html ${html_files})
		file(READ "${html}" content)
		
		# only change if it is not included yet
		if(NOT "${content}" MATCHES "^.*sbml.js^.*")
		
			string(REPLACE "<SCRIPT type=\"text/javascript\">"
					"<script type=\"text/javascript\" src=\"../../../sbml.js\"></script><SCRIPT type=\"text/javascript\">"
					content ${content})
					
			file(WRITE "${html}" "${content}")
		
		endif()
		
	endforeach()
	
endmacro()

merge_html( "libsbml-java-overview.html" "${java_manual}/overview-summary.html" "Java ${PACKAGE_VERSION} API" )
merge_html( "libsbml-installation.html" "${java_manual}/libsbml-installation.html" "installation" )
merge_html( "libsbml-features.html" "${java_manual}/libsbml-features.html" "features" )
merge_html( "libsbml-accessing.html" "${java_manual}/libsbml-accessing.html" "accessibility to your software" )
merge_html( "libsbml-communications.html" "${java_manual}/libsbml-communications.html" "bug reports and other communications" )
merge_html( "libsbml-java-reading.html" "${java_manual}/libsbml-java-reading.html" "basic facilities for reading and writing SBML content" )
merge_html( "libsbml-java-math.html" "${java_manual}/libsbml-java-math.html" "facilities for manipulating mathematical expressions" )
merge_html( "libsbml-issues.html" "${java_manual}/libsbml-issues.html" "known issues and pitfalls" )
#merge_html( "libsbml-uninstallation.html" "${java_manual}/libsbml-uninstallation.html" "uninstallation" )
merge_html( "../../LICENSE.html" "${java_manual}/libsbml-license.html" "license" )

merge_html_verb( "../../NEWS.txt" "${java_manual}/libsbml-news.html" "news" )
merge_html_verb( "../../OLD_NEWS.txt" "${java_manual}/libsbml-old-news.html" "old-news" )

insert_javascript("${java_manual}/org/sbml/libsbml")