Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
Allow using specific python version dev lib for building by specify PY_VERSION cmake flag.

Signed-off-by: ArchieMeng <[email protected]>
  • Loading branch information
ArchieMeng committed Mar 16, 2022
1 parent a144379 commit a24e582
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions realsr_ncnn_vulkan_python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
project(realsr-ncnn-vulkan-python)

# Python
if(${CMAKE_VERSION} VERSION_LESS "3.15")
find_package(Python REQUIRED)
if (DEFINED PY_VERSION)
if (${CMAKE_VERSION} VERSION_LESS "3.15")
find_package(Python ${PY_VERSION} EXACT REQUIRED)
else()
find_package(Python ${PY_VERSION} EXACT REQUIRED COMPONENTS Development)
endif()
else()
find_package(Python REQUIRED COMPONENTS Development)
if (${CMAKE_VERSION} VERSION_LESS "3.15")
find_package(Python REQUIRED)
else()
find_package(Python REQUIRED COMPONENTS Development)
endif()
endif()

# SWIG
Expand Down

0 comments on commit a24e582

Please sign in to comment.