Changeset: 80bfeed892c9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=80bfeed892c9
Modified Files:
        CMakeLists.txt
        clients/odbc/CMakeLists.txt
        cmake/FindGeos.cmake
Branch: cmake-fun
Log Message:

Minor fixes.

- ODBC libraries on Windows should be provided by the SDK, so no need to search 
for them. (We need the Windows SDK to compile everything)
- Search for python34 library up in older versions of cmake.
- Geos library might be called "geos_c_i".


diffs (97 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -280,9 +280,9 @@ set(SO_EXT       "${CMAKE_SHARED_LIBRARY
 
 # We need python3 for the testweb, python udfs and c udfs compilation
 if(CMAKE_VERSION VERSION_LESS 3.12)
-       set(Python_ADDITIONAL_VERSIONS 3)
-       find_package(PythonInterp 3)
-       find_package(PythonLibs 3)
+       set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5)
+       find_package(PythonInterp 3.4)
+       find_package(PythonLibs 3.4)
        if(PYTHONINTERP_FOUND)
                set(Python3_Interpreter_FOUND ON)
                set(Python3_VERSION_MAJOR "${PYTHON_VERSION_MAJOR}")
@@ -468,8 +468,8 @@ endif()
 if(${CMAKE_SYSTEM_NAME} MATCHES "^Linux|FreeBSD|NetBSD$")
        set(MATH_LIBRARIES "m")
 endif()
-if(WIN32)
-       set(PSAPI_LIBRARIES "psapi") # We need the psapi library for 
GetProcessMemoryInfo function, which is no longer required from Windows 7 and 
Windows Server 2008 R2 up
+if(WIN32) # Both these libraries and respective include files (psapi.h and 
winsock2.h) come with the Windows SDK <version>, which should be installed with 
Visual Studio and set on the path by MSVC
+       set(PSAPI_LIBRARIES "psapi") # We need the psapi library for 
GetProcessMemoryInfo function, which is no longer required from Windows 7 and 
Windows Server 2008 R2 up (the latter is suported until January 2020)
        set(SOCKET_LIBRARIES "ws2_32")
 endif()
 include(FindExtraLibraries)
diff --git a/clients/odbc/CMakeLists.txt b/clients/odbc/CMakeLists.txt
--- a/clients/odbc/CMakeLists.txt
+++ b/clients/odbc/CMakeLists.txt
@@ -7,8 +7,12 @@
 #]]
 
 if(NOT ${ENABLE_ODBC} STREQUAL "NO")
-       find_path(ODBCINST_INCLUDE odbcinst.h)
-       if(ODBCINST_INCLUDE)
+       if(WIN32)
+               set(ODBCINST_INCLUDE "") # odbcinst.h included by the Windows 
SDK
+       else()
+               find_path(ODBCINST_INCLUDE odbcinst.h)
+       endif()
+       if(ODBCINST_INCLUDE OR WIN32)
                set(ODBC_INCLUDE_DIR "${ODBCINST_INCLUDE}")
                cmake_push_check_state()
                set(CMAKE_REQUIRED_INCLUDES 
"${CMAKE_REQUIRED_INCLUDES};${ODBC_INCLUDE_DIR}")
@@ -27,31 +31,10 @@ if(NOT ${ENABLE_ODBC} STREQUAL "NO")
 
                check_type_size(SQLWCHAR SIZEOF_SQLWCHAR LANGUAGE C)
                cmake_pop_check_state()
-               if(WIN32) # Windows uses different libraries for the ODBC driver
-                       find_library(ODBCCP32_LIBRARY odbccp32)
-                       if(ODBCCP32_LIBRARY)
-                               set(ODBCINST_LIBRARIES 
"${ODBCINST_LIBRARIES};${ODBCCP32_LIBRARY}")
-                       endif()
-                       find_library(USER32_LIBRARY NAMES user32 User32)
-                       if(USER32_LIBRARY)
-                               set(ODBCINST_LIBRARIES 
"${ODBCINST_LIBRARIES};${USER32_LIBRARY}")
-                       endif()
-                       find_library(LEGACY_STDIO_LIBRARY 
legacy_stdio_definitions)
-                       if(LEGACY_STDIO_LIBRARY)
-                               set(ODBCINST_LIBRARIES 
"${ODBCINST_LIBRARIES};${LEGACY_STDIO_LIBRARY}")
-                       endif()
-                       find_library(ODBC32_LIBRARY odbc32)
-                       if(ODBC32_LIBRARY)
-                               set(ODBC_LIBRARIES "${ODBC32_LIBRARY}")
-                       endif()
-
-                       if(ODBCCP32_LIBRARY AND USER32_LIBRARY AND 
LEGACY_STDIO_LIBRARY AND ODBC32_LIBRARY)
-                               set(HAVE_ODBC ON CACHE INTERNAL "odbc extension 
is available")
-                       elseif(${ENABLE_ODBC} STREQUAL "YES")
-                               message(FATAL_ERROR "ODBC libraries missing")
-                       else()
-                               message(STATUS "ODBC libraries missing")
-                       endif()
+               if(WIN32) # Windows uses different libraries for the ODBC 
driver, and they are included in the Windows SDK
+                       set(ODBCINST_LIBRARIES 
"odbccp32;user32;legacy_stdio_definitions")
+                       set(ODBC_LIBRARIES "odbc32")
+                       set(HAVE_ODBC ON CACHE INTERNAL "odbc extension is 
available")
                else()
                        find_library(ODBCINST_LIBRARY odbcinst)
                        if(ODBCINST_LIBRARY)
diff --git a/cmake/FindGeos.cmake b/cmake/FindGeos.cmake
--- a/cmake/FindGeos.cmake
+++ b/cmake/FindGeos.cmake
@@ -7,10 +7,10 @@
 # GEOS_FOUND   - True if geos found.
 
 # Look for the header file.
-find_path(GEOS_INCLUDE_DIR NAMES geos_c.h)
+find_path(GEOS_INCLUDE_DIR NAMES geos_c.h geos_c_i.h)
 
 # Look for the library.
-find_library(GEOS_LIBRARIES NAMES geos_c)
+find_library(GEOS_LIBRARIES NAMES geos_c geos_c_i)
 
 # Handle the QUIETLY and REQUIRED arguments and set GEOS_FOUND to TRUE if all 
listed variables are TRUE.
 include(FindPackageHandleStandardArgs)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to