summaryrefslogtreecommitdiff
path: root/libmysql/CMakeLists.txt
diff options
context:
space:
mode:
authorunknown <kent@mysql.com/kent-amd64.(none)>2007-08-03 21:51:37 +0200
committerunknown <kent@mysql.com/kent-amd64.(none)>2007-08-03 21:51:37 +0200
commit29bd01e6c11c0d9df7f556f157b1b00e06306f60 (patch)
treee1463cc69b98560699aa561754652f5db4e1e3a2 /libmysql/CMakeLists.txt
parent5000893f39d0b885ebfad9c5ae7d2da83962ee9a (diff)
downloadmariadb-git-29bd01e6c11c0d9df7f556f157b1b00e06306f60.tar.gz
CMakeLists.txt, README, configure.js
Several adjustments to make client libraries pass the link test on both win32 and winx64, Visual Studio 2003 and 2005 (bug#30118) win/README: - Removed references to PARTITION engine, 5.1 only win/configure.js: - Removed references to PARTITION engine, 5.1 only extra/CMakeLists.txt: Use the special 'debug' list element to mark that "dbug" library is only to be linked against if build type "Debug". myisam/CMakeLists.txt: Use the special 'debug' list element to mark that "dbug" library is only to be linked against if build type "Debug". scripts/CMakeLists.txt: Use the special 'debug' list element to mark that "dbug" library is only to be linked against if build type "Debug". server-tools/instance-manager/CMakeLists.txt: Use the special 'debug' list element to mark that "dbug" library is only to be linked against if build type "Debug". sql/CMakeLists.txt: Use the special 'debug' list element to mark that "dbug" library is only to be linked against if build type "Debug". mysys/CMakeLists.txt: Restored include path to "mysys" itself dbug/CMakeLists.txt: Changed to optionally be included to give a file list only extra/yassl/CMakeLists.txt: Changed to optionally be included to give a file list only extra/yassl/taocrypt/CMakeLists.txt: Changed to optionally be included to give a file list only zlib/CMakeLists.txt: Changed to optionally be included to give a file list only libmysql/CMakeLists.txt: For compatibility with Visual Studio 2005, list all files that are to be part of the library build, i.e. libraries can't be built from other libraries. Set SOURCE_SUBLIBS and include the file listings from "zlib", "dbug", "taocrypt" and "yassl"
Diffstat (limited to 'libmysql/CMakeLists.txt')
-rwxr-xr-xlibmysql/CMakeLists.txt56
1 files changed, 42 insertions, 14 deletions
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index c659c36117a..59e70d68a6d 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -24,13 +24,43 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# have been a problem anyway, they don't use thread local storage.
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
- ${CMAKE_SOURCE_DIR}/zlib
- ${CMAKE_SOURCE_DIR}/extra/yassl/include
${CMAKE_SOURCE_DIR}/libmysql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/strings)
+# We include the source file listing instead of referencing the
+# libraries. At least with CMake 2.4 and Visual Studio 2005 a static
+# library created from other static libraries would not be complete,
+# i.e. the libraries listed in TARGET_LINK_LIBRARIES() were just
+# ignored.
+
+
+# Include and add the directory path
+SET(SOURCE_SUBLIBS TRUE)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt)
+FOREACH(rpath ${ZLIB_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../zlib/${rpath})
+ENDFOREACH(rpath)
+
+# FIXME only needed if build type is "Debug", but CMAKE_BUILD_TYPE is
+# not set during configure time.
+INCLUDE(${CMAKE_SOURCE_DIR}/dbug/CMakeLists.txt)
+FOREACH(rpath ${DBUG_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../dbug/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/CMakeLists.txt)
+FOREACH(rpath ${TAOCRYPT_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/taocrypt/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/CMakeLists.txt)
+FOREACH(rpath ${YASSL_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/${rpath})
+ENDFOREACH(rpath)
+
SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../strings/bmove_upp.c ../mysys/charset-def.c ../mysys/charset.c
../sql-common/client.c ../strings/ctype-big5.c ../strings/ctype-bin.c
@@ -66,7 +96,8 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.c
../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c
../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c
- ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c)
+ ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c
+ ${LIB_SOURCES})
# Need to set USE_TLS for building the DLL, since __declspec(thread)
# approach to thread local storage does not work properly in DLLs.
@@ -79,23 +110,20 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
# beond the documented API, and try access the Thread Local Storage.
# The "_notls" means no Tls*() functions used, i.e. "static" TLS.
-ADD_LIBRARY(libmysql SHARED dll.c libmysql.def ${CLIENT_SOURCES})
-ADD_LIBRARY(mysqlclient STATIC ${CLIENT_SOURCES})
+ADD_LIBRARY(libmysql SHARED ${CLIENT_SOURCES} dll.c libmysql.def)
+ADD_LIBRARY(mysqlclient STATIC ${CLIENT_SOURCES})
ADD_LIBRARY(mysqlclient_notls STATIC ${CLIENT_SOURCES})
SET_TARGET_PROPERTIES(libmysql mysqlclient PROPERTIES COMPILE_FLAGS "-DUSE_TLS")
-SET(CLIENT_LIB_DEPS yassl taocrypt zlib dbug GenError)
-SET(CLIENT_LIBS yassl taocrypt zlib debug dbug)
-
-ADD_DEPENDENCIES(libmysql ${CLIENT_LIB_DEPS})
-TARGET_LINK_LIBRARIES(libmysql ${CLIENT_LIBS} wsock32)
+ADD_DEPENDENCIES(libmysql GenError)
+TARGET_LINK_LIBRARIES(libmysql wsock32)
-ADD_DEPENDENCIES(mysqlclient ${CLIENT_LIB_DEPS})
-TARGET_LINK_LIBRARIES(mysqlclient ${CLIENT_LIBS})
+ADD_DEPENDENCIES(mysqlclient GenError)
+TARGET_LINK_LIBRARIES(mysqlclient)
-ADD_DEPENDENCIES(mysqlclient_notls ${CLIENT_LIB_DEPS})
-TARGET_LINK_LIBRARIES(mysqlclient_notls ${CLIENT_LIBS})
+ADD_DEPENDENCIES(mysqlclient_notls GenError)
+TARGET_LINK_LIBRARIES(mysqlclient_notls)
ADD_EXECUTABLE(myTest mytest.c)
TARGET_LINK_LIBRARIES(myTest libmysql)