Skip to content

Commit

Permalink
cmake: introduce ENABLE_PYTHON2 option
Browse files Browse the repository at this point in the history
so that we can disable python2 with -DENABLE_PYTHON2=no so that it is
not detected even if available.
  • Loading branch information
pstorz committed Jun 22, 2022
1 parent c494e32 commit b13caee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/cmake/BareosFindAllLibraries.cmake
Expand Up @@ -23,6 +23,8 @@ if(${SYSTEMD_FOUND})
endif()

option(ENABLE_PYTHON "Enable Python support" ON)
option(ENABLE_PYTHON2 "Enable Python2 support" ON)

if(NOT ENABLE_PYTHON)
set(HAVE_PYTHON 0)
set(Python2_FOUND 0)
Expand All @@ -42,7 +44,9 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set(Python3_FOUND 0)

else()
find_package(Python2 COMPONENTS Interpreter Development)
if(ENABLE_PYTHON2)
find_package(Python2 COMPONENTS Interpreter Development)
endif()
find_package(Python3 COMPONENTS Interpreter Development)

set(Python3_VERSION_MAJOR
Expand Down

0 comments on commit b13caee

Please sign in to comment.