Cleaned up source for dual build
[shibboleth/cpp-xmltooling.git] / xmltoolingtest / Makefile.am
1 AUTOMAKE_OPTIONS = foreign
2
3 if BUILD_UNITTEST
4
5 bin_PROGRAMS = xmltoolingtest
6 xmltoolingtest_CXXFLAGS = $(CXXTESTFLAGS)
7 if BUILD_XMLSEC
8 xmltoolingtest_LDFLAGS = $(XMLSEC_LIBS)
9 xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling.la
10 else
11 xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling-lite.la
12 endif
13
14 else
15
16 bin_PROGRAMS = 
17
18 endif
19
20 if BUILD_XMLSEC
21 xmlsec_sources = \
22     EncryptionTest.h \
23     FilesystemCredentialResolverTest.h \
24     InlineKeyResolverTest.h \
25     SignatureTest.h
26 else
27 xmlsec_sources =
28 endif
29
30 xmltoolingtest_h = \
31     ComplexXMLObjectTest.h \
32     ExceptionTest.h \
33     KeyInfoTest.h \
34     MarshallingTest.h \
35     MemoryStorageServiceTest.h \
36     UnmarshallingTest.h \
37     TemplateEngineTest.h \
38     xmltoolingtest.h \
39     ${xmlsec_sources}
40
41 noinst_HEADERS = \
42     XMLObjectBaseTestCase.h
43
44 nodist_xmltoolingtest_SOURCES = $(xmltoolingtest_h:.h=.cpp)
45
46 CLEANFILES = $(nodist_xmltoolingtest_SOURCES)
47
48 do-cxxtestgen:
49         if test $(HFILE) = "xmltoolingtest.h"; then \
50                 $(CXXTEST) --error-printer --have-eh --have-std --abort-on-fail -o $(CPPFILE) $(HFILE); \
51         else \
52                 $(CXXTEST) --part --have-eh --have-std --abort-on-fail -o $(CPPFILE) $(HFILE); \
53         fi;
54
55 $(nodist_xmltoolingtest_SOURCES): %.cpp: %.h
56         $(MAKE) do-cxxtestgen HFILE=$< CPPFILE=$@
57
58 EXTRA_DIST = xmltoolingtest.vcproj $(xmltoolingtest_h) data