Changeset: 6c9a57ccaa96 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6c9a57ccaa96
Modified Files:
CMakeLists.txt
sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
Branch: cmake-fun
Log Message:
Runs on cmake 3.5, also distinguish between python interpreter (required for
Mtest) and python development library (required for Python UDFs).
diffs (82 lines):
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@
# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
#]]
-cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
# Change these variables between releases
set(MONETDB_VERSION_MAJOR "11")
@@ -25,7 +25,8 @@ set(STREAM_VERSION_MAJOR "13")
set(STREAM_VERSION "${STREAM_VERSION_MAJOR}.1.0")
# HOMEPAGE_URL "https://www.monetdb.org/" in project command supported from
cmake 3.12 up
-project(MonetDB VERSION "${MONETDB_VERSION}" DESCRIPTION "MonetDB, SQL queries
at light speed" LANGUAGES C)
+# DESCRIPTION "MonetDB, SQL queries at light speed" in project command
supported from cmake 3.9 up
+project(MonetDB VERSION "${MONETDB_VERSION}" LANGUAGES C)
set(C_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 99)
@@ -249,23 +250,26 @@ set(PATH_SEP "'${OS_PATHSEP}'")
set(SO_EXT "${CMAKE_SHARED_LIBRARY_SUFFIX}")
# We need python3 for the testweb, python udfs and c udfs compilation
-if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
+if(CMAKE_VERSION VERSION_GREATER 3.11)
find_package(Python3 COMPONENTS Interpreter Development)
else()
set(Python_ADDITIONAL_VERSIONS 3)
find_package(PythonInterp 3)
find_package(PythonLibs 3)
- if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND)
- set(Python3_FOUND ON)
+ if(PYTHONINTERP_FOUND)
+ set(Python3_Interpreter_FOUND ON)
set(Python3_VERSION_MAJOR "${PYTHON_VERSION_MAJOR}")
set(Python3_VERSION_MINOR "${PYTHON_VERSION_MINOR}")
set(Python3_VERSION_PATCH "${PYTHON_VERSION_PATCH}")
set(Python3_EXECUTABLE "${PYTHON_EXECUTABLE}")
+ endif()
+ if(PYTHONLIBS_FOUND)
+ set(Python3_Development_FOUND ON)
set(Python3_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS}")
set(Python3_LIBRARIES "${PYTHON_LIBRARIES}")
endif()
endif()
-if(Python3_FOUND)
+if(Python3_Interpreter_FOUND)
set(PYTHON3_REQUIRED_VERSION "3.5")
if("${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}" VERSION_LESS
${PYTHON3_REQUIRED_VERSION})
message(WARNING "The Python 3 executable is too old
${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} <
${PYTHON3_REQUIRED_VERSION}")
diff --git a/sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
b/sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
--- a/sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
+++ b/sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
@@ -6,12 +6,7 @@
# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
#]]
-set(PY3_INCLUDE_DIR "")
-set(PY3_LIBRARIES "")
-if(HAVE_PYTHON3)
- set(PY3_INCLUDE_DIR "${Python3_INCLUDE_DIRS}")
- set(PY3_LIBRARIES "${Python3_LIBRARIES}")
-
+if(HAVE_PYTHON3 AND Python3_Development_FOUND)
message(STATUS "Checking for numpy version")
exec_program("${Python3_EXECUTABLE}" ARGS "-c \"import numpy;
print(int(numpy.__version__.split('.').__getitem__(1)) >= 7)\"" OUTPUT_VARIABLE
NUMPY_OUTPUT RETURN_VALUE NUMPY_RETURN_CODE)
exec_program("${Python3_EXECUTABLE}" ARGS "-c \"import numpy;
print(numpy.get_include())\"" OUTPUT_VARIABLE NUMPY_CPP_FLAGS RETURN_VALUE
NUMPY_CPP_RC)
@@ -33,9 +28,9 @@ if(HAVE_LIBPY3)
../../../../../monetdb5/modules/atoms ../../../../../monetdb5/modules/mal
../../../../../gdk
../../../../../monetdb5/mal
../../../../../sql/backends/monet5 ../../../../../sql/common
../../../../../sql/include
../../../../../sql/server ../../../../../sql/storage ../pyapi
- ${PY3_INCLUDE_DIR}
${NUMPY3_INCLUDE_DIR})
+ ${Python3_INCLUDE_DIRS}
${NUMPY3_INCLUDE_DIR})
- set(PYAPI3_LINK_LIBRARIES ${PY3_LIBRARIES})
+ set(PYAPI3_LINK_LIBRARIES ${Python3_LIBRARIES})
if(WIN32)
list(APPEND PYAPI3_LINK_LIBRARIES monetdb5 gdk)
endif()
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list