summaryrefslogtreecommitdiffstats
path: root/sdo-cpp/trunk/runtime/core/build.xml
blob: 9dc3dc5244249b1b0ac42f67c0bf95078fa89ace (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?xml version="1.0" encoding="UTF-8"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
     http://www.apache.org/licenses/LICENSE-2.0
     
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
-->
<project name="TuscanySdoNative_core" default="all" basedir="../..">

  <import file="${basedir}/antscripts/system.xml"/>
  <import file="${basedir}/antscripts/compile-targets.xml"/>

  <!--
    Notice that the basedir for this project is set to the TuscanySDO root dir
    This makes path setting in system.xml much simpler, but we'll just have to
    set a property here to this directory.
  -->
  <property name="this.dir"            location="${basedir}/runtime/core"/>
  <property name="sdo.base.dir"        value="commonj/sdo"/>

  <property name="sdo.dir"             location="${this.dir}/src/${sdo.base.dir}"/>
  <property name="sdo_axiom.dir"       location="${this.dir}/sdo_axiom"/>
  <property name="sdo.lib.dir"         location="${sdo.dir}/.libs"/>
  <property name="sdo_axiom.lib.dir"   location="${sdo_axiom.dir}/.libs"/>

  <property name="tuscany.sdo.lib"         value="tuscany_sdo"/>
  <property name="tuscany.sdo_axiom.lib"   value="tuscany_sdo_axiom"/>


  <!--
    Public targets
  -->
  <target name="all" description="compile, link, and install all TuscanySdoNative source code">
    <antcall target="build.sdo"/>
    <antcall target="install.sdo"/>
    <antcall target="build.sdo_axiom"/>
    <antcall target="install.sdo_axiom"/>
  </target>

  <target name="build" description="compile and link all TuscanySdoNative source code">
    <antcall target="build.sdo"/>
  	<antcall target="install.sdo"/>
    <antcall target="build.sdo_axiom"/>
  </target>

  <target name="install" description="Install TuscanySdoNative libraries and headers">
    <antcall target="install.sdo"/>
    <antcall target="install.sdo_axiom"/>
  </target>

  <target name="clean" description="Clean all TuscanySdoNative core compiled source code">
    <antcall target="clean.sdo"/>
    <antcall target="clean.sdo_axiom"/>
    <antcall target="clean.test"/>
  </target>
  
  <target name="test" description="Build and Run TuscanySdoNative sdo and sdo_axiom tests">
    <antcall target="test.sdo"/>
    <antcall target="test.sdo_axiom"/>
  </target>

  <!--
    Internal targets
    They can still be called, they're just not described, so wont show up in "ant -p"
  -->

    <!-- build -->

  <target name="build.sdo" depends="check.libxml2" if="enable_libxml2">
    <cpp-build
        srcdir="${sdo.dir}"
        outdir="${sdo.lib.dir}"
        outfile="${tuscany.sdo.lib}">
      <custom-build-elements>
        <defineset if="windows" define="SDO_EXPORTS"/>
        <includepath path="${tuscanySDO.root.src.dir}/core/src"/>
      	<includepath path="${libxml2.include.dir}"/>
      	<includepath if="windows" path="${iconv.home.dir}/include"/>
        <libset if="windows" dir="${libxml2.lib.dir}" libs="libxml2"/>
        <libset unless="windows" dir="${libxml2.lib.dir}" libs="xml2"/>
      </custom-build-elements>
    </cpp-build>
  </target>

  <target name="build.sdo_axiom" depends="check.libxml2,check.ws" if="enable_ws">
    <cpp-build
        srcdir="${sdo_axiom.dir}"
        outdir="${sdo_axiom.lib.dir}"
        outfile="${tuscany.sdo_axiom.lib}">
      <custom-build-elements>
        <defineset if="windows" define="SDO_AXIOM_EXPORTS"/>
        <includepath path="${sdo.impl.include.path}"/>
      	<includepath path="${axis2c.home.dir}/include"/>
        <libset dir="${sdo.impl.library.path}" libs="${sdo.impl.library.name}"/>
      	<libset dir="${axis2c.home.dir}/lib" libs="axis2_util"/>
        <libset dir="${axis2c.home.dir}/lib" libs="axis2_axiom"/>
        <libset dir="${axis2c.home.dir}/lib" libs="axis2_parser"/>
        <libset if="windows" dir="${axis2c.home.dir}/lib" libs="axiom"/>
        <libset unless="windows" dir="${axis2c.home.dir}/lib" libs="axis2_axiom"/>
      </custom-build-elements>
    </cpp-build>
  </target>

    <!-- install -->

  <target name="install.sdo" depends="check.libxml2" if="enable_libxml2">
  	<cpp-install-lib
  	    lib="${tuscany.sdo.lib}"
        srcdir="${sdo.lib.dir}"
        destrootdir="${tuscanySDO.install.dir}"/>
    <cpp-symlink
        linkdir="${tuscanySDO.install.dir}/lib"
        link="${lib.prefix}${tuscany.sdo.lib}${lib.ext}"
        resource="${lib.prefix}${tuscany.sdo.lib}${lib.ext}${tuscanySDO.library.version}"/>
    <cpp-install-files
        srcdir="${sdo.dir}"
        files="*.h"
        destdir="${tuscanySDO.install.dir}/include/${sdo.base.dir}"/>
  </target>

  <target name="install.sdo_axiom" depends="check.libxml2,check.ws" if="enable_ws">
    <cpp-install-lib
       lib="${tuscany.sdo_axiom.lib}"
       srcdir="${sdo_axiom.lib.dir}"
       destrootdir="${tuscanySDO.install.dir}"/>
    <cpp-symlink
        linkdir="${tuscanySDO.install.dir}/lib"
        link="${lib.prefix}${tuscany.sdo_axiom.lib}${lib.ext}"
        resource="${lib.prefix}${tuscany.sdo_axiom.lib}${lib.ext}${tuscanySDO.library.version}"/>
    <cpp-install-files
        srcdir="${sdo_axiom.dir}"
        files="*.h"
        destdir="${tuscanySDO.install.dir}/include"/>
  </target>

    <!-- clean -->

  <target name="clean.sdo">
    <cpp-clean-files
        dir="${tuscanySDO.install.dir}/include/${sdo.base.dir}"
        rmdir="true"/>
  	<cpp-clean-lib
  	    lib="${tuscany.sdo.lib}"
  	    librootdir="${tuscanySDO.install.dir}"/>
  	<cpp-clean-files
  	    dir="${sdo.lib.dir}"
  	    rmdir="true"/>
  </target>

  <target name="clean.sdo_axiom">
    <cpp-clean-files dir="${tuscanySDO.install.dir}/include"/>
    <cpp-clean-lib
       lib="${tuscany.sdo_axiom.lib}"
       librootdir="${tuscanySDO.install.dir}"/>
    <cpp-clean-files
       dir="${sdo_axiom.lib.dir}"
       rmdir="true"/>
  </target>
    
  <target name="clean.test">
    <ant target="clean" antfile="${this.dir}/test/build.xml" inheritAll="false"/>
    <ant target="clean" antfile="${this.dir}/sdo_axiom_test/build.xml" inheritAll="false"/>
  </target>
  
    <!-- Test -->

  <target name="test.sdo">
    <ant target="all" antfile="${this.dir}/test/build.xml" inheritAll="false"/>
  </target>
  
  <target name="test.sdo_axiom">
    <ant target="all" antfile="${this.dir}/sdo_axiom_test/build.xml" inheritAll="false"/>
  </target>

</project>