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