Add ability to specify the exact Python version (#57)

This commit is contained in:
Marko Budiselić 2020-12-21 13:21:51 +01:00 committed by GitHub
parent 53fa1482cb
commit b42ee31c1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -289,6 +289,8 @@ if (UBSAN)
# Make sure llvm-symbolizer binary is in path # Make sure llvm-symbolizer binary is in path
endif() endif()
set(MG_PYTHON_VERSION "" CACHE STRING "Specify the exact python version used by the query modules")
# Add subprojects # Add subprojects
include_directories(src) include_directories(src)
add_subdirectory(src) add_subdirectory(src)

View File

@ -35,7 +35,11 @@ add_dependencies(mg-query generate_lcp_query)
target_include_directories(mg-query PUBLIC ${CMAKE_SOURCE_DIR}/include) target_include_directories(mg-query PUBLIC ${CMAKE_SOURCE_DIR}/include)
target_link_libraries(mg-query dl cppitertools) target_link_libraries(mg-query dl cppitertools)
target_link_libraries(mg-query mg-storage-v2) 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) target_link_libraries(mg-query Python3::Python)
# Generate Antlr openCypher parser # Generate Antlr openCypher parser