forked from taosdata/taos-connector-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
25 lines (23 loc) · 1.04 KB
/
CMakeLists.txt
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
CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine)
IF (TD_MVN_INSTALLED)
SET(JDBC_CMD_NAME "jdbc_cmd")
SET(JDBC_TARGET_NAME "jdbc_target")
SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${JDBC_CMD_NAME}")
file(GLOB_RECURSE _depends "${CMAKE_CURRENT_SOURCE_DIR}/src/*")
ADD_CUSTOM_COMMAND(OUTPUT ${_output}
POST_BUILD
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/deploy-pom.xml
DEPENDS ${_depends}
COMMAND mvn -Dmaven.test.skip=true install -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-2.0.38-dist.jar ${LIBRARY_OUTPUT_PATH}
COMMAND mvn -Dmaven.test.skip=true clean -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
COMMAND ${CMAKE_COMMAND} -E touch "${_output}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
COMMENT "build jdbc driver")
ADD_CUSTOM_TARGET(${JDBC_TARGET_NAME} ALL WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} DEPENDS ${JDBC_CMD_NAME})
UNSET(_depends)
UNSET(_output)
ENDIF ()