Changeset: 0e1c17f9f909 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0e1c17f9f909
Added Files:
        tools/CMakeLists.txt
        tools/merovingian/CMakeLists.txt
        tools/mserver/CMakeLists.txt
Modified Files:
        CMakeLists.txt
        clients/mapiclient/CMakeLists.txt
        clients/mapilib/CMakeLists.txt
        clients/mapilib/monetdb-mapi.pc.in
        common/stream/CMakeLists.txt
        common/utils/CMakeLists.txt
        monetdb5/tools/CMakeLists.txt
        sql/backends/monet5/CMakeLists.txt
        sql/scripts/CMakeLists.txt
        tools/mserver/shutdowntest.c
Branch: cmake-fun
Log Message:

Compiles and install mclient and mserver5.


diffs (257 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -753,6 +753,10 @@ find_library(M_LIBRARY NAMES m)
 if(M_LIBRARY)
        set(MATH_LIBS "m")
 endif()
+find_library(PSAPILIB_LIBRARY NAMES psapi)
+if(PSAPILIB_LIBRARY)
+       set(PSAPILIB_LIBS "psapi")
+endif()
 
 # Malloc libs
 set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};umem")
@@ -1952,8 +1956,8 @@ if(HAVE_SQL)
 endif()
 #[[if(HAVE_GEOM)
        add_subdirectory(geom)
-endif()
+endif()#]]
 add_subdirectory(tools)
-if(HAVE_TESTING)
+#[[if(HAVE_TESTING)
        add_subdirectory(testing)
 endif()#]]
diff --git a/clients/mapiclient/CMakeLists.txt 
b/clients/mapiclient/CMakeLists.txt
--- a/clients/mapiclient/CMakeLists.txt
+++ b/clients/mapiclient/CMakeLists.txt
@@ -39,3 +39,5 @@ add_dependencies(tomograph mcutil mutils
 target_link_libraries(tomograph mcutil mutils mapi stream ${SOCKET_LIBRARIES} 
${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES}
                                          ${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES} 
${LIBLZMA_LIBRARY} ${CURL_LIBRARY} ${Iconv_LIBRARY}
                                          ${OPENSSL_LIBRARIES})
+
+install(TARGETS mclient msqldump stethoscope tachograph tomograph DESTINATION 
${BINDIR})
diff --git a/clients/mapilib/CMakeLists.txt b/clients/mapilib/CMakeLists.txt
--- a/clients/mapilib/CMakeLists.txt
+++ b/clients/mapilib/CMakeLists.txt
@@ -12,3 +12,13 @@ add_library(mapi SHARED mapi.c)
 add_dependencies(mapi moptions mcrypt stream)
 target_link_libraries(mapi moptions mcrypt stream ${SOCKET_LIBRARIES} 
${OPENSSL_LIBRARIES})
 set_target_properties(mapi PROPERTIES VERSION ${MAPI_VERSION} SOVERSION 
${MAPI_VERSION_MAJOR})
+install(TARGETS mapi DESTINATION ${LIBDIR})
+install(FILES mapi.h DESTINATION ${INCLUDEDIR}/monetdb)
+
+if(NOT WIN32)
+       if(SOCKET_LIBRARIES)
+               set(PKG_SOCKET_LIBS "-l${SOCKET_LIBRARIES}") #TODO fix this
+       endif()
+       configure_file(monetdb-mapi.pc.in monetdb-mapi.pc @ONLY)
+       install(FILES monetdb-mapi.pc DESTINATION ${PKGCONFIGDIR})
+endif()
diff --git a/clients/mapilib/monetdb-mapi.pc.in 
b/clients/mapilib/monetdb-mapi.pc.in
--- a/clients/mapilib/monetdb-mapi.pc.in
+++ b/clients/mapilib/monetdb-mapi.pc.in
@@ -4,7 +4,7 @@
 #
 # Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 
-prefix=@prefix@
+prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${exec_prefix}
 libdir=${libdir}
 includedir=${includedir}
@@ -14,5 +14,5 @@ Description: MonetDB MAPI C-client libar
 Version: @PACKAGE_VERSION@
 Requires: monetdb-stream openssl
 
-Libs: -L${libdir} -lmapi @SOCKET_LIBS@
+Libs: -L${libdir} -lmapi @PKG_SOCKET_LIBS@
 Cflags: -I${includedir}/monetdb
diff --git a/common/stream/CMakeLists.txt b/common/stream/CMakeLists.txt
--- a/common/stream/CMakeLists.txt
+++ b/common/stream/CMakeLists.txt
@@ -10,9 +10,10 @@ include_directories(${ZLIB_INCLUDE_DIR} 
                                    ${LIBLZMA_INCLUDE_DIR} ${CURL_INCLUDE_DIR})
 
 add_library(stream SHARED stream.c stream.h stream_socket.h)
-target_link_libraries(stream ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} 
${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES}
+target_link_libraries(stream PRIVATE ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} 
${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES}
                                          ${LIBLZMA_LIBRARY} ${CURL_LIBRARY} 
${Iconv_LIBRARY})
 target_include_directories(stream PRIVATE ${Iconv_INCLUDE_DIR})
+set_target_properties(stream PROPERTIES VERSION ${STREAM_VERSION} SOVERSION 
${STREAM_VERSION_MAJOR})
 install(TARGETS stream LIBRARY DESTINATION ${LIBDIR})
 
 install(FILES stream_socket.h stream.h DESTINATION ${INCLUDEDIR})
@@ -36,8 +37,8 @@ if(NOT WIN32)
        if(SNAPPY_LIBRARIES)
                set(PKG_SNAPPY "-lsnappy")
        endif()
-       if(SOCKET_LIBS)
-               set(PKG_SOCKET_LIBS "-l${SOCKET_LIBS}") #TODO fix this
+       if(SOCKET_LIBRARIES)
+               set(PKG_SOCKET_LIBS "-l${SOCKET_LIBRARIES}") #TODO fix this
        endif()
        if(Iconv_LIBRARY AND NOT Iconv_IS_BUILT_IN)
                set(PKG_LIBICONV "-l${Iconv_LIBRARY}")
diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
--- a/common/utils/CMakeLists.txt
+++ b/common/utils/CMakeLists.txt
@@ -12,3 +12,5 @@ add_library(mutils STATIC mutils.h mutil
 add_library(mcrypt STATIC mcrypt.h mcrypt.c)
 add_library(muuid STATIC muuid.h muuid.c)
 add_library(msabaoth STATIC msabaoth.h msabaoth.c)
+add_dependencies(msabaoth muuid)
+target_link_libraries(msabaoth muuid)
diff --git a/monetdb5/tools/CMakeLists.txt b/monetdb5/tools/CMakeLists.txt
--- a/monetdb5/tools/CMakeLists.txt
+++ b/monetdb5/tools/CMakeLists.txt
@@ -23,6 +23,7 @@ add_library(monetdb5 SHARED monetdb.c)
 add_dependencies(monetdb5 ${MONETDB5_DEPENDENCIES})
 target_link_libraries(monetdb5 ${MONETDB5_LINK_LIBRARIES})
 set_target_properties(monetdb5 PROPERTIES VERSION ${MONETDB5_VERSION} 
SOVERSION ${MONETDB5_VERSION_MAJOR})
+install(TARGETS monetdb5 DESTINATION ${LIBDIR})
 
 if(NOT WIN32)
        if(MATH_LIBS)
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
@@ -44,3 +44,16 @@ add_library(sql MODULE
                        sql_rank.c sql_rank.h)
 target_link_libraries(sql store batstore sqlcommon mapi monetdb5 bat stream 
${OPENSSL_LIBRARIES})
 add_dependencies(sql store batstore sqlcommon mapi monetdb5 bat stream)
+
+install(FILES
+               sql_aggr_bte.mal sql_aggr_flt.mal sql_aggr_dbl.mal 
sql_aggr_int.mal sql_aggr_lng.mal
+               sql_aggr_sht.mal sql_decimal.mal sql_inspect.mal wlr.mal
+               sql_rank.mal sqlcatalog.mal sql_transaction.mal sql.mal
+               DESTINATION ${LIBDIR}/monetdb5)
+
+install(FILES 40_sql.mal DESTINATION ${LIBDIR}/monetdb5/autoload)
+
+if(HAVE_HGE)
+       install(FILES sql_hge.mal sql_aggr_hge.mal sql_decimal_hge.mal 
sql_rank_hge.mal DESTINATION ${LIBDIR}/monetdb5)
+       install(FILES 41_sql_hge.mal DESTINATION ${LIBDIR}/monetdb5/autoload)
+endif()
diff --git a/sql/scripts/CMakeLists.txt b/sql/scripts/CMakeLists.txt
--- a/sql/scripts/CMakeLists.txt
+++ b/sql/scripts/CMakeLists.txt
@@ -5,3 +5,37 @@
 #
 # Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 #]]
+
+install(FILES
+               09_like.sql
+               10_math.sql
+               11_times.sql
+               12_url.sql
+               13_date.sql
+               14_inet.sql
+               15_querylog.sql
+               16_tracelog.sql
+               17_temporal.sql
+               18_index.sql
+               20_vacuum.sql
+               21_dependency_views.sql
+               22_clients.sql
+               23_skyserver.sql
+               25_debug.sql
+               26_sysmon.sql
+               27_rejects.sql
+               39_analytics.sql
+               40_json.sql
+               41_md5sum.sql
+               45_uuid.sql
+               46_profiler.sql
+               51_sys_schema_extension.sql
+               60_wlcr.sql
+               75_storagemodel.sql
+               80_statistics.sql
+               99_system.sql
+               DESTINATION ${LIBDIR}/monetdb5/createdb)
+
+if(HAVE_HGE)
+       install(FILES 39_analytics_hge.sql 40_json_hge.sql DESTINATION 
${LIBDIR}/monetdb5/createdb)
+endif()
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/tools/CMakeLists.txt
@@ -0,0 +1,14 @@
+#[[
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0.  If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
+#]]
+
+if(HAVE_MONETDB5)
+       add_subdirectory(mserver)
+endif()
+if(NOT WIN32)
+       add_subdirectory(merovingian)
+endif()
diff --git a/tools/merovingian/CMakeLists.txt b/tools/merovingian/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/tools/merovingian/CMakeLists.txt
@@ -0,0 +1,7 @@
+#[[
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0.  If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
+#]]
diff --git a/tools/mserver/CMakeLists.txt b/tools/mserver/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/tools/mserver/CMakeLists.txt
@@ -0,0 +1,32 @@
+#[[
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0.  If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
+#]]
+
+include_directories(../../monetdb5/mal ../../gdk ../../common/stream 
../../common/utils ../../common/options
+                                       ../../monetdb5/modules/atoms 
../../monetdb5/modules/mal ../../sql/backends/monet5 ../../sql/common
+                                       ../../sql/include ../../sql/server 
../../sql/storage ${OPENSSL_INCS} ${PCRE_INCLUDE_DIR}
+                                       ${LIBXML2_INCLUDE_DIRS})
+
+configure_file(monet_version.c.in monet_version.c @ONLY)
+
+add_executable(mserver5 mserver5.c monet_version.h monet_version.c)
+add_dependencies(mserver5 monetdb5 mal bat stream mapi)
+target_link_libraries(mserver5 monetdb5 mal bat stream mapi ${UUID_LIBRARIES} 
${MATH_LIBS} ${SOCKET_LIBRARIES}
+                                         ${MALLOC_LIBS} ${PTHREAD_LIBRARIES} 
${PTHREAD_LIBRARIES} ${CMAKE_DL_LIBS} ${OPENSSL_LIBRARIES}
+                                         ${PCRE_LIBRARIES} 
${LIBXML2_LIBRARIES} ${PSAPILIB_LIBS} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES}
+                                         ${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES} 
${LIBLZMA_LIBRARY} ${CURL_LIBRARY} ${Iconv_LIBRARY})
+install(TARGETS mserver5 DESTINATION ${BINDIR})
+
+if(HAVE_TESTING)
+       add_executable(shutdowntest shutdowntest.c)
+       add_dependencies(shutdowntest monetdb5 mal bat stream mapi)
+       target_link_libraries(shutdowntest monetdb5 mal bat stream mapi 
${UUID_LIBRARIES} ${MATH_LIBS} ${SOCKET_LIBRARIES}
+                       ${MALLOC_LIBS} ${PTHREAD_LIBRARIES} 
${PTHREAD_LIBRARIES} ${CMAKE_DL_LIBS} ${OPENSSL_LIBRARIES}
+                       ${PCRE_LIBRARIES} ${LIBXML2_LIBRARIES} ${PSAPILIB_LIBS} 
${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES}
+                       ${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES} ${LIBLZMA_LIBRARY} 
${CURL_LIBRARY} ${Iconv_LIBRARY})
+       install(TARGETS mserver5 DESTINATION ${BINDIR})
+endif()
diff --git a/tools/mserver/shutdowntest.c b/tools/mserver/shutdowntest.c
--- a/tools/mserver/shutdowntest.c
+++ b/tools/mserver/shutdowntest.c
@@ -29,7 +29,7 @@ static char* dbdir = NULL;
    fcnname##_ptr_tpe fcnname##_ptr = NULL;
 
 #define LOAD_SQL_FUNCTION_PTR(fcnname)                                         
    \
-    fcnname##_ptr = (fcnname##_ptr_tpe) getAddress( #fcnname); \
+    fcnname##_ptr = (void*) getAddress( #fcnname); \
     if (fcnname##_ptr == NULL) {                                               
            \
         retval = #fcnname;  \
     }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to