ClickHouse/libs/libmysqlxx/CMakeLists.txt

53 lines
1.5 KiB
CMake
Raw Normal View History

2016-02-07 21:58:58 +00:00
add_library (mysqlxx
src/Connection.cpp
src/Query.cpp
src/ResultBase.cpp
src/StoreQueryResult.cpp
src/UseQueryResult.cpp
src/Value.cpp
src/PoolWithFailover.cpp
include/mysqlxx/Connection.h
include/mysqlxx/Exception.h
include/mysqlxx/Manip.h
include/mysqlxx/mysqlxx.h
include/mysqlxx/Null.h
include/mysqlxx/Pool.h
include/mysqlxx/PoolWithFailover.h
include/mysqlxx/Query.h
include/mysqlxx/ResultBase.h
include/mysqlxx/Row.h
include/mysqlxx/StoreQueryResult.h
include/mysqlxx/Transaction.h
include/mysqlxx/Types.h
include/mysqlxx/UseQueryResult.h
include/mysqlxx/Value.h
)
add_dependencies (mysqlxx common)
2016-12-01 22:44:59 +00:00
set (Z_HINTS "/usr/local/opt/zlib/lib")
if (USE_STATIC_LIBRARIES)
find_library (Z_LIB libz.a HINTS ${Z_HINTS})
else ()
find_library (Z_LIB z HINTS ${Z_HINTS})
endif ()
2016-02-07 21:58:58 +00:00
2016-12-01 22:44:59 +00:00
if (USE_STATIC_LIBRARIES)
set (MYSQLCLIENT_LIB ${CMAKE_CURRENT_BINARY_DIR}/libmysqlclient.a)
target_link_libraries (mysqlxx common ${MYSQLCLIENT_LIB} ${OPENSSL_LIBRARIES} ${Z_LIB} dl)
2016-12-06 16:51:34 +00:00
add_custom_command (
2016-12-01 22:44:59 +00:00
OUTPUT ${MYSQLCLIENT_LIB}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/patch.sh ${STATIC_MYSQLCLIENT_LIB} ${MYSQLCLIENT_LIB}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Patching mysqlclient library.")
2016-12-06 16:51:34 +00:00
add_custom_target (our_mysql_client DEPENDS ${MYSQLCLIENT_LIB})
add_dependencies (mysqlxx our_mysql_client)
2016-12-01 22:44:59 +00:00
endif ()
2016-02-07 21:58:58 +00:00
target_link_libraries (mysqlxx common ${MYSQLCLIENT_LIB} ${OPENSSL_LIBRARIES} ${Z_LIB} dl)
2016-12-01 22:44:59 +00:00
if (ENABLE_TESTS)
2016-02-07 21:58:58 +00:00
add_subdirectory (src/tests)
2016-12-01 22:44:59 +00:00
endif (ENABLE_TESTS)