blob: ba11f3454fe571e07db9ae0475182b503a115c09 [file] [log] [blame]
Pascal Bachd5f87e12014-12-12 15:59:17 +01001#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
19
Pascal Bachd5f87e12014-12-12 15:59:17 +010020if(IS_ABSOLUTE "${LIB_INSTALL_DIR}")
21 set(JAVA_INSTALL_DIR "${LIB_INSTALL_DIR}/java")
22else()
23 set(JAVA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/java")
24endif()
25
26if(IS_ABSOLUTE "${DOC_INSTALL_DIR}")
27 set(JAVA_DOC_INSTALL_DIR "${DOC_INSTALL_DIR}/java")
28else()
29 set(JAVA_DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}/java")
30endif()
31
32add_custom_target(ant_build ALL
33 COMMAND ${Ant_EXECUTABLE} ${ANT_FLAGS} -Dbuild.dir=${CMAKE_CURRENT_BINARY_DIR} -Dworking.dir=${work_dir} -f build.xml
34 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
35 COMMENT "Building Java library using Ant"
36)
37
38# Hook the ant install task into CMake install
39install(CODE "execute_process(
40 COMMAND ${Ant_EXECUTABLE} ${ANT_FLAGS} install
41 -Dbuild.dir=${CMAKE_CURRENT_BINARY_DIR} -Dworking.dir=${work_dir}
42 -Dinstall.path=${JAVA_INSTALL_DIR} -Dinstall.javadoc.path=${JAVA_DOC_INSTALL_DIR} -f build.xml
43 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
44)")
45
46if(BUILD_TESTING)
47 #add_subdirectory(test)
48endif()