diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2016-08-19 15:27:37 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2016-08-19 15:27:37 +0000 |
commit | 7b89b9f5108c80f4f270da922d7e6c182a663719 (patch) | |
tree | 858a3873942f07610fb26685781e8bdbd3ab2c7f /client/CMakeLists.txt | |
parent | daff133ddf9a9d120050703c0b5753979c6190e0 (diff) | |
download | mariadb-git-7b89b9f5108c80f4f270da922d7e6c182a663719.tar.gz |
MDEV-9293 Connector/C integration
Diffstat (limited to 'client/CMakeLists.txt')
-rw-r--r-- | client/CMakeLists.txt | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index e4643ad9358..50280834a68 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -26,13 +26,23 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ) +ADD_DEFINITIONS(-DHAVE_OPENSSL=1) + +INCLUDE_DIRECTORIES( +BEFORE +${CONNECTOR_C_INSTALLDIR}/include/mariadb) + ## We will need libeay32.dll and ssleay32.dll when running client executables. COPY_OPENSSL_DLLS(copy_openssl_client) + +ADD_DEFINITIONS(-DHAVE_LIBMARIADB=1) +SET(CLIENT_LIB ${CONNECTOR_C_LIBS} mysys) + ADD_DEFINITIONS(${SSL_DEFINES}) MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc ${CMAKE_SOURCE_DIR}/sql/sql_string.cc) -TARGET_LINK_LIBRARIES(mysql mysqlclient) +TARGET_LINK_LIBRARIES(mysql ${CLIENT_LIB}) IF(UNIX) TARGET_LINK_LIBRARIES(mysql ${MY_READLINE_LIBRARY}) SET_TARGET_PROPERTIES(mysql PROPERTIES ENABLE_EXPORTS TRUE) @@ -40,39 +50,40 @@ ENDIF(UNIX) MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test) SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS") -TARGET_LINK_LIBRARIES(mysqltest mysqlclient pcre pcreposix) +TARGET_LINK_LIBRARIES(mysqltest ${CLIENT_LIB} pcre pcreposix) SET_TARGET_PROPERTIES(mysqltest PROPERTIES ENABLE_EXPORTS TRUE) MYSQL_ADD_EXECUTABLE(mysqlcheck mysqlcheck.c) -TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient) +TARGET_LINK_LIBRARIES(mysqlcheck ${CLIENT_LIB}) MYSQL_ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c) -TARGET_LINK_LIBRARIES(mysqldump mysqlclient) +TARGET_LINK_LIBRARIES(mysqldump ${CLIENT_LIB}) + MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c) SET_SOURCE_FILES_PROPERTIES(mysqlimport.c PROPERTIES COMPILE_FLAGS "-DTHREADS") -TARGET_LINK_LIBRARIES(mysqlimport mysqlclient) +TARGET_LINK_LIBRARIES(mysqlimport ${CLIENT_LIB}) MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c COMPONENT Server) -TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient) +TARGET_LINK_LIBRARIES(mysql_upgrade ${CLIENT_LIB}) ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs) MYSQL_ADD_EXECUTABLE(mysqlshow mysqlshow.c) -TARGET_LINK_LIBRARIES(mysqlshow mysqlclient) +TARGET_LINK_LIBRARIES(mysqlshow ${CLIENT_LIB}) MYSQL_ADD_EXECUTABLE(mysql_plugin mysql_plugin.c) -TARGET_LINK_LIBRARIES(mysql_plugin mysqlclient) +TARGET_LINK_LIBRARIES(mysql_plugin ${CLIENT_LIB}) MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc) -TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient) +TARGET_LINK_LIBRARIES(mysqlbinlog ${CLIENT_LIB}) -MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc) -TARGET_LINK_LIBRARIES(mysqladmin mysqlclient) +MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc ../sql/password.c) +TARGET_LINK_LIBRARIES(mysqladmin ${CLIENT_LIB}) MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c) SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS") -TARGET_LINK_LIBRARIES(mysqlslap mysqlclient) +TARGET_LINK_LIBRARIES(mysqlslap ${CLIENT_LIB}) # "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/". IF(WIN32) @@ -81,10 +92,16 @@ ENDIF(WIN32) # async_example is just a code example, do not install it. ADD_EXECUTABLE(async_example async_example.c) -TARGET_LINK_LIBRARIES(async_example mysqlclient) +TARGET_LINK_LIBRARIES(async_example ${CLIENT_LIB}) SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap mysql_plugin async_example PROPERTIES HAS_CXX TRUE) + +FOREACH(t mysql mysqltest mysqltest mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysql_plugin mysqlbinlog + mysqladmin mysqlslap async_example) + ADD_DEPENDENCIES(${t} GenError mariadb_connector_c) +ENDFOREACH() + ADD_DEFINITIONS(-DHAVE_DLOPEN) |