Changeset: dab3e4076cf9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dab3e4076cf9
Modified Files:
        CMakeLists.txt
        CMakeReadme.txt
        buildtools/conf/CMakeLists.txt
        sql/backends/monet5/UDF/CMakeLists.txt
        sql/backends/monet5/UDF/capi/Tests/All
        testing/CMakeLists.txt
        testing/Mtest.py.in
Branch: cmake-fun
Log Message:

More cleanup:

- Removed ENABLE_ASSERT and ENABLE_DEVELOPER options due to their low usage.
- Removed compile definitions no longer needed for MSVC build.
- Added ENABLE_CINTEGRATION option to optionally remove the C UDFs module.
- We don't need to find a thread library if we are not building the GDK module.
- Removed non used conditionals in the tests.
- Fixed optimizations flags for release builds with minimum size.
- -g3 flag only exists in gcc.
- Fixed PCRE test.


diffs (truncated from 683 to 300 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,11 +8,27 @@
 
 cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
 
-project(MonetDB C)
+# Change these variables between releases
+set(MONETDB_VERSION_MAJOR "11")
+set(MONETDB_VERSION "${MONETDB_VERSION_MAJOR}.34.0")
+set(VERSION "${MONETDB_VERSION}")
+
+set(GDK_VERSION_MAJOR "18")
+set(GDK_VERSION "${GDK_VERSION_MAJOR}.0.0")
 
+set(MAPI_VERSION_MAJOR "12")
+set(MAPI_VERSION "${MAPI_VERSION_MAJOR}.0.0")
+
+set(MONETDB5_VERSION_MAJOR "27")
+set(MONETDB5_VERSION "${MONETDB5_VERSION_MAJOR}.0.0")
+
+set(STREAM_VERSION_MAJOR "13")
+set(STREAM_VERSION "${STREAM_VERSION_MAJOR}.0.0")
+
+project(MonetDB VERSION "${MONETDB_VERSION}" DESCRIPTION "MonetDB, SQL queries 
at light speed"
+               HOMEPAGE_URL "https://www.monetdb.org/"; LANGUAGES C)
 set(C_STANDARD_REQUIRED ON)
 set(CMAKE_C_STANDARD 99)
-set(PACKAGE "MonetDB" CACHE STRING "MonetDB, SQL queries at light speed")
 
 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" CACHE INTERNAL "Location of 
custom CMake modules.")
 include(CheckCSourceCompiles REQUIRED)
@@ -33,42 +49,28 @@ string(TOLOWER "${CMAKE_SYSTEM_NAME}" CM
 string(TOLOWER "${CMAKE_C_COMPILER_ID}" CMAKE_C_COMPILER_ID_LOWER)
 set("HOST" 
"${CMAKE_SYSTEM_PROCESSOR_LOWER}-pc-${CMAKE_SYSTEM_NAME_LOWER}-${CMAKE_C_COMPILER_ID_LOWER}")
 
-# Change these variables between releases
-set(MONETDB_VERSION_MAJOR "11")
-set(MONETDB_VERSION "${MONETDB_VERSION_MAJOR}.34.0")
-set(VERSION "${MONETDB_VERSION}")
-
-set(GDK_VERSION_MAJOR "18")
-set(GDK_VERSION "${GDK_VERSION_MAJOR}.0.0")
-
-set(MAPI_VERSION_MAJOR "12")
-set(MAPI_VERSION "${MAPI_VERSION_MAJOR}.0.0")
-
-set(MONETDB5_VERSION_MAJOR "27")
-set(MONETDB5_VERSION "${MONETDB5_VERSION_MAJOR}.0.0")
-
-set(STREAM_VERSION_MAJOR "13")
-set(STREAM_VERSION "${STREAM_VERSION_MAJOR}.0.0")
-
 # Packaging information
 set(PACKAGE "MonetDB")
 set(PACKAGE_NAME "MonetDB")
 set(PACKAGE_TARNAME "MonetDB")
 set(PACKAGE_STRING "MonetDB ${MONETDB_VERSION}")
-set(PACKAGE_URL "https://www.monetdb.org/";)
+set(PACKAGE_URL "${MonetDB_HOMEPAGE_URL}")
 set(PACKAGE_BUGREPORT "https://bugs.monetdb.org/";)
 set(PACKAGE_VERSION "${MONETDB_VERSION}")
 
+set(DFT_STRICT "NO")
 # Check current version control revision
 if(EXISTS "${CMAKE_SOURCE_DIR}/.hg")
        exec_program("hg" "${CMAKE_SOURCE_DIR}" ARGS "id -i" OUTPUT_VARIABLE 
HG_OUPUT_RES RETURN_VALUE HG_RETURN_CODE)
        if(HG_RETURN_CODE EQUAL 0 AND HG_OUPUT_RES)
                set(MERCURIAL_ID "${HG_OUPUT_RES}")
+               set(DFT_STRICT "YES")
        endif()
 elseif(EXISTS "${CMAKE_SOURCE_DIR}/.git")
        exec_program("git" "${CMAKE_SOURCE_DIR}" ARGS "rev-parse HEAD" 
OUTPUT_VARIABLE GIT_OUPUT_RES RETURN_VALUE GIT_RETURN_CODE)
        if(GIT_RETURN_CODE EQUAL 0 AND GIT_OUPUT_RES)
                set(MERCURIAL_ID "${GIT_OUPUT_RES}+")
+               set(DFT_STRICT "YES")
        endif()
 endif()
 
@@ -81,15 +83,6 @@ if(NOT CMAKE_BUILD_TYPE)
        message(STATUS "Setting build type to Debug as none was selected")
        set(CMAKE_BUILD_TYPE Debug CACHE STRING "The type of build" FORCE)
 endif()
-if(MERCURIAL_ID) # Developers compiling from Mercurial
-       set(DFT_STRICT "YES")
-       set(DFT_ASSERT "YES")
-       set(DFT_DEVELOPER "YES")
-else() # Users compiling from source tarball(s):
-       set(DFT_STRICT "NO")
-       set(DFT_ASSERT "NO")
-       set(DFT_DEVELOPER "NO")
-endif()
 
 # modules to use
 set(ENABLE_MAPI "YES" CACHE STRING "Enable MAPI (default=YES)")
@@ -98,26 +91,8 @@ if(NOT ${ENABLE_MAPI} STREQUAL "NO")
 endif()
 
 set(ENABLE_GDK "YES" CACHE STRING "Enable support for GDK (default=YES)")
-
 set(ENABLE_MONETDB5 "YES" CACHE STRING "Enable support for MonetDB5 
(default=YES)")
-if(${ENABLE_GDK} STREQUAL "NO")
-       if(${ENABLE_MONETDB5} STREQUAL "YES")
-               message(FATAL_ERROR "MonetDB5 requires GDK")
-       elseif(${ENABLE_MONETDB5} STREQUAL "AUTO")
-               set(ENABLE_MONETDB5 "NO")
-       endif()
-else()
-       set(HAVE_GDK ON)
-endif()
-
 set(ENABLE_SQL "YES" CACHE STRING "Enable support for MonetDB/SQL 
(default=YES)")
-if(${ENABLE_MONETDB5} STREQUAL "NO")
-       if(${ENABLE_SQL} STREQUAL "YES")
-               message(FATAL_ERROR "MonetDB/SQL requires MonetDB5")
-       elseif(${ENABLE_SQL} STREQUAL "AUTO")
-               set(ENABLE_SQL "NO")
-       endif()
-endif()
 
 set(ENABLE_EMBEDDED "NO" CACHE STRING "Enable support for running MonetDB as a 
library (default=NO)") # TODO check this
 if(NOT ${ENABLE_EMBEDDED} STREQUAL "NO")
@@ -129,13 +104,8 @@ if(NOT ${ENABLE_CONSOLE} STREQUAL "NO")
        set(HAVE_CONSOLE ON)
 endif()
 
-set(ENABLE_ASSERT "${DFT_ASSERT}" CACHE STRING "Enable assertions in the code 
(default=YES for development sources, NO for tarball instalation)")
 set(ENABLE_STRICT "${DFT_STRICT}" CACHE STRING "Enable strict compiler flags 
(default=YES for development sources, NO for tarball instalation)")
 set(ENABLE_SANITIZER "NO" CACHE STRING "Enable support for the GCC address 
sanitizer (default=NO)")
-set(ENABLE_DEVELOPER "${DFT_DEVELOPER}" CACHE STRING "Enable full debugging 
(default=YES for development sources, NO for tarball instalation)")
-if(NOT ${ENABLE_DEVELOPER} STREQUAL "NO")
-       set(HAVE_DEVELOPER ON)
-endif()
 set(ENABLE_STATIC_ANALYSIS "NO" CACHE STRING "Configure for static code 
analysis (use only if you know what you are doing)")
 if(NOT ${ENABLE_STATIC_ANALYSIS} STREQUAL "NO")
        set(STATIC_CODE_ANALYSIS ON)
@@ -175,7 +145,7 @@ else()
        set(PKGCONFIGDIR "${LIBDIR}/pkgconfig")
 endif()
 
-set(PROGRAM_PERMISSIONS_DEFAULT OWNER_WRITE OWNER_READ OWNER_EXECUTE 
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+set(PROGRAM_PERMISSIONS_DEFAULT OWNER_WRITE OWNER_READ OWNER_EXECUTE 
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # required for some 
instalation files
 
 # password hash algorithm
 set(PASSWORD_BACKEND "SHA512" CACHE STRING "Password hash algorithm, one of 
MD5, SHA1, RIPEMD160, SHA224, SHA256, SHA384, SHA512, defaults to SHA512")
@@ -196,7 +166,7 @@ elseif(MSVC)
        set(_Noreturn "__declspec(noreturn)")
        set(__attribute__(a) ON)
        set(restrict "__restrict")
-       add_compile_definitions(_CRT_SECURE_NO_WARNINGS 
_CRT_SECURE_NO_DEPRECATE _WINSOCK_DEPRECATED_NO_WARNINGS)
+       add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
        if(CMAKE_SIZEOF_VOID_P EQUAL 8)  # Windows 64 bit
                set(HAVE__MUL128 ON)
        endif()
@@ -312,11 +282,23 @@ elseif("${ENABLE_PY3INTEGRATION}" STREQU
 endif()
 
 set(ENABLE_TESTING "AUTO" CACHE STRING "Enable support for testing 
(default=AUTO)")
-if(NOT "${ENABLE_TESTING}" STREQUAL "NO" AND NOT HAVE_PYTHON3)
-       set(ENABLE_TESTING "NO")
+if("${ENABLE_TESTING}" STREQUAL "YES" AND NOT HAVE_PYTHON3)
+       message(FATAL_ERROR "A valid Python 3 interpreter is required for 
MonetDB testing tools")
+endif()
+if(NOT "${ENABLE_TESTING}" STREQUAL "NO" AND HAVE_PYTHON3)
+       set(HAVE_TESTING ON)
 endif()
-if(NOT "${ENABLE_TESTING}" STREQUAL "NO")
-       set(HAVE_TESTING ON)
+
+set(ENABLE_CINTEGRATION "AUTO" CACHE STRING "Enable support for C UDFs 
(default=AUTO)")
+if("${ENABLE_CINTEGRATION}" STREQUAL "YES")
+       if(NOT HAVE_PYTHON3)
+               message(FATAL_ERROR "A valid Python 3 interpreter is required 
to compile the C UDFs module")
+       elseif(WIN32)
+               message(FATAL_ERROR "The C UDFs module is not avaiable on 
Windows")
+       endif()
+endif()
+if(NOT "${ENABLE_CINTEGRATION}" STREQUAL "NO" AND HAVE_PYTHON3 AND NOT WIN32)
+       set(HAVE_CUDF ON)
 endif()
 
 if(WIN32)
@@ -403,9 +385,9 @@ if(NOT ${WITH_LZ4} STREQUAL "NO")
                set(LZ4_MINIMUM_VERSION "1.8.0")
                if(LZ4_VERSION VERSION_LESS "${LZ4_MINIMUM_VERSION}")
                        if(${WITH_LZ4} STREQUAL "YES")
-                               message(FATAL_ERROR "lz4 library found but 
version is too old: ${LZ4_VERSION} < ${LZ4_MINIMUM_VERSION}")
+                               message(FATAL_ERROR "lz4 library found, but the 
version is too old: ${LZ4_VERSION} < ${LZ4_MINIMUM_VERSION}")
                        else()
-                               message(STATUS "lz4 library found but version 
is too old: ${LZ4_VERSION} < ${LZ4_MINIMUM_VERSION}")
+                               message(STATUS "lz4 library found, but the 
version is too old: ${LZ4_VERSION} < ${LZ4_MINIMUM_VERSION}")
                        endif()
                else()
                        set(HAVE_LIBLZ4 ON)
@@ -457,8 +439,15 @@ endif()
 
 # Thread libraries
 set(THREADS_PREFER_PTHREAD_FLAG ON) # We do prefer pthreads
-find_package(Threads REQUIRED)
+find_package(Threads)
 set(THREAD_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
+if("${THREAD_LIBRARIES}" STREQUAL "")
+       if(${ENABLE_GDK} STREQUAL "YES")
+               message(FATAL_ERROR "GDK requires a thread library")
+       elseif(${ENABLE_GDK} STREQUAL "AUTO")
+               set(ENABLE_GDK "NO")
+       endif()
+endif()
 
 # Readline libraries
 set(READLINE_LIBRARIES "")
@@ -537,7 +526,6 @@ endif()
 # OpenSSL or CommonCrypto library
 cmake_push_check_state()
 if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-       set(CRYPTO_LIBRARY_NAME "CommonCrypto")
        include(FindCommonCrypto)
 
        if(COMMONCRYPTO_FOUND)
@@ -555,7 +543,6 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin
        endif()
 endif()
 if(NOT COMMONCRYPTO_FOUND)
-       set(CRYPTO_LIBRARY_NAME "OpenSSL")
        find_package(OpenSSL)
 
        if(OPENSSL_FOUND)
@@ -590,19 +577,17 @@ if(NOT COMMONCRYPTO_FOUND AND NOT OPENSS
                message(FATAL_ERROR "Neither OpenSSL or CommonCrypto library 
found, but required for MonetDB5")
        else()
                set(ENABLE_MONETDB5 "NO")
-               set(WHY_NOT_MONETDB5 "Neither OpenSSL or CommonCrypto library 
found, but required for MonetDB5")
-               message(WARNING "${WHY_NOT_MONETDB5}")
+               message(WARNING "Neither OpenSSL or CommonCrypto library found, 
but required for MonetDB5")
        endif()
 endif()
 if(NOT HAVE_${PASSWORD_BACKEND}_UPDATE)
        if(${ENABLE_MONETDB5} STREQUAL "YES")
-               message(FATAL_ERROR "${CRYPTO_LIBRARY_NAME} library found, but 
checksum algorithm required for MonetDB5 not found")
+               message(FATAL_ERROR "A crypto library was found, but checksum 
algorithm required for MonetDB5 was not found")
        else()
                set(HAVE_COMMONCRYPTO NO)
                set(OPENSSL_FOUND NO)
                set(ENABLE_MONETDB5 "NO")
-               set(WHY_NOT_MONETDB5 "${CRYPTO_LIBRARY_NAME} library found, but 
required checksum algorithm not found, so disabling")
-               message(WARNING "${WHY_NOT_MONETDB5}")
+               message(WARNING "A crypto library was found, but required 
checksum algorithm was not found, so not disabling MonetDB5")
        endif()
 endif()
 
@@ -611,35 +596,34 @@ set(WITH_REGEX "PCRE" CACHE STRING "Use 
 if(NOT ${WITH_REGEX} MATCHES "^AUTO|PCRE|POSIX$")
        message(FATAL_ERROR "WITH_REGEX argument must be either AUTO, PCRE or 
POSIX")
 endif()
-
 if(NOT ${WITH_REGEX} STREQUAL "POSIX")
-       set(PCRE_REQUIRED_VERSION "4.5")
        include(FindPCRE)
 
        if(PCRE_FOUND)
-               cmake_push_check_state()
-               set(CMAKE_REQUIRED_INCLUDES 
"${CMAKE_REQUIRED_INCLUDES};${PCRE_INCLUDE_DIR}")
-               check_symbol_exists("PCRE_CONFIG_UTF8" "pcre.h" HAVE_LIBPCRE) 
#Test for UTF-8 support on PCRE library (PCRE_CONFIG_UTF8 is a macro)
-               cmake_pop_check_state()
-               if(NOT HAVE_LIBPCRE)
+               set(PCRE_REQUIRED_VERSION "4.5")
+               if(PCRE_VERSION VERSION_LESS ${PCRE_REQUIRED_VERSION})
                        if(${WITH_REGEX} STREQUAL "PCRE")
-                               message(FATAL_ERROR "PCRE library found but no 
UTF-8 support")
+                               message(FATAL_ERROR "PCRE library found, but 
the version is too old ${PCRE_VERSION} < ${PCRE_REQUIRED_VERSION}")
                        else()
-                               message(STATUS "PCRE library found but no UTF-8 
support")
+                               message(WARNING "PCRE library found, but the 
version is too old ${PCRE_VERSION} < ${PCRE_REQUIRED_VERSION}")
+                       endif()
+               else()
+                       cmake_push_check_state()
+                       set(CMAKE_REQUIRED_INCLUDES 
"${CMAKE_REQUIRED_INCLUDES};${PCRE_INCLUDE_DIR}")
+                       check_symbol_exists("PCRE_CONFIG_UTF8" "pcre.h" 
HAVE_LIBPCRE) #Test for UTF-8 support on PCRE library (PCRE_CONFIG_UTF8 is a 
macro)
+                       cmake_pop_check_state()
+                       if(NOT HAVE_LIBPCRE)
+                               if(${WITH_REGEX} STREQUAL "PCRE")
+                                       message(FATAL_ERROR "PCRE library found 
but no UTF-8 support")
+                               else()
+                                       message(STATUS "PCRE library found but 
no UTF-8 support")
+                               endif()
                        endif()
                endif()
+       elseif(${WITH_REGEX} STREQUAL "PCRE")
+               message(FATAL_ERROR "PCRE library not found or not usable")
        else()
-               if(PCRE_FOUND AND PCRE_VERSION VERSION_LESS_EQUAL 
${PCRE_REQUIRED_VERSION})
-                       set(PCRE_ERROR_MESSAGE "PCRE library found, but the 
version is too old ${PCRE_VERSION} < ${PCRE_REQUIRED_VERSION}")
-               else()
-                       set(PCRE_ERROR_MESSAGE "PCRE library not found or not 
usable")
-               endif()
-
-               if(${WITH_REGEX} STREQUAL "PCRE")
-                       message(FATAL_ERROR "${PCRE_ERROR_MESSAGE}")
-               else()
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to