2018-02-08 19:12:37 +00:00
|
|
|
add_library (mysqlxx ${SPLIT_SHARED}
|
2017-04-01 07:20:54 +00:00
|
|
|
src/Connection.cpp
|
|
|
|
src/Exception.cpp
|
|
|
|
src/Query.cpp
|
|
|
|
src/ResultBase.cpp
|
|
|
|
src/StoreQueryResult.cpp
|
|
|
|
src/UseQueryResult.cpp
|
|
|
|
src/Row.cpp
|
|
|
|
src/Value.cpp
|
|
|
|
src/Pool.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
|
2016-02-07 21:58:58 +00:00
|
|
|
)
|
|
|
|
|
2017-08-03 12:44:39 +00:00
|
|
|
target_include_directories (mysqlxx PUBLIC include)
|
|
|
|
|
2017-08-31 17:11:30 +00:00
|
|
|
set(PLATFORM_LIBRARIES ${CMAKE_DL_LIBS})
|
2016-12-24 01:03:10 +00:00
|
|
|
|
2017-09-04 17:04:33 +00:00
|
|
|
if (USE_MYSQL)
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (mysqlxx SYSTEM PRIVATE ${MYSQL_INCLUDE_DIR})
|
2017-09-04 17:04:33 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (USE_STATIC_LIBRARIES AND STATIC_MYSQLCLIENT_LIB)
|
2017-04-01 07:20:54 +00:00
|
|
|
set (MYSQLCLIENT_LIB ${CMAKE_CURRENT_BINARY_DIR}/libmysqlclient.a)
|
|
|
|
add_custom_command (
|
|
|
|
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.")
|
|
|
|
add_custom_target (our_mysql_client DEPENDS ${MYSQLCLIENT_LIB})
|
|
|
|
add_dependencies (mysqlxx our_mysql_client)
|
2017-08-31 17:11:30 +00:00
|
|
|
set (MYSQLCLIENT_LIBRARIES ${MYSQLCLIENT_LIB})
|
2016-12-01 22:44:59 +00:00
|
|
|
endif ()
|
2016-02-07 21:58:58 +00:00
|
|
|
|
2017-08-31 17:11:30 +00:00
|
|
|
target_link_libraries (mysqlxx common ${MYSQLCLIENT_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_LIBRARIES})
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories (mysqlxx SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR})
|
2016-12-01 22:44:59 +00:00
|
|
|
|
|
|
|
if (ENABLE_TESTS)
|
2017-04-01 07:20:54 +00:00
|
|
|
add_subdirectory (src/tests)
|
2017-04-10 17:43:30 +00:00
|
|
|
endif ()
|