diff --git a/CMakeLists.txt b/CMakeLists.txt index 7864887b4..1214b38bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -289,6 +289,8 @@ if (UBSAN) # Make sure llvm-symbolizer binary is in path endif() +set(MG_PYTHON_VERSION "" CACHE STRING "Specify the exact python version used by the query modules") + # Add subprojects include_directories(src) add_subdirectory(src) diff --git a/src/query/CMakeLists.txt b/src/query/CMakeLists.txt index 6cf555b74..214cfd566 100644 --- a/src/query/CMakeLists.txt +++ b/src/query/CMakeLists.txt @@ -35,7 +35,11 @@ add_dependencies(mg-query generate_lcp_query) target_include_directories(mg-query PUBLIC ${CMAKE_SOURCE_DIR}/include) target_link_libraries(mg-query dl cppitertools) target_link_libraries(mg-query mg-storage-v2) -find_package(Python3 3.5 REQUIRED COMPONENTS Development) +if("${MG_PYTHON_VERSION}" STREQUAL "") + find_package(Python3 3.5 REQUIRED COMPONENTS Development) +else() + find_package(Python3 "${MG_PYTHON_VERSION}" EXACT REQUIRED COMPONENTS Development) +endif() target_link_libraries(mg-query Python3::Python) # Generate Antlr openCypher parser