-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
32 lines (27 loc) · 970 Bytes
/
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
26
27
28
29
30
31
32
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# Avoid warnings in higher versions
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6)
CMAKE_POLICY(VERSION 2.8)
endif()
project(run_external)
# Path for MySQL include directory
SET(MYSQL_DIR_NAME_DOCSTRING "Path to MySQL directory")
IF(DEFINED MYSQL_DIR)
SET(MYSQL_DIR ${MYSQL_DIR} CACHE STRING ${MYSQL_DIR_NAME_DOCSTRING} FORCE)
ELSE()
MESSAGE(WARNING "${MYSQL_DIR_NAME_DOCSTRING} was not specified. If something goes wrong re-reun with option -DMYSQL_DIR")
ENDIF()
IF(EXISTS "${MYSQL_DIR}/include")
INCLUDE_DIRECTORIES("${MYSQL_DIR}/include")
ELSE()
INCLUDE_DIRECTORIES("${MYSQL_DIR}")
ENDIF()
ADD_DEFINITIONS("-DMYSQL_DYNAMIC_PLUGIN")
ADD_DEFINITIONS("-rdynamic")
ADD_DEFINITIONS("-fPIC")
ADD_LIBRARY(run_external MODULE run_external_udf.cc run_external_udf.def)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
TARGET_LINK_LIBRARIES(run_external wsock32)
ELSE()
TARGET_LINK_LIBRARIES(run_external)
ENDIF()