summaryrefslogtreecommitdiff
blob: a1211fa87aea4cfc6313b9005fa8d596aeb2e117 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1047,8 +1047,6 @@ ENDIF()
 MYSQL_CHECK_SSL()
 MYSQL_CHECK_SSL_DLLS()
 
-# Add system/bundled editline.
-MYSQL_CHECK_EDITLINE()
 # Add libevent
 IF(NOT WITHOUT_SERVER)
   MYSQL_CHECK_LIBEVENT()
@@ -1140,7 +1138,9 @@ IF(WITH_UNIT_TESTS)
  ENABLE_TESTING()
 ENDIF()
 
-ADD_SUBDIRECTORY(include)
+IF(NOT WITHOUT_CLIENTLIBS)
+  ADD_SUBDIRECTORY(include)
+ENDIF(NOT WITHOUT_CLIENTLIBS)
 ADD_SUBDIRECTORY(dbug)
 ADD_SUBDIRECTORY(strings)
 ADD_SUBDIRECTORY(vio)
@@ -1173,7 +1173,6 @@ IF(WITH_UNIT_TESTS)
   ADD_SUBDIRECTORY(unittest/mytap/t)
 ENDIF()
 
-ADD_SUBDIRECTORY(client)
 ADD_SUBDIRECTORY(utilities)
 ADD_SUBDIRECTORY(share)
 ADD_SUBDIRECTORY(libservices)
@@ -1182,6 +1181,12 @@ IF(UNIX)
   ADD_SUBDIRECTORY(man)
 ENDIF()
 
+IF(NOT WITHOUT_TOOLS)
+  # Add system/bundled editline
+  MYSQL_CHECK_EDITLINE()
+  ADD_SUBDIRECTORY(client)
+ENDIF(NOT WITHOUT_TOOLS)
+
 IF(NOT WITHOUT_SERVER)
   ADD_SUBDIRECTORY(testclients)
   ADD_SUBDIRECTORY(sql)
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -240,12 +240,17 @@ IF(WIN32)
   LIST(APPEND LIBS_TO_MERGE auth_win_client)
 ENDIF()
 
-# LDAP authentication SASL client plugin
-MESSAGE(STATUS "Creating LDAP authentication SASL client library.")
-ADD_SUBDIRECTORY(authentication_ldap)
-  
-# Merge several convenience libraries into one big perconaserverclient
-MERGE_CONVENIENCE_LIBRARIES(perconaserverclient ${LIBS_TO_MERGE} COMPONENT Development)
+IF(WITHOUT_CLIENTLIBS)
+  # Merge several convenience libraries into one big perconaserverclient
+  MERGE_CONVENIENCE_LIBRARIES(perconaserverclient ${LIBS_TO_MERGE} COMPONENT Development SKIP_INSTALL)
+ELSE(WITHOUT_CLIENTLIBS)
+  # LDAP authentication SASL client plugin
+  MESSAGE(STATUS "Creating LDAP authentication SASL client library.")
+  ADD_SUBDIRECTORY(authentication_ldap)
+
+  # Merge several convenience libraries into one big perconaserverclient
+  MERGE_CONVENIENCE_LIBRARIES(perconaserverclient ${LIBS_TO_MERGE} COMPONENT Development)
+ENDIF(WITHOUT_CLIENTLIBS)
 TARGET_LINK_LIBRARIES(perconaserverclient PRIVATE ${LIBS_TO_LINK})
 
 # Visual Studio users need debug  static library for debug projects
@@ -284,9 +289,15 @@ ENDIF()
 IF(NOT DISABLE_SHARED)
   # Merge several convenience libraries into one big perconaserverclient
   # and link them together into shared library.
+IF(WITHOUT_CLIENTLIBS)
+  MERGE_LIBRARIES_SHARED(libmysql ${LIBS_TO_MERGE}
+    EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_FUNCTIONS_UNDOCUMENTED}
+    COMPONENT SharedLibraries SKIP_INSTALL)
+ELSE(WITHOUT_CLIENTLIBS)
   MERGE_LIBRARIES_SHARED(libmysql ${LIBS_TO_MERGE}
     EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_FUNCTIONS_UNDOCUMENTED}
     COMPONENT SharedLibraries)
+ENDIF(WITHOUT_CLIENTLIBS)
   TARGET_LINK_LIBRARIES(libmysql PRIVATE ${LIBS_TO_LINK})
 
   IF(WIN32)
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -470,14 +470,12 @@ ELSE()
 
   IF(WITH_SYSTEMD)
     SET(BIN_SCRIPTS
-      mysql_config
       mysqldumpslow
       ps_mysqld_helper
       ps-admin
       )
   ELSE()
     SET(BIN_SCRIPTS
-      mysql_config
       mysqldumpslow
       mysqld_multi
       mysqld_safe
@@ -486,6 +484,13 @@ ELSE()
       )
   ENDIF()
 
+  IF(NOT WITHOUT_CLIENTLIBS)
+    SET(BIN_SCRIPTS
+      ${BIN_SCRIPTS}
+      mysql_config
+    )
+  ENDIF(NOT WITHOUT_CLIENTLIBS)
+
   SET(PKGCONFIG_FILE ${LIBMYSQL_OS_OUTPUT_NAME}.pc)
   STRING(REGEX REPLACE "/mysql$" "" PKGCONFIG_DIR "${INSTALL_LIBDIR}")
   SET(PKGCONFIG_DIR "${PKGCONFIG_DIR}/pkgconfig")
@@ -500,7 +505,7 @@ ELSE()
     ${CMAKE_CURRENT_BINARY_DIR}/${PKGCONFIG_FILE}
     ESCAPE_QUOTES @ONLY)
 
-  IF(INSTALL_PKGCONFIGDIR)
+  IF(INSTALL_PKGCONFIGDIR AND NOT WITHOUT_CLIENTLIBS)
     MESSAGE(STATUS "INSTALL ${PKGCONFIG_FILE} ${INSTALL_PKGCONFIGDIR}")
     INSTALL(FILES
       ${CMAKE_CURRENT_BINARY_DIR}/${PKGCONFIG_FILE}
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -64,7 +64,9 @@ IF(UNIX)
        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
   ENDFOREACH()
 
-  INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
+  IF(NOT WITHOUT_CLIENTLIBS)
+    INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
+  ENDIF(NOT WITHOUT_CLIENTLIBS)
   
   SET(bindir ${prefix}/${INSTALL_BINDIR})
   SET(sbindir ${prefix}/${INSTALL_SBINDIR})
--- a/utilities/CMakeLists.txt
+++ b/utilities/CMakeLists.txt
@@ -90,22 +90,35 @@ IF(APPLE AND HAVE_CRYPTO_DYLIB AND HAVE_OPENSSL_DYLIB)
   ADD_DEPENDENCIES(comp_err copy_openssl_dlls)
 ENDIF()
 
-MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.cc)
+IF(WITHOUT_CLIENTLIBS)
+  MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.cc SKIP_INSTALL)
+  MYSQL_ADD_EXECUTABLE(perror perror.cc SKIP_INSTALL)
+  IF(BUILD_BUNDLED_LZ4)
+    MYSQL_ADD_EXECUTABLE(lz4_decompress lz4_decompress.cc SKIP_INSTALL)
+  ENDIF()
+ELSE(WITHOUT_CLIENTLIBS)
+  MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.cc)
+  MYSQL_ADD_EXECUTABLE(perror perror.cc)
+  IF (BUILD_BUNDLED_LZ4)
+    MYSQL_ADD_EXECUTABLE(lz4_decompress lz4_decompress.cc)
+  ENDIF()
+ENDIF()
+
 TARGET_LINK_LIBRARIES(my_print_defaults  mysys mysys_ssl)
 
-MYSQL_ADD_EXECUTABLE(perror perror.cc)
 ADD_DEPENDENCIES(perror GenError)
 TARGET_LINK_LIBRARIES(perror mysys mysys_ssl)
 
 IF (BUILD_BUNDLED_LZ4)
-  MYSQL_ADD_EXECUTABLE(lz4_decompress lz4_decompress.cc)
   TARGET_LINK_LIBRARIES(lz4_decompress ${LZ4_LIBRARY} mysys)
 ENDIF()
 
-IF (BUILD_BUNDLED_ZLIB OR NOT OPENSSL_EXECUTABLE_HAS_ZLIB)
+IF(WITHOUT_CLIENTLIBS)
+  MYSQL_ADD_EXECUTABLE(zlib_decompress zlib_decompress.cc SKIP_INSTALL)
+ELSE(WITHOUT_CLIENTLIBS)
   MYSQL_ADD_EXECUTABLE(zlib_decompress zlib_decompress.cc)
-  TARGET_LINK_LIBRARIES(zlib_decompress ${ZLIB_LIBRARY} mysys)
-ENDIF()
+ENDIF(WITHOUT_CLIENTLIBS)
+TARGET_LINK_LIBRARIES(zlib_decompress ${ZLIB_LIBRARY} mysys)
 
 IF(WITH_INNOBASE_STORAGE_ENGINE)