cloudflare/ClickHouse
Publicmirrored fromhttps://github.com/cloudflare/ClickHouse
base/mysqlxx/CMakeLists.txt
63lines · modecode
| 1 | add_library (mysqlxx |
| 2 | src/Connection.cpp |
| 3 | src/Exception.cpp |
| 4 | src/Query.cpp |
| 5 | src/ResultBase.cpp |
| 6 | src/StoreQueryResult.cpp |
| 7 | src/UseQueryResult.cpp |
| 8 | src/Row.cpp |
| 9 | src/Value.cpp |
| 10 | src/Pool.cpp |
| 11 | src/PoolFactory.cpp |
| 12 | src/PoolWithFailover.cpp |
| 13 | |
| 14 | include/mysqlxx/Connection.h |
| 15 | include/mysqlxx/Exception.h |
| 16 | include/mysqlxx/mysqlxx.h |
| 17 | include/mysqlxx/Null.h |
| 18 | include/mysqlxx/Pool.h |
| 19 | include/mysqlxx/PoolFactory.h |
| 20 | include/mysqlxx/PoolWithFailover.h |
| 21 | include/mysqlxx/Query.h |
| 22 | include/mysqlxx/ResultBase.h |
| 23 | include/mysqlxx/Row.h |
| 24 | include/mysqlxx/StoreQueryResult.h |
| 25 | include/mysqlxx/Transaction.h |
| 26 | include/mysqlxx/Types.h |
| 27 | include/mysqlxx/UseQueryResult.h |
| 28 | include/mysqlxx/Value.h |
| 29 | ) |
| 30 | |
| 31 | target_include_directories (mysqlxx PUBLIC include) |
| 32 | |
| 33 | if (USE_INTERNAL_MYSQL_LIBRARY) |
| 34 | target_include_directories (mysqlxx PUBLIC ${ClickHouse_SOURCE_DIR}/contrib/mariadb-connector-c/include) |
| 35 | target_include_directories (mysqlxx PUBLIC ${ClickHouse_BINARY_DIR}/contrib/mariadb-connector-c/include) |
| 36 | else () |
| 37 | set(PLATFORM_LIBRARIES ${CMAKE_DL_LIBS}) |
| 38 | |
| 39 | if (USE_MYSQL) |
| 40 | target_include_directories (mysqlxx SYSTEM PRIVATE ${MYSQL_INCLUDE_DIR}) |
| 41 | endif () |
| 42 | |
| 43 | if (APPLE) |
| 44 | find_library (ICONV_LIBRARY iconv) |
| 45 | set (MYSQLCLIENT_LIBRARIES ${MYSQLCLIENT_LIBRARIES} ${STATIC_MYSQLCLIENT_LIB} ${ICONV_LIBRARY}) |
| 46 | elseif (USE_STATIC_LIBRARIES AND STATIC_MYSQLCLIENT_LIB) |
| 47 | set (MYSQLCLIENT_LIBRARIES ${STATIC_MYSQLCLIENT_LIB}) |
| 48 | endif () |
| 49 | endif () |
| 50 | |
| 51 | target_link_libraries(mysqlxx PUBLIC common ${Poco_Util_LIBRARY} ${Poco_Foundation_LIBRARY} PRIVATE ${MYSQLCLIENT_LIBRARIES} PUBLIC ${Boost_SYSTEM_LIBRARY} PRIVATE ${ZLIB_LIBRARIES}) |
| 52 | if(OPENSSL_LIBRARIES) |
| 53 | target_link_libraries(mysqlxx PRIVATE ${OPENSSL_LIBRARIES}) |
| 54 | endif() |
| 55 | target_link_libraries(mysqlxx PRIVATE ${PLATFORM_LIBRARIES}) |
| 56 | |
| 57 | if (NOT USE_INTERNAL_MYSQL_LIBRARY AND OPENSSL_INCLUDE_DIR) |
| 58 | target_include_directories (mysqlxx SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR}) |
| 59 | endif () |
| 60 | |
| 61 | if (ENABLE_TESTS) |
| 62 | add_subdirectory (src/tests) |
| 63 | endif () |