Changeset: 4a40719a9909 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4a40719a9909
Modified Files:
sql/server/CMakeLists.txt
Branch: clean_parser
Log Message:
merged with default
diffs (truncated from 1036 to 300 lines):
diff --git a/clients/CMakeLists.txt b/clients/CMakeLists.txt
--- a/clients/CMakeLists.txt
+++ b/clients/CMakeLists.txt
@@ -11,7 +11,9 @@
#]]
add_subdirectory(mapilib)
-add_subdirectory(mapiclient)
+if(WITH_MAPI_CLIENT)
+ add_subdirectory(mapiclient)
+endif()
add_subdirectory(odbc)
if(TESTING)
add_subdirectory(examples)
diff --git a/clients/mapilib/CMakeLists.txt b/clients/mapilib/CMakeLists.txt
--- a/clients/mapilib/CMakeLists.txt
+++ b/clients/mapilib/CMakeLists.txt
@@ -10,9 +10,11 @@
# Copyright 1997 - July 2008 CWI.
#]]
-add_library(mapi
- SHARED)
-
+if(MONETDB_STATIC)
+ add_library(mapi STATIC)
+else()
+ add_library(mapi SHARED)
+endif()
# We need to add the public library twice to the target sources, once for
# the build interface and once for the install interface. This is because
@@ -92,11 +94,13 @@ install(TARGETS
COMPONENT clientdev
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-install(EXPORT mapiTargets
- FILE mapiTargets.cmake
- NAMESPACE MonetDB::
- DESTINATION ${EXPORT_TARGET_PATH}
- COMPONENT clientdev)
+if(NOT MONETDB_STATIC)
+ install(EXPORT mapiTargets
+ FILE mapiTargets.cmake
+ NAMESPACE MonetDB::
+ DESTINATION ${EXPORT_TARGET_PATH}
+ COMPONENT clientdev)
+endif()
if(WIN32)
install(FILES
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
@@ -14,8 +14,11 @@ if (${HAVE_ODBCINST})
add_compile_definitions(HAVE_SQLGETPRIVATEPROFILESTRING)
endif()
-add_library(MonetODBC
- MODULE)
+if(MONETDB_STATIC)
+ add_library(MonetODBC STATIC)
+else()
+ add_library(MonetODBC MODULE)
+endif()
target_sources(MonetODBC
PRIVATE
diff --git a/cmake/monetdb-options.cmake b/cmake/monetdb-options.cmake
--- a/cmake/monetdb-options.cmake
+++ b/cmake/monetdb-options.cmake
@@ -156,3 +156,27 @@ option(CMAKE_SUMMARY
option(CMAKE_UNITTESTS
"Build and run the unittest for the build system"
OFF)
+
+option(MONETDB_STATIC
+ "Enable static compilation mode"
+ OFF)
+
+option(WITH_UDF
+ "Include UDF support"
+ ON)
+
+option(WITH_VAULTS
+ "Include UDF support"
+ ON)
+
+option(WITH_MEROVINGIAN
+ "Build merovingian and friends"
+ ON)
+
+option(WITH_MSERVER5
+ "Build mserver5"
+ ON)
+
+option(WITH_MAPI_CLIENT
+ "Build mapi clients(mclient, msqldump)"
+ ON)
diff --git a/common/options/CMakeLists.txt b/common/options/CMakeLists.txt
--- a/common/options/CMakeLists.txt
+++ b/common/options/CMakeLists.txt
@@ -35,10 +35,12 @@ target_link_libraries(moptions
monetdb_config_header
$<$<PLATFORM_ID:Windows>:${GETOPT_LIB}>)
-set_target_properties(moptions
- PROPERTIES
- POSITION_INDEPENDENT_CODE ON
- PUBLIC_HEADER "${moptions_public_headers}")
+if(NOT MONETDB_STATIC)
+ set_target_properties(moptions
+ PROPERTIES
+ POSITION_INDEPENDENT_CODE ON
+ PUBLIC_HEADER "${moptions_public_headers}")
+endif()
install(FILES
monet_options.h
@@ -46,3 +48,18 @@ install(FILES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monetdb
COMPONENT
monetdbdev)
+
+if(MONETDB_STATIC)
+ install(TARGETS
+ moptions
+ COMPONENT monetdbdev
+ RUNTIME
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monetdb
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+endif()
diff --git a/common/stream/CMakeLists.txt b/common/stream/CMakeLists.txt
--- a/common/stream/CMakeLists.txt
+++ b/common/stream/CMakeLists.txt
@@ -16,8 +16,11 @@ set(stream_public_headers
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/stream.h>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/stream_socket.h>)
-add_library(stream
- SHARED)
+if(MONETDB_STATIC)
+ add_library(stream STATIC)
+else()
+ add_library(stream SHARED)
+endif()
target_sources(stream
PRIVATE
@@ -125,11 +128,13 @@ install(TARGETS
COMPONENT streamdev
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-install(EXPORT streamTargets
- FILE streamTargets.cmake
- NAMESPACE MonetDB::
- DESTINATION ${EXPORT_TARGET_PATH}
- COMPONENT streamdev)
+if(NOT MONETDB_STATIC)
+ install(EXPORT streamTargets
+ FILE streamTargets.cmake
+ NAMESPACE MonetDB::
+ DESTINATION ${EXPORT_TARGET_PATH}
+ COMPONENT streamdev)
+endif()
if(WIN32)
install(FILES
diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
--- a/common/utils/CMakeLists.txt
+++ b/common/utils/CMakeLists.txt
@@ -34,17 +34,19 @@ target_link_libraries(mutils
target_compile_definitions(mutils PRIVATE
LIBMUTILS)
-set_target_properties(mutils
- PROPERTIES
- POSITION_INDEPENDENT_CODE ON
- PUBLIC_HEADER mutils.h)
+if(NOT MONETDB_STATIC)
+ set_target_properties(mutils
+ PROPERTIES
+ POSITION_INDEPENDENT_CODE ON
+ PUBLIC_HEADER mutils.h)
+endif()
add_custom_target(version
${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/monetdb_hgversion.h.in
- -D DST=${CMAKE_CURRENT_BINARY_DIR}/monetdb_hgversion.h
- -D DIR=${CMAKE_SOURCE_DIR}
- -P ${CMAKE_CURRENT_SOURCE_DIR}/GenerateVersionHeader.cmake
- )
+ -D DST=${CMAKE_CURRENT_BINARY_DIR}/monetdb_hgversion.h
+ -D DIR=${CMAKE_SOURCE_DIR}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/GenerateVersionHeader.cmake
+)
add_dependencies(mutils version)
add_library(mcrypt STATIC)
@@ -73,10 +75,12 @@ target_compile_definitions(mcrypt
PRIVATE
LIBMCRYPT)
-set_target_properties(mcrypt
- PROPERTIES
- POSITION_INDEPENDENT_CODE ON
- PUBLIC_HEADER mcrypt.h)
+if(NOT MONETDB_STATIC)
+ set_target_properties(mcrypt
+ PROPERTIES
+ POSITION_INDEPENDENT_CODE ON
+ PUBLIC_HEADER mcrypt.h)
+endif()
set(msabaoth_public_headers
${CMAKE_CURRENT_SOURCE_DIR}/msabaoth.h
@@ -105,10 +109,12 @@ target_compile_definitions(msabaoth
PRIVATE
LIBMSABAOTH)
-set_target_properties(msabaoth
- PROPERTIES
- POSITION_INDEPENDENT_CODE ON
- PUBLIC_HEADER "${msabaoth_public_headers}")
+if(NOT MONETDB_STATIC)
+ set_target_properties(msabaoth
+ PROPERTIES
+ POSITION_INDEPENDENT_CODE ON
+ PUBLIC_HEADER "${msabaoth_public_headers}")
+endif()
add_library(matomic INTERFACE)
@@ -141,10 +147,12 @@ target_link_libraries(mprompt
PRIVATE
monetdb_config_header)
-set_target_properties(mprompt
- PROPERTIES
- POSITION_INDEPENDENT_CODE ON
- PUBLIC_HEADER mprompt.h)
+if(NOT MONETDB_STATIC)
+ set_target_properties(mprompt
+ PROPERTIES
+ POSITION_INDEPENDENT_CODE ON
+ PUBLIC_HEADER mprompt.h)
+endif()
add_library(mutf8 STATIC)
@@ -211,3 +219,18 @@ install(FILES
${CMAKE_INSTALL_INCLUDEDIR}/monetdb
COMPONENT
monetdbdev)
+
+if(MONETDB_STATIC)
+ install(TARGETS
+ mutils
+ mcrypt
+ msabaoth
+ mprompt
+ COMPONENT monetdbdev
+ RUNTIME
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif()
diff --git a/ctest/tools/monetdbe/CMakeLists.txt
b/ctest/tools/monetdbe/CMakeLists.txt
--- a/ctest/tools/monetdbe/CMakeLists.txt
+++ b/ctest/tools/monetdbe/CMakeLists.txt
@@ -10,115 +10,117 @@
# Copyright 1997 - July 2008 CWI.
#]]
-add_executable(example1 example1.c)
-target_link_libraries(example1
- PRIVATE
- monetdb_config_header
- monetdbe)
-add_test(run_example1 example1)
-
-add_executable(example2 example2.c)
-target_link_libraries(example2
- PRIVATE
- monetdb_config_header
- monetdbe)
-add_test(run_example2 example2)
-
-add_executable(example_temporal example_temporal.c)
-target_link_libraries(example_temporal
- PRIVATE
+if(NOT MONETDB_STATIC)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]