Changeset: 387e31a69107 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=387e31a69107
Modified Files:
        clients/examples/C/CMakeLists.txt
        clients/mapiclient/CMakeLists.txt
        clients/mapilib/CMakeLists.txt
        clients/odbc/driver/CMakeLists.txt
        clients/odbc/samples/CMakeLists.txt
        clients/odbc/winsetup/CMakeLists.txt
        common/options/CMakeLists.txt
        common/stream/CMakeLists.txt
        common/utils/CMakeLists.txt
        gdk/CMakeLists.txt
        geom/monetdb5/CMakeLists.txt
        monetdb5/extras/mal_optimizer_template/CMakeLists.txt
        monetdb5/mal/mal_linker.c
        monetdb5/tools/CMakeLists.txt
        sql/backends/monet5/CMakeLists.txt
        sql/backends/monet5/generator/CMakeLists.txt
        testing/CMakeLists.txt
        tools/mserver/CMakeLists.txt
Branch: cmake-fun
Log Message:

Install pdb files on Windows and revert library modules names.


diffs (truncated from 305 to 300 lines):

diff --git a/clients/examples/C/CMakeLists.txt 
b/clients/examples/C/CMakeLists.txt
--- a/clients/examples/C/CMakeLists.txt
+++ b/clients/examples/C/CMakeLists.txt
@@ -21,5 +21,10 @@ if(HAVE_TESTING)
        target_link_libraries(smack00 PRIVATE ${COMMON_LIBRARIES})
        add_executable(smack01 smack01.c)
        target_link_libraries(smack01 PRIVATE ${COMMON_LIBRARIES})
+
        install(TARGETS sample0 sample1 sample4 smack00 smack01 DESTINATION 
${BINDIR})
+       if(WIN32)
+               install(FILES $<TARGET_PDB_FILE:sample0> 
$<TARGET_PDB_FILE:sample1> $<TARGET_PDB_FILE:sample4>
+                               $<TARGET_PDB_FILE:smack00> 
$<TARGET_PDB_FILE:smack01> DESTINATION ${BINDIR} OPTIONAL)
+       endif()
 endif()
diff --git a/clients/mapiclient/CMakeLists.txt 
b/clients/mapiclient/CMakeLists.txt
--- a/clients/mapiclient/CMakeLists.txt
+++ b/clients/mapiclient/CMakeLists.txt
@@ -37,6 +37,9 @@ target_link_libraries(tomograph PRIVATE 
                                          ${ICONV_LIBRARIES} 
${CRYPTO_LIBRARIES})
 
 install(TARGETS mclient msqldump stethoscope tachograph tomograph DESTINATION 
${BINDIR})
-if(NOT WIN32)
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:mclient> $<TARGET_PDB_FILE:msqldump> 
$<TARGET_PDB_FILE:stethoscope>
+                       $<TARGET_PDB_FILE:tachograph> 
$<TARGET_PDB_FILE:tomograph> DESTINATION ${BINDIR} OPTIONAL)
+else()
        install(FILES mclient.1 msqldump.1 DESTINATION ${MANDIR}/man1)
 endif()
diff --git a/clients/mapilib/CMakeLists.txt b/clients/mapilib/CMakeLists.txt
--- a/clients/mapilib/CMakeLists.txt
+++ b/clients/mapilib/CMakeLists.txt
@@ -21,7 +21,9 @@ target_compile_definitions(mapi PRIVATE 
 install(TARGETS mapi DESTINATION ${LIBDIR})
 install(FILES mapi.h DESTINATION ${INCLUDEDIR}/monetdb)
 
-if(NOT WIN32)
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:mapi> DESTINATION ${LIBDIR} OPTIONAL)
+else()
        if(SOCKET_LIBRARIES)
                set(PKG_SOCKET_LIBS "-l${SOCKET_LIBRARIES}") #TODO fix this
        endif()
diff --git a/clients/odbc/driver/CMakeLists.txt 
b/clients/odbc/driver/CMakeLists.txt
--- a/clients/odbc/driver/CMakeLists.txt
+++ b/clients/odbc/driver/CMakeLists.txt
@@ -10,7 +10,7 @@ include_directories(../../mapilib ${ODBC
 
 set(MonetODBC_RC "")
 if(WIN32)
-       set(MonetODBC_RC driver.rc)
+       set(MonetODBC_RC driver.rc ODBC.syms)
 endif()
 
 add_library(MonetODBC MODULE
@@ -107,4 +107,8 @@ add_library(MonetODBC MODULE
                        SQLTransact.c ${MonetODBC_RC})
 target_link_libraries(MonetODBC PRIVATE mapi stream ${ICONV_LIBRARIES} 
${ODBCINST_LIBRARIES} ${CRYPTO_LIBRARIES}
                                          ${SOCKET_LIBRARIES})
+
 install(TARGETS MonetODBC DESTINATION ${LIBDIR})
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:MonetODBC> DESTINATION ${LIBDIR} 
OPTIONAL)
+endif()
diff --git a/clients/odbc/samples/CMakeLists.txt 
b/clients/odbc/samples/CMakeLists.txt
--- a/clients/odbc/samples/CMakeLists.txt
+++ b/clients/odbc/samples/CMakeLists.txt
@@ -17,5 +17,10 @@ if(HAVE_TESTING)
        target_link_libraries(arraytest PRIVATE ${ODBC_LIBRARIES})
        add_executable(testStmtAttr testStmtAttr.c)
        target_link_libraries(testStmtAttr PRIVATE ${ODBC_LIBRARIES})
+
        install(TARGETS odbcsample1 testgetinfo arraytest testStmtAttr 
DESTINATION ${BINDIR})
+       if(WIN32)
+               install(FILES $<TARGET_PDB_FILE:odbcsample1> 
$<TARGET_PDB_FILE:testgetinfo> $<TARGET_PDB_FILE:arraytest>
+                               $<TARGET_PDB_FILE:testStmtAttr> DESTINATION 
${BINDIR} OPTIONAL)
+       endif()
 endif()
diff --git a/clients/odbc/winsetup/CMakeLists.txt 
b/clients/odbc/winsetup/CMakeLists.txt
--- a/clients/odbc/winsetup/CMakeLists.txt
+++ b/clients/odbc/winsetup/CMakeLists.txt
@@ -15,3 +15,8 @@ install(TARGETS MonetODBCs DESTINATION $
 add_executable(odbcinstall install.c)
 target_link_libraries(odbcinstall PRIVATE version shlwapi ${ODBC_LIBRARIES} 
${ODBCINST_LIBRARIES})
 install(TARGETS odbcinstall DESTINATION ${BINDIR})
+
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:MonetODBCs> DESTINATION ${LIBDIR} 
OPTIONAL)
+       install(FILES $<TARGET_PDB_FILE:odbcinstall> DESTINATION ${BINDIR} 
OPTIONAL)
+endif()
diff --git a/common/options/CMakeLists.txt b/common/options/CMakeLists.txt
--- a/common/options/CMakeLists.txt
+++ b/common/options/CMakeLists.txt
@@ -12,6 +12,7 @@ if(WIN32)
        add_library(moptions SHARED ${OPTIONS_OBJECTS})
        target_compile_definitions(moptions PRIVATE LIBMOPTIONS LIBGDK LIBMAPI)
        install(TARGETS moptions DESTINATION ${LIBDIR})
+       install(FILES $<TARGET_PDB_FILE:moptions> DESTINATION ${LIBDIR} 
OPTIONAL)
 else()
        add_library(moptions STATIC ${OPTIONS_OBJECTS})
        set_target_properties(moptions PROPERTIES POSITION_INDEPENDENT_CODE ON)
diff --git a/common/stream/CMakeLists.txt b/common/stream/CMakeLists.txt
--- a/common/stream/CMakeLists.txt
+++ b/common/stream/CMakeLists.txt
@@ -18,7 +18,9 @@ target_compile_definitions(stream PRIVAT
 install(TARGETS stream DESTINATION ${LIBDIR})
 install(FILES stream_socket.h stream.h DESTINATION ${INCLUDEDIR}/monetdb)
 
-if(NOT WIN32)
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:stream> DESTINATION ${LIBDIR} OPTIONAL)
+else()
        if(CURL_FOUND)
                set(PKG_CURL "-lcurl")
        endif()
diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
--- a/common/utils/CMakeLists.txt
+++ b/common/utils/CMakeLists.txt
@@ -16,15 +16,18 @@ if(WIN32)
        add_library(mutils SHARED ${MUTILS_OBJECTS})
        target_compile_definitions(mutils PRIVATE LIBMUTILS LIBGDK LIBMEROUTIL)
        install(TARGETS mutils DESTINATION ${LIBDIR})
+       install(FILES $<TARGET_PDB_FILE:mutils> DESTINATION ${LIBDIR} OPTIONAL)
 
        add_library(mcrypt SHARED ${MCRYPT_OBJECTS})
        target_compile_definitions(mcrypt PRIVATE LIBMAPI LIBMCRYPT)
        install(TARGETS mcrypt DESTINATION ${LIBDIR})
+       install(FILES $<TARGET_PDB_FILE:mcrypt> DESTINATION ${LIBDIR} OPTIONAL)
 
        add_library(msabaoth SHARED ${MSABAOTH_OBJECTS})
        target_compile_definitions(msabaoth PRIVATE LIBMSABAOTH LIBMUUID LIBMAL 
LIBATOMS LIBKERNEL LIBOPTIMIZER LIBSCHEDULER
                                                           LIBMONETDB5)
        install(TARGETS msabaoth DESTINATION ${LIBDIR})
+       install(FILES $<TARGET_PDB_FILE:msabaoth> DESTINATION ${LIBDIR} 
OPTIONAL)
 else()
        add_library(mutils STATIC ${MUTILS_OBJECTS})
        set_target_properties(mutils PROPERTIES POSITION_INDEPENDENT_CODE ON)
diff --git a/gdk/CMakeLists.txt b/gdk/CMakeLists.txt
--- a/gdk/CMakeLists.txt
+++ b/gdk/CMakeLists.txt
@@ -58,7 +58,9 @@ install(FILES
                gdk_utils.h
                DESTINATION ${INCLUDEDIR}/monetdb)
 
-if(NOT WIN32)
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:gdk> DESTINATION ${LIBDIR} OPTIONAL)
+else()
        if(NOT MATH_LIBRARIES STREQUAL "")
                set(PKG_MATH_LIBRARIES "-l${MATH_LIBRARIES}")
        endif()
diff --git a/geom/monetdb5/CMakeLists.txt b/geom/monetdb5/CMakeLists.txt
--- a/geom/monetdb5/CMakeLists.txt
+++ b/geom/monetdb5/CMakeLists.txt
@@ -11,8 +11,12 @@ include_directories(../lib ../../gdk ../
 
 add_library(geom MODULE geom.h geom.c geomBulk.c geom_upgrade.c 
../lib/libgeom.c ../lib/libgeom.h)
 target_link_libraries(geom PRIVATE gdk stream monetdb5 ${GEOS_LIBRARIES} 
${PROJ_LIBRARIES})
+set_target_properties(geom PROPERTIES OUTPUT_NAME _geom)
 target_compile_definitions(geom PRIVATE LIBGEOM)
 
 install(TARGETS geom DESTINATION ${LIBDIR}/monetdb5)
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:geom> DESTINATION ${LIBDIR}/monetdb5 
OPTIONAL)
+endif()
 install(FILES geom.mal DESTINATION ${LIBDIR}/monetdb5)
 install(FILES 30_geom.mal DESTINATION ${LIBDIR}/monetdb5/autoload)
diff --git a/monetdb5/extras/mal_optimizer_template/CMakeLists.txt 
b/monetdb5/extras/mal_optimizer_template/CMakeLists.txt
--- a/monetdb5/extras/mal_optimizer_template/CMakeLists.txt
+++ b/monetdb5/extras/mal_optimizer_template/CMakeLists.txt
@@ -10,8 +10,12 @@ include_directories(../../optimizer ../.
 
 add_library(opt_sql_append MODULE opt_sql_append.c opt_sql_append.h)
 target_link_libraries(opt_sql_append PRIVATE monetdb5 gdk)
+set_target_properties(opt_sql_append PROPERTIES OUTPUT_NAME _opt_sql_append)
 target_compile_definitions(opt_sql_append PRIVATE LIBOPT_SQL_APPEND)
 
 install(TARGETS opt_sql_append DESTINATION ${LIBDIR}/monetdb5)
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:opt_sql_append> DESTINATION 
${LIBDIR}/monetdb5 OPTIONAL)
+endif()
 install(FILES opt_sql_append.mal DESTINATION ${LIBDIR}/monetdb5)
 install(FILES 91_opt_sql_append.mal DESTINATION ${LIBDIR}/monetdb5/autoload)
diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c
--- a/monetdb5/mal/mal_linker.c
+++ b/monetdb5/mal/mal_linker.c
@@ -194,11 +194,11 @@ loadLibrary(str filename, int flag)
 
                /* try hardcoded SO_EXT if that is the same for modules */
 #ifdef _AIX
-               len = snprintf(nme, FILENAME_MAX, "%.*s%c%s%s%s(%s%s.0)",
+               len = snprintf(nme, FILENAME_MAX, "%.*s%c%s_%s%s(%s_%s.0)",
                                 (int) (p - mod_path),
                                 mod_path, DIR_SEP, SO_PREFIX, s, SO_EXT, 
SO_PREFIX, s);
 #else
-               len = snprintf(nme, FILENAME_MAX, "%.*s%c%s%s%s",
+               len = snprintf(nme, FILENAME_MAX, "%.*s%c%s_%s%s",
                                 (int) (p - mod_path),
                                 mod_path, DIR_SEP, SO_PREFIX, s, SO_EXT);
 #endif
@@ -209,7 +209,7 @@ loadLibrary(str filename, int flag)
                        throw(LOADER, "loadLibrary", RUNTIME_LOAD_ERROR " 
failed to open library %s (from within file '%s'): %s", s, nme, dlerror());
                if (handle == NULL && strcmp(SO_EXT, ".so") != /* DISABLES CODE 
*/ (0)) {
                        /* try .so */
-                       len = snprintf(nme, FILENAME_MAX, "%.*s%c%s%s.so",
+                       len = snprintf(nme, FILENAME_MAX, "%.*s%c%s_%s.so",
                                         (int) (p - mod_path),
                                         mod_path, DIR_SEP, SO_PREFIX, s);
                        if (len == -1 || len >= FILENAME_MAX)
@@ -221,7 +221,7 @@ loadLibrary(str filename, int flag)
 #ifdef __APPLE__
                if (handle == NULL && strcmp(SO_EXT, ".bundle") != 0) {
                        /* try .bundle */
-                       len = snprintf(nme, FILENAME_MAX, "%.*s%c%s%s.bundle",
+                       len = snprintf(nme, FILENAME_MAX, "%.*s%c%s_%s.bundle",
                                         (int) (p - mod_path),
                                         mod_path, DIR_SEP, SO_PREFIX, s);
                        if (len == -1 || len >= FILENAME_MAX)
diff --git a/monetdb5/tools/CMakeLists.txt b/monetdb5/tools/CMakeLists.txt
--- a/monetdb5/tools/CMakeLists.txt
+++ b/monetdb5/tools/CMakeLists.txt
@@ -37,7 +37,9 @@ target_compile_definitions(monetdb5 PRIV
 
 install(TARGETS monetdb5 DESTINATION ${LIBDIR})
 
-if(NOT WIN32)
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:monetdb5> DESTINATION ${LIBDIR} 
OPTIONAL)
+else()
        if(LIBXML2_FOUND)
                set(PKG_LIBXML2 "libxml-2.0")
        endif()
diff --git a/sql/backends/monet5/CMakeLists.txt 
b/sql/backends/monet5/CMakeLists.txt
--- a/sql/backends/monet5/CMakeLists.txt
+++ b/sql/backends/monet5/CMakeLists.txt
@@ -45,6 +45,7 @@ add_library(sql MODULE
                        sql_rank.c sql_rank.h)
 target_link_libraries(sql PRIVATE monetdb5 mapi gdk stream ${CRYPTO_LIBRARIES} 
PUBLIC sqlserver store batstore
                                          sqlcommon)
+set_target_properties(sql PROPERTIES OUTPUT_NAME _sql)
 target_compile_definitions(sql PRIVATE LIBSQL LIBSQLSERVER LIBSQLCOMMON 
LIBBATSTORE LIBSTORE)
 
 install(TARGETS sql DESTINATION ${LIBDIR}/monetdb5)
@@ -54,6 +55,9 @@ install(FILES
                sql_rank.mal sqlcatalog.mal sql_transaction.mal sql.mal
                DESTINATION ${LIBDIR}/monetdb5)
 install(FILES 40_sql.mal DESTINATION ${LIBDIR}/monetdb5/autoload)
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:sql> DESTINATION ${LIBDIR}/monetdb5 
OPTIONAL)
+endif()
 
 if(HAVE_HGE)
        install(FILES sql_hge.mal sql_aggr_hge.mal sql_decimal_hge.mal 
sql_rank_hge.mal DESTINATION ${LIBDIR}/monetdb5)
diff --git a/sql/backends/monet5/generator/CMakeLists.txt 
b/sql/backends/monet5/generator/CMakeLists.txt
--- a/sql/backends/monet5/generator/CMakeLists.txt
+++ b/sql/backends/monet5/generator/CMakeLists.txt
@@ -13,9 +13,13 @@ include_directories(../../../include ../
 
 add_library(generator MODULE generator.c generator.h)
 target_link_libraries(generator PRIVATE monetdb5 gdk)
+set_target_properties(generator PROPERTIES OUTPUT_NAME _generator)
 target_compile_definitions(generator PRIVATE LIBGENERATOR)
 
 install(TARGETS generator DESTINATION ${LIBDIR}/monetdb5)
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:generator> DESTINATION 
${LIBDIR}/monetdb5 OPTIONAL)
+endif()
 install(FILES generator.mal DESTINATION ${LIBDIR}/monetdb5)
 install(FILES 90_generator.mal DESTINATION ${LIBDIR}/monetdb5/autoload)
 install(FILES 90_generator.sql DESTINATION ${LIBDIR}/monetdb5/createdb)
diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt
--- a/testing/CMakeLists.txt
+++ b/testing/CMakeLists.txt
@@ -70,8 +70,9 @@ endif()
 
 if(WIN32)
        install(FILES Mlog.bat Mtest.py.bat DESTINATION ${BINDIR})
+       install(FILES $<TARGET_PDB_FILE:Mdiff> DESTINATION ${BINDIR} OPTIONAL)
 else()
-       find_program(SH sh)
+       find_program(SH NAMES sh bash)
        if(NOT SH)
                message(FATAL_ERROR "A shell interpreter was not found")
        endif()
diff --git a/tools/mserver/CMakeLists.txt b/tools/mserver/CMakeLists.txt
--- a/tools/mserver/CMakeLists.txt
+++ b/tools/mserver/CMakeLists.txt
@@ -23,7 +23,9 @@ install(TARGETS mserver5 DESTINATION ${B
 install(FILES tomographintro.docx tomographintro.pdf DESTINATION 
${DATADIR}/doc/MonetDB-client-tools)
 install(FILES monetdblogo.png DESTINATION ${DATADIR}/doc/MonetDB)
 
-if(NOT WIN32)
+if(WIN32)
+       install(FILES $<TARGET_PDB_FILE:mserver5> DESTINATION ${BINDIR} 
OPTIONAL)
+else()
        set(localstatedir "${LOCALSTATEDIR}")
        configure_file(mserver5.1.in ${CMAKE_CURRENT_BINARY_DIR}/mserver5.1 
@ONLY)
        install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mserver5.1 DESTINATION 
${MANDIR}/man1)
@@ -37,4 +39,7 @@ if(HAVE_TESTING)
                                                  ${BZIP2_LIBRARIES} 
${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES} ${LIBLZMA_LIBRARIES} ${CURL_LIBRARIES}
                                                  ${ICONV_LIBRARIES})
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to