ADD_DEFINITIONS( -DHAVE_CONFIG_H )

# In principle, the wv2_GENERATED files are generated by uncommenting the
# following line.
#
#ADD_SUBDIRECTORY( generator )
#
# However, in practice, these have now diverged sufficiently from the
# generated files for this to be impractical. At this point, the generated
# files have value only for comparision purposes.
SET( wv2_GENERATED
	word95_generated.h
	word95_generated.cpp
	word97_generated.h
	word97_generated.cpp
	convert.h
	convert.cpp
    )

SET( wv2_SOURCES
    annotations.cpp
	olestorage.cpp
	olestream.cpp
	word97_helper.cpp
	word95_helper.cpp
	word_helper.cpp
	global.cpp
	parser.cpp
	parser9x.cpp
	parser95.cpp
	parser97.cpp
	parserfactory.cpp
	ustring.cpp
	textconverter.cpp
	styles.cpp
	handlers.cpp
	properties97.cpp
	fonts.cpp
	lists.cpp
	paragraphproperties.cpp
	headers.cpp
	headers95.cpp
	headers97.cpp
	footnotes97.cpp
    bookmark.cpp
	functor.cpp
	functordata.cpp
	associatedstrings.cpp
	fields.cpp
	utilities.cpp
	crc32.c
	graphics.cpp
	wv2version.cpp
	zcodec.cxx
    )

SET( wv2_HEADERS
    annotations.h
	olestorage.h
	olestream.h
	word_helper.h
	parser.h
	parserfactory.h
	ustring.h
	textconverter.h
	styles.h
	sharedptr.h
	global.h
	handlers.h
	fonts.h
	lists.h
	utilities.h
	paragraphproperties.h
	functor.h
	functordata.h
	associatedstrings.h
	fields.h
	wvlog.h
	wv2version.h
	zcodec.hxx
    )

kde4_add_library( kowv2 SHARED ${wv2_SOURCES} ${wv2_HEADERS} ${wv2_GENERATED} )
INCLUDE_DIRECTORIES( ${KDE4_INCLUDE_DIR} )
TARGET_LINK_LIBRARIES( kowv2 ${ZLIB_LIBRARIES} ${LIBGSF_LIBRARIES} ${ICONV_LIBRARIES} ${GLIB2_LIBRARIES} ${GOBJECT_LIBRARIES} ${KDE4_KDECORE_LIBS} )
SET_TARGET_PROPERTIES( kowv2 PROPERTIES
			      SOVERSION ${LT_VERSION_CURRENT}
			      VERSION ${LT_VERSION_CURRENT}.${LT_VERSION_AGE}.${LT_VERSION_REVISION}
			      LT_VERSION_CURRENT ${LT_VERSION_CURRENT}
			      LT_VERSION_AGE ${LT_VERSION_AGE}
			      LT_VERSION_REVISION ${LT_VERSION_REVISION}
			      LT_DEPENDENCY_LIBS ${WV2_LDFLAGS}
		    )

INSTALL( TARGETS kowv2
    LIBRARY DESTINATION lib${LIB_SUFFIX}
)

