Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Python bindings for old cmake versions #1301

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,17 @@ if(NOT IOS)
include(cmake/VISPDetectPython.cmake)
endif()

if(CMAKE_VERSION VERSION_LESS "3.19.0")
set(CMAKE_NOT_OK_FOR_BINDINGS TRUE)
else()
set(CMAKE_NOT_OK_FOR_BINDINGS FALSE)
endif()

if(CMAKE_NOT_OK_FOR_BINDINGS)
status("${CMAKE_NOT_OK_FOR_BINDINGS}")
status("CMake version required for Python bindings is 3.19.0, but you have ${CMAKE_VERSION}. Python bindings generation will be deactivated")
endif()

# --- Python Bindings requirements ---

# this avoids non-active conda from getting picked anyway on Windows
Expand Down Expand Up @@ -436,7 +447,7 @@ VP_OPTION(BUILD_ANDROID_EXAMPLES "" "" "Build examples for Android platform"
VP_OPTION(INSTALL_ANDROID_EXAMPLES "" "" "Install Android examples" "" OFF IF ANDROID )

# Build python bindings as an option
VP_OPTION(BUILD_PYTHON_BINDINGS "" "" "Build Python bindings" "" ON IF (PYTHON3INTERP_FOUND AND USE_PYBIND11) )
VP_OPTION(BUILD_PYTHON_BINDINGS "" "" "Build Python bindings" "" ON IF (PYTHON3INTERP_FOUND AND USE_PYBIND11 AND NOT CMAKE_NOT_OK_FOR_BINDINGS) )
VP_OPTION(BUILD_PYTHON_BINDINGS_DOC "" "" "Build the documentation for the Python bindings" "" ON IF BUILD_PYTHON_BINDINGS )


Expand Down
Loading