CMakeLists.txt 932 字节
Newer Older
H
hzcheng 已提交
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
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)

PROJECT(TDengine)

AUX_SOURCE_DIRECTORY(./src SRC)
INCLUDE_DIRECTORIES(${PRJ_HEADER_PATH} ./inc ./jni ./jni/jni)

# generate dynamic library (*.so)
ADD_LIBRARY(taos SHARED ${SRC})
ADD_LIBRARY(taos_static STATIC ${SRC})
TARGET_LINK_LIBRARIES(taos_static trpc tutil pthread m rt)
TARGET_LINK_LIBRARIES(taos trpc tutil pthread m rt)

# set the static lib name
SET_TARGET_PROPERTIES(taos_static PROPERTIES OUTPUT_NAME "taos")

# enable static lib and so exists
SET_TARGET_PROPERTIES(taos PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(taos_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)

#set version of .so
#VERSION    so version
#SOVERSION  api version

execute_process(COMMAND ${PROJECT_SOURCE_DIR}/../../packaging/tools/get_version.sh
  OUTPUT_VARIABLE
  VERSION_INFO)
MESSAGE(STATUS "build version ${VERSION_INFO}")

SET_TARGET_PROPERTIES(taos PROPERTIES VERSION ${VERSION_INFO} SOVERSION 1)