Changeset: ae16f69822bf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ae16f69822bf
Modified Files:
        CMakeLists.txt
        cmake/monetdb_config.h.in
Branch: cmake-fun
Log Message:

More dependencies checks.


diffs (truncated from 608 to 300 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,7 +84,7 @@ set(ENABLE_TESTING "AUTO" CACHE STRING "
 # modules to use
 set(ENABLE_MAPI "YES" CACHE STRING "Enable MAPI (default=yes)")
 if(NOT ${ENABLE_MAPI} STREQUAL "NO")
-       defineCmacro(HAVE_MAPI "HAVE_MAPI 1")
+       defineCmacro("HAVE_MAPI" "HAVE_MAPI 1")
 endif()
 
 set(ENABLE_GDK "YES" CACHE STRING "Enable support for GDK (default=yes)")
@@ -640,7 +640,7 @@ set(PREV_CMAKE_REQUIRED_LINK_OPTIONS "${
 set(PREV_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
 set(PREV_CMAKE_EXTRA_INCLUDE_FILES "${CMAKE_EXTRA_INCLUDE_FILES}")
 
-set(WITH_BZ2 "AUTO" CACHE STRING "Include bz2 support (default=auto)")
+set(WITH_BZ2 "AUTO" CACHE STRING "Include bz2 support (default=auto)") # Check 
with HAVE_BZLIB
 if(NOT ${WITH_BZ2} STREQUAL "NO")
        pkg_search_module(BZIP2 NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH bzip2)
 
@@ -661,7 +661,7 @@ if(HAVE_BZLIB)
        defineCmacro("HAVE_LIBBZ2" "HAVE_LIBBZ2 1")
 endif()
 
-set(WITH_SNAPPY "AUTO" CACHE STRING "Include snappy support (default=auto)")
+set(WITH_SNAPPY "AUTO" CACHE STRING "Include snappy support (default=auto)") # 
Check with SNAPPY_FOUND
 if(NOT ${WITH_SNAPPY} STREQUAL "NO")
        pkg_search_module(SNAPPY NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH snappy)
 
@@ -675,7 +675,7 @@ if(NOT ${WITH_SNAPPY} STREQUAL "NO")
        endif()
 endif()
 
-set(WITH_LZ4 "AUTO" CACHE STRING "Include lz4 library support (default=auto)")
+set(WITH_LZ4 "AUTO" CACHE STRING "Include lz4 library support (default=auto)") 
# Check with LZ4_FOUND
 if(NOT ${WITH_LZ4} STREQUAL "NO")
        pkg_search_module(LZ4 NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH 
liblz4>=1.8.0)
 
@@ -715,17 +715,15 @@ else()
 endif()
 
 # Pthread libs
-set(HAS_PTHREAD_LIBS OFF)
-set(CUSTOM_PTHREAD_INCS "")
-set(CUSTOM_PTHREAD_LIBS "")
-
-set(WITH_PTHREAD "AUTO" CACHE STRING "Pthread library is installed in DIR")
+set(PTHREAD_INCS "")
+set(PTHREAD_LIBS "")
+set(WITH_PTHREAD "AUTO" CACHE STRING "Pthread library is installed in DIR") # 
Check with HAVE_PTHREAD_LIB (not needed on MacOSX)
 if(NOT ${WITH_PTHREAD} STREQUAL "NO")
        if(NOT ${WITH_PTHREAD} MATCHES "^AUTO|YES$")
-               set(CUSTOM_PTHREAD_INCS "${WITH_PTHREAD}/include")
-               set(CUSTOM_PTHREAD_LIBS "${WITH_PTHREAD}/lib")
-               set(CMAKE_REQUIRED_INCLUDES 
"${CMAKE_REQUIRED_INCLUDES};${CUSTOM_PTHREAD_INCS}") # Set back again in the 
end!
-               set(CMAKE_REQUIRED_LINK_OPTIONS 
"${CMAKE_REQUIRED_LINK_OPTIONS};${CUSTOM_PTHREAD_LIBS}") # Set back again in 
the end!
+               set(PTHREAD_INCS "${WITH_PTHREAD}/include")
+               set(PTHREAD_LIBS "${WITH_PTHREAD}/lib")
+               set(CMAKE_REQUIRED_INCLUDES 
"${CMAKE_REQUIRED_INCLUDES};${PTHREAD_INCS}") # Set back again in the end!
+               set(CMAKE_REQUIRED_LINK_OPTIONS 
"${CMAKE_REQUIRED_LINK_OPTIONS};${PTHREAD_LIBS}") # Set back again in the end!
        endif()
 
        check_include_file("pthread.h" HAVE_PTHREAD_H)
@@ -744,7 +742,7 @@ if(NOT ${WITH_PTHREAD} STREQUAL "NO")
        if(${WITH_PTHREAD} MATCHES "^AUTO|YES$")
                if("${CMAKE_C_COMPILER_ID}" MATCHES "^Clang|AppleClang|GNU$")
                        if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-                               set(HAS_PTHREAD_LIBS ON)
+                               set(HAVE_PTHREAD_LIB ON)
                        endif()
                elseif(${WITH_PTHREAD} STREQUAL "YES")
                        message(FATAL_ERROR "pthread library not supported by 
the platform")
@@ -773,33 +771,32 @@ else()
 endif()
 
 # Readline libs
+set(READLINE_INCS "")
 set(READLINE_LIBS "")
-set(CUSTOM_READLINE_INCS "")
-set(CUSTOM_READLINE_LIBS "")
-
-set(WITH_READLINE "AUTO" CACHE STRING "Readline library is installed in DIR")
+set(READLINE_LIBRARIES "")
+set(WITH_READLINE "AUTO" CACHE STRING "Readline library is installed in DIR") 
# Check with HAVE_READLINE_LIB
 if(NOT ${WITH_READLINE} STREQUAL "NO")
        if(NOT ${WITH_READLINE} MATCHES "^AUTO|YES$")
-               set(CUSTOM_READLINE_INCS "${WITH_READLINE}/include")
-               set(CUSTOM_READLINE_LIBS "${WITH_READLINE}/lib")
-               set(CMAKE_REQUIRED_INCLUDES 
"${CMAKE_REQUIRED_INCLUDES};${CUSTOM_READLINE_INCS}") # Set back again in the 
end!
-               set(CMAKE_REQUIRED_LINK_OPTIONS 
"${CMAKE_REQUIRED_LINK_OPTIONS};${CUSTOM_READLINE_LIBS}") # Set back again in 
the end!
+               set(READLINE_INCS "${WITH_READLINE}/include")
+               set(READLINE_LIBS "${WITH_READLINE}/lib")
+               set(CMAKE_REQUIRED_INCLUDES 
"${CMAKE_REQUIRED_INCLUDES};${READLINE_INCS}") # Set back again in the end!
+               set(CMAKE_REQUIRED_LINK_OPTIONS 
"${CMAKE_REQUIRED_LINK_OPTIONS};${READLINE_LIBS}") # Set back again in the end!
        endif()
 
        set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};readline")
        check_symbol_exists("readline" 
"stdio.h;readline/readline.h;readline/history.h" HAVE_READLINE_LIB)
        if(HAVE_READLINE_LIB)
-               set(READLINE_LIBS "${READLINE_LIBS} readline")
+               set(READLINE_LIBRARIES "${READLINE_LIBRARIES} readline")
        else()
                set(CMAKE_REQUIRED_LIBRARIES 
"${CMAKE_REQUIRED_LIBRARIES};termcap")
                check_symbol_exists("rl_history_search_forward" 
"stdio.h;readline/readline.h;readline/history.h" HAVE_READLINE_LIB)
                if(HAVE_READLINE_LIB)
-                       set(READLINE_LIBS "${READLINE_LIBS} readline termcap")
+                       set(READLINE_LIBRARIES "${READLINE_LIBRARIES} termcap")
                else()
                        set(CMAKE_REQUIRED_LIBRARIES 
"${PREV_CMAKE_REQUIRED_LIBRARIES};readline;ncurses")
                        check_symbol_exists("rl_reverse_search_history" 
"stdio.h;readline/readline.h;readline/history.h" HAVE_READLINE_LIB)
                        if(HAVE_READLINE_LIB)
-                               set(READLINE_LIBS "${READLINE_LIBS} readline 
ncurses")
+                               set(READLINE_LIBRARIES "${READLINE_LIBRARIES} 
ncurses")
                        elseif(${WITH_READLINE} STREQUAL "YES")
                                message(FATAL_ERROR "Readline library not 
found")
                        else()
@@ -857,7 +854,7 @@ if(Iconv_FOUND)
 endif()
 
 # UUID
-set(WITH_UUID "YES" CACHE STRING "Include UUID support (default=yes)")
+set(WITH_UUID "YES" CACHE STRING "Include UUID support (default=yes)") # Check 
with HAVE_UUID_LIB
 if(NOT ${WITH_UUID} STREQUAL "NO")
        set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};uuid")
        check_symbol_exists("uuid_generate" "uuid/uuid.h" HAVE_UUID_LIB)
@@ -873,36 +870,36 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin
        defineCmacro("HAVE_COMMONCRYPTO" "HAVE_COMMONCRYPTO 1")
        set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};crypto") # 
TODO test this
 
-       check_symbol_exists("CC_MD5_Update" "CommonCrypto/CommonDigest.h" 
HAVE_CC_MD5_Update_FUNC)
-       if(HAVE_CC_MD5_Update_FUNC)
+       check_symbol_exists("CC_MD5_Update" "CommonCrypto/CommonDigest.h" 
HAVE_MD5_UPDATE_FUNC)
+       if(HAVE_MD5_UPDATE_FUNC)
                defineCmacro("HAVE_MD5_UPDATE" "HAVE_MD5_UPDATE 1")
        endif()
-       check_symbol_exists("CC_RIPEMD160_Update" "CommonCrypto/CommonDigest.h" 
HAVE_CC_RIPEMD160_Update_FUNC)
-       if(HAVE_CC_RIPEMD160_Update_FUNC)
+       check_symbol_exists("CC_RIPEMD160_Update" "CommonCrypto/CommonDigest.h" 
HAVE_RIPEMD160_UPDATE_FUNC)
+       if(HAVE_RIPEMD160_UPDATE_FUNC)
                defineCmacro("HAVE_RIPEMD160_UPDATE" "HAVE_RIPEMD160_UPDATE 1")
        endif()
-       check_symbol_exists("CC_SHA1_Update" "CommonCrypto/CommonDigest.h" 
HAVE_CC_SHA1_Update_FUNC)
-       if(HAVE_CC_SHA1_Update_FUNC)
+       check_symbol_exists("CC_SHA1_Update" "CommonCrypto/CommonDigest.h" 
HAVE_SHA1_UPDATE_FUNC)
+       if(HAVE_SHA1_UPDATE_FUNC)
                defineCmacro("HAVE_SHA1_UPDATE" "HAVE_SHA1_UPDATE 1")
        endif()
-       check_symbol_exists("CC_SHA224_Update" "CommonCrypto/CommonDigest.h" 
HAVE_CC_SHA224_Update_FUNC)
-       if(HAVE_CC_SHA224_Update_FUNC)
+       check_symbol_exists("CC_SHA224_Update" "CommonCrypto/CommonDigest.h" 
HAVE_SHA224_UPDATE_FUNC)
+       if(HAVE_SHA224_UPDATE_FUNC)
                defineCmacro("HAVE_SHA224_UPDATE" "HAVE_SHA224_UPDATE 1")
        endif()
-       check_symbol_exists("CC_SHA256_Update" "CommonCrypto/CommonDigest.h" 
HAVE_CC_SHA256_Update_FUNC)
-       if(HAVE_CC_SHA256_Update_FUNC)
+       check_symbol_exists("CC_SHA256_Update" "CommonCrypto/CommonDigest.h" 
HAVE_SHA256_UPDATE_FUNC)
+       if(HAVE_SHA256_UPDATE_FUNC)
                defineCmacro("HAVE_SHA256_UPDATE" "HAVE_SHA256_UPDATE 1")
        endif()
-       check_symbol_exists("CC_SHA384_Update" "CommonCrypto/CommonDigest.h" 
HAVE_CC_SHA384_Update_FUNC)
-       if(HAVE_CC_SHA384_Update_FUNC)
+       check_symbol_exists("CC_SHA384_Update" "CommonCrypto/CommonDigest.h" 
HAVE_SHA384_UPDATE_FUNC)
+       if(HAVE_SHA384_UPDATE_FUNC)
                defineCmacro("HAVE_SHA384_UPDATE" "HAVE_SHA384_UPDATE 1")
        endif()
-       check_symbol_exists("CC_SHA512_Update" "CommonCrypto/CommonDigest.h" 
HAVE_CC_SHA512_Update_FUNC)
-       if(HAVE_CC_SHA512_Update_FUNC)
-               defineCmacro("CC_SHA512_Update" "CC_SHA512_Update 1")
+       check_symbol_exists("HAVE_SHA512_Update" "CommonCrypto/CommonDigest.h" 
HAVE_SHA512_UPDATE_FUNC)
+       if(HAVE_SHA512_UPDATE_FUNC)
+               defineCmacro("HAVE_SHA512_UPDATE" "HAVE_SHA512_UPDATE 1")
        endif()
 else()
-       set(WITH_OPENSSL "YES" CACHE STRING "Include OpenSSL support 
(default=yes)")
+       set(WITH_OPENSSL "YES" CACHE STRING "Include OpenSSL support 
(default=yes)") # Check with OPENSSL_FOUND
        if(NOT ${WITH_OPENSSL} STREQUAL "NO")
                pkg_search_module(OPENSSL NO_CMAKE_PATH 
NO_CMAKE_ENVIRONMENT_PATH openssl)
 
@@ -910,36 +907,36 @@ else()
                        message(STATUS "openssl library found")
                        set(CMAKE_REQUIRED_LIBRARIES 
"${CMAKE_REQUIRED_LIBRARIES};ssl;crypto")
 
-                       check_symbol_exists("MD5_Update" "openssl/md5.h" 
HAVE_MD5_Update_FUNC)
-                       if(HAVE_MD5_Update_FUNC)
+                       check_symbol_exists("MD5_Update" "openssl/md5.h" 
HAVE_MD5_UPDATE_FUNC)
+                       if(HAVE_MD5_UPDATE_FUNC)
                                defineCmacro("HAVE_MD5_UPDATE" "HAVE_MD5_UPDATE 
1")
                        endif()
-                       check_symbol_exists("RIPEMD160_Update" 
"openssl/ripemd.h" HAVE_RIPEMD160_Update_FUNC)
-                       if(HAVE_RIPEMD160_Update_FUNC)
+                       check_symbol_exists("RIPEMD160_Update" 
"openssl/ripemd.h" HAVE_RIPEMD160_UPDATE_FUNC)
+                       if(HAVE_RIPEMD160_UPDATE_FUNC)
                                defineCmacro("HAVE_RIPEMD160_UPDATE" 
"HAVE_RIPEMD160_UPDATE 1")
                        endif()
-                       check_symbol_exists("SHA1_Update" "openssl/sha.h" 
HAVE_SHA1_Update_FUNC)
-                       if(HAVE_SHA1_Update_FUNC)
+                       check_symbol_exists("SHA1_Update" "openssl/sha.h" 
HAVE_SHA1_UPDATE_FUNC)
+                       if(HAVE_SHA1_UPDATE_FUNC)
                                defineCmacro("HAVE_SHA1_UPDATE" 
"HAVE_SHA1_UPDATE 1")
                        endif()
-                       check_symbol_exists("SHA224_Update" "openssl/sha.h" 
HAVE_SHA224_Update_FUNC)
-                       if(HAVE_SHA224_Update_FUNC)
+                       check_symbol_exists("SHA224_Update" "openssl/sha.h" 
HAVE_SHA224_UPDATE_FUNC)
+                       if(HAVE_SHA224_UPDATE_FUNC)
                                defineCmacro("HAVE_SHA224_UPDATE" 
"HAVE_SHA224_UPDATE 1")
                        endif()
-                       check_symbol_exists("SHA256_Update" "openssl/sha.h" 
HAVE_SHA256_Update_FUNC)
-                       if(HAVE_SHA256_Update_FUNC)
+                       check_symbol_exists("SHA256_Update" "openssl/sha.h" 
HAVE_SHA256_UPDATE_FUNC)
+                       if(HAVE_SHA256_UPDATE_FUNC)
                                defineCmacro("HAVE_SHA256_UPDATE" 
"HAVE_SHA256_UPDATE 1")
                        endif()
-                       check_symbol_exists("SHA384_Update" "openssl/sha.h" 
HAVE_SHA384_Update_FUNC)
-                       if(HAVE_SHA384_Update_FUNC)
+                       check_symbol_exists("SHA384_Update" "openssl/sha.h" 
HAVE_SHA384_UPDATE_FUNC)
+                       if(HAVE_SHA384_UPDATE_FUNC)
                                defineCmacro("HAVE_SHA384_UPDATE" 
"HAVE_SHA384_UPDATE 1")
                        endif()
-                       check_symbol_exists("SHA512_Update" "openssl/sha.h" 
HAVE_SHA512_Update_FUNC)
-                       if(HAVE_SHA512_Update_FUNC)
-                               defineCmacro("SHA512_Update" "SHA512_Update 1")
+                       check_symbol_exists("SHA512_Update" "openssl/sha.h" 
HAVE_SHA512_UPDATE_FUNC)
+                       if(HAVE_SHA512_UPDATE_FUNC)
+                               defineCmacro("HAVE_SHA512_UPDATE" 
"HAVE_SHA512_UPDATE 1")
                        endif()
 
-                       if(NOT HAVE_${PASSWORD_BACKEND}_Update_FUNC)
+                       if(NOT HAVE_${PASSWORD_BACKEND}_UPDATE_FUNC)
                                if(${ENABLE_MONETDB5} STREQUAL "YES")
                                        message(FATAL_ERROR "OpenSSL library 
found but checksum algorithm required for MonetDB5 not found")
                                else()
@@ -962,7 +959,7 @@ endif()
 set(CMAKE_REQUIRED_LIBRARIES "${PREV_CMAKE_REQUIRED_LIBRARIES}")
 
 # Regex library
-set(WITH_REGEX "PCRE" CACHE STRING "Use either PCRE or POSIX regular 
expressions (default=PCRE if available)")
+set(WITH_REGEX "PCRE" CACHE STRING "Use either PCRE or POSIX regular 
expressions (default=PCRE if available)") # Check with HAVE_LIBPCRE and 
HAVE_POSIX_REGEX
 if(NOT ${WITH_REGEX} MATCHES "^AUTO|PCRE|POSIX$")
        message(FATAL_ERROR "WITH_REGEX argument must be either AUTO, PCRE or 
POSIX")
 endif()
@@ -987,9 +984,9 @@ if(NOT ${WITH_REGEX} STREQUAL "POSIX")
                                exit(!rc);
                                return 0;
                        }
-               " PCRE_HAS_UTF8)
+               " HAVE_LIBPCRE)
                set(CMAKE_REQUIRED_LIBRARIES "${PREV_CMAKE_REQUIRED_LIBRARIES}")
-               if(PCRE_HAS_UTF8)
+               if(HAVE_LIBPCRE)
                        defineCmacro("HAVE_LIBPCRE" "HAVE_LIBPCRE 1")
                elseif(${WITH_REGEX} STREQUAL "PCRE")
                        message(FATAL_ERROR "PCRE library found but no UTF-8 
support")
@@ -1011,7 +1008,7 @@ if(NOT ${WITH_REGEX} STREQUAL "POSIX")
        endif()
 endif()
 
-if(NOT PCRE_HAS_UTF8)
+if(NOT HAVE_LIBPCRE)
        message(STATUS "Checking for GNU regex library")
        check_c_source_runs("
                #include <regex.h>
@@ -1022,10 +1019,10 @@ if(NOT PCRE_HAS_UTF8)
                        (void) argv;
                        return regcomp(&re, \"hello\", REG_EXTENDED|REG_NOSUB) 
? 1 : 0;
                }
-       " HAS_POSIX_REGEX)
+       " HAVE_POSIX_REGEX)
 endif()
 
-if(NOT PCRE_HAS_UTF8 AND NOT HAS_POSIX_REGEX)
+if(NOT HAVE_LIBPCRE AND NOT HAVE_POSIX_REGEX)
        if(${ENABLE_MONETDB5} STREQUAL "YES")
                message(FATAL_ERROR "PCRE library or GNU regex library not 
found but required for MonetDB5")
        else()
@@ -1034,7 +1031,7 @@ if(NOT PCRE_HAS_UTF8 AND NOT HAS_POSIX_R
        endif()
 endif()
 
-set(WITH_LIBXML2 "AUTO" CACHE STRING "Include libxml2 support (default=auto)")
+set(WITH_LIBXML2 "AUTO" CACHE STRING "Include libxml2 support (default=auto)") 
# Check with LIBXML2_FOUND
 if(NOT ${WITH_LIBXML2} STREQUAL "NO")
        pkg_search_module(LIBXML2 NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH 
libxml-2.0)
 
@@ -1048,7 +1045,7 @@ if(NOT ${WITH_LIBXML2} STREQUAL "NO")
        endif()
 endif()
 
-set(WITH_CURL "AUTO" CACHE STRING "Include cURL support (default=auto)")
+set(WITH_CURL "AUTO" CACHE STRING "Include cURL support (default=auto)") # 
Check with CURL_FOUND
 if(NOT ${WITH_CURL} STREQUAL "NO")
        pkg_search_module(CURL NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH libcurl)
 
@@ -1062,7 +1059,7 @@ if(NOT ${WITH_CURL} STREQUAL "NO")
        endif()
 endif()
 
-set(WITH_ZLIB "AUTO" CACHE STRING "Include zlib support (default=auto)")
+set(WITH_ZLIB "AUTO" CACHE STRING "Include zlib support (default=auto)") # 
Check with ZLIB_FOUND
 if(NOT ${WITH_ZLIB} STREQUAL "NO")
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to