summaryrefslogtreecommitdiff
path: root/utilities/CMakeLists.txt
blob: 3d510f10dfeb5626fddcd7f429c5bbad83d76893 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
######################################################################
# Basic utility programs and their joy.
#
# The general assumption is that each of these utilities is built from
# a single source file, which shares its name with the utility itself (appended with .cpp),
# and then linked against the SWORD library.
# 
# This list will be built and installed, if so chosen
#
# These are in alphbetical order now - please keep them that way
# if you edit this list in the future.
# 
SET(install_UTILITIES
	addld
	imp2gbs
	imp2ld
	imp2vs
	installmgr
	mkfastmod
	mod2imp
	mod2osis
	mod2vpl
	tei2mod
	vpl2mod
	vs2osisref
	vs2osisreftxt
	xml2gbs
	osis2mod
)

IF(WITH_ZLIB OR WITH_INTERNAL_ZLIB)
	SET(install_UTILITIES ${install_UTILITIES} mod2zmod)
ENDIF(WITH_ZLIB OR WITH_INTERNAL_ZLIB)

######################################################################
# These utilities will be built, but they will not be installed
# 
# Again, I have gone to great lengths of travail to make this list
# alphabetical.  If you add utilities to this list, please do so in a
# way that maintains this.
SET(noinstall_UTILITIES
	addgb
	addvs
	cipherraw
	emptyvss
	gbfidx
	genbookutil
	modwrite
	step2vpl
	stepdump
	treeidxutil
)

#####################################################################
# This will loop over both of the above utility lists and add build targets
# to the system for each one of them.
# 

FOREACH(UTIL ${install_UTILITIES} ${noinstall_UTILITIES})
	ADD_EXECUTABLE("${UTIL}"	"${UTIL}.cpp")
	IF(BUILDING_SHARED)
		TARGET_LINK_LIBRARIES("${UTIL}" sword)
	ELSE(BUILDING_SHARED)
		TARGET_LINK_LIBRARIES("${UTIL}" sword_static)
	ENDIF(BUILDING_SHARED)
ENDFOREACH(UTIL ${install_UTILITIES})

####################################################################
# Just to be difficult, we have a single C file that is a utility
# and, therefore, needs its own treatment.
# 

ADD_EXECUTABLE(lexdump	lexdump.c)
IF(BUILDING_SHARED)
	TARGET_LINK_LIBRARIES(lexdump sword)
ELSE(BUILDING_SHARED)
	TARGET_LINK_LIBRARIES(lexdump sword_static)
ENDIF(BUILDING_SHARED)

####################################################################
# Install the utilities
#
# We do this here, rather than up in the main install file, because
# a) it fits more logically and b) the scope of ${install_UTILITIES}
# is limited to CMake files in this directory and below, so rather than
# replicate the above list in another place, we'll just handle our
# own install, since this whole directory is optional, anyway.
# 
FOREACH(UTIL ${install_UTILITIES})
	INSTALL(TARGETS ${UTIL}
		DESTINATION ${SWORD_INSTALL_DIR}/bin
		COMPONENT utilities
	)
ENDFOREACH(UTIL ${install_UTILITIES})

####################################################################
# And, of course, diatheke is a beast unto itself
#
# Let's go!
#
ADD_EXECUTABLE(diatheke
	diatheke/diatheke.cpp
	diatheke/corediatheke.cpp
	diatheke/diathekemgr.cpp
	diatheke/diafiltmgr.cpp
	diatheke/thmlcgi.cpp
	diatheke/gbfcgi.cpp
	diatheke/osiscgi.cpp
)
IF(BUILDING_SHARED)
	TARGET_LINK_LIBRARIES(diatheke sword)
ELSE(BUILDING_SHARED)
	TARGET_LINK_LIBRARIES(diatheke sword_static)
ENDIF(BUILDING_SHARED)
INSTALL(TARGETS diatheke
	DESTINATION ${SWORD_INSTALL_DIR}/bin
	COMPONENT utilities
)