Skip to content

Commit

Permalink
feat: upgrade python to 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Sadikum committed Sep 10, 2021
1 parent 25a2cd4 commit 74ce4fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if(VERA_PYTHON)
# be used as suffixes, but note that they are not portable.
#
# from https://cmake.org/cmake/help/latest/module/FindBoost.html
list(APPEND boostLibs python38)
list(APPEND boostLibs python39)
endif()

if(VERA_USE_SYSTEM_BOOST)
Expand Down Expand Up @@ -49,7 +49,7 @@ else()
set(Boost_URL "https://${BOOST_MIRROR}/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2")
set(Boost_URL_HASH "SHA256=fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854")

string(REPLACE "python38" "python" boostLibs "${boostLibs}")
string(REPLACE "python39" "python" boostLibs "${boostLibs}")
string(REPLACE ";" "," boostLibsComma "${boostLibs}")
string(REPLACE ";" " --with-" WITH_LIBS "${boostLibs}")
set(WITH_LIBS "--with-${WITH_LIBS}")
Expand Down Expand Up @@ -91,7 +91,7 @@ else()
# Starting with Boost 1.67, Boost Python's libary includes a version suffix.
if(NOT (Boost_VERSION VERSION_LESS 1.67))
if (${l} STREQUAL "python")
set(l "python38")
set(l "python39")
endif()
endif()
if(WIN32)
Expand Down
24 changes: 12 additions & 12 deletions src/python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ mark_as_advanced(VERA_USE_SYSTEM_PYTHON)

if(VERA_USE_SYSTEM_PYTHON)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
find_package(PythonInterp 3.8)
find_package(PythonLibs 3.8)
find_package(PythonInterp 3)
find_package(PythonLibs 3)
if(WIN32 AND NOT PYTHONLIBS_FOUND)
message(FATAL_ERROR "Could NOT find Python. Turn VERA_USE_SYSTEM_PYTHON to OFF to build it with vera++.")
endif()
Expand Down Expand Up @@ -130,32 +130,32 @@ else()
# copy the runtime near vera++ executable so we can run the tests
ExternalProject_Add_Step(python install_dll
COMMAND ${CMAKE_COMMAND} -E copy
${INSTALL_DIR}/bin/python38.dll
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/python38.dll
${INSTALL_DIR}/bin/python39.dll
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/python39.dll
DEPENDEES install)
ExternalProject_Add_Step(python install_libs
COMMAND ${CMAKE_COMMAND} -E copy_directory
${INSTALL_DIR}/lib
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/lib
DEPENDEES install)
set(PYTHON_EXECUTABLE ${INSTALL_DIR}/bin/python.exe)
set(PYTHON_LIBRARIES debug ${BINARY_DIR}/libs/Debug/python38.lib
optimized ${BINARY_DIR}/libs/Release/python38.lib)
set(PYTHON_LIBRARIES debug ${BINARY_DIR}/libs/Debug/python39.lib
optimized ${BINARY_DIR}/libs/Release/python39.lib)
set(PYTHON_INCLUDE_DIR ${INSTALL_DIR}/include)
list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS "${INSTALL_DIR}/bin/python38.dll")
list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS "${INSTALL_DIR}/bin/python39.dll")
install(DIRECTORY ${INSTALL_DIR}/lib DESTINATION bin)
elseif(APPLE)
message(WARNING "Python won't be installed. Setting VERA_USE_SYSTEM_PYTHON to OFF should only be used for testing purpose on this system.")
set(PYTHON_EXECUTABLE ${INSTALL_DIR}/bin/python)
set(PYTHON_LIBRARIES ${INSTALL_DIR}/lib/libpython3.8.dylib)
set(PYTHON_INCLUDE_DIR ${INSTALL_DIR}/include/python3.8)
set(PYTHON_LIBRARIES ${INSTALL_DIR}/lib/libpython3.9.dylib)
set(PYTHON_INCLUDE_DIR ${INSTALL_DIR}/include/python3.9)
else()
message(WARNING "Python won't be installed. Setting VERA_USE_SYSTEM_PYTHON to OFF should only be used for testing purpose on this system.")
set(PYTHON_EXECUTABLE ${INSTALL_DIR}/bin/python)
set(PYTHON_LIBRARIES ${INSTALL_DIR}/lib/libpython3.8.so)
set(PYTHON_INCLUDE_DIR ${INSTALL_DIR}/include/python3.8)
set(PYTHON_LIBRARIES ${INSTALL_DIR}/lib/libpython3.9.so)
set(PYTHON_INCLUDE_DIR ${INSTALL_DIR}/include/python3.9)
endif()
set(PYTHON_VERSION 3.8.10)
set(PYTHON_VERSION 3.9.7)
include_directories(SYSTEM ${PYTHON_INCLUDE_DIR})
link_directories(${BINARY_DIR})
set(Python_TARGET python)
Expand Down

0 comments on commit 74ce4fe

Please sign in to comment.