CMakeLists.txt 1.0 KB
Newer Older
1
CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
H
hzcheng 已提交
2 3 4

PROJECT(TDengine)

S
slguan 已提交
5 6 7
IF (TD_MVN_INSTALLED)
  SET(JDBC_CMD_NAME "jdbc_cmd")
  SET(JDBC_TARGET_NAME "jdbc_target")  
8 9 10
  SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${JDBC_CMD_NAME}")
  file(GLOB_RECURSE _depends "${CMAKE_CURRENT_SOURCE_DIR}/src/*")
  ADD_CUSTOM_COMMAND(OUTPUT ${_output}
F
freemine 已提交
11
    POST_BUILD
12 13 14
    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/deploy-pom.xml
    DEPENDS ${_depends}
H
hzcheng 已提交
15
    COMMAND mvn -Dmaven.test.skip=true install -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
Z
Zhiyu Yang 已提交
16
    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-2.0.38-dist.jar ${LIBRARY_OUTPUT_PATH}
H
hzcheng 已提交
17
    COMMAND mvn -Dmaven.test.skip=true clean -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
18 19 20
    COMMAND ${CMAKE_COMMAND} -E touch "${_output}"
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    VERBATIM
H
hzcheng 已提交
21 22
    COMMENT "build jdbc driver")
  ADD_CUSTOM_TARGET(${JDBC_TARGET_NAME} ALL WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} DEPENDS ${JDBC_CMD_NAME})
23 24
  UNSET(_depends)
  UNSET(_output)
25
ENDIF ()