Skip to content

Commit

Permalink
cmake: as we require cmake >= 3.12 now we remove the workarounds for …
Browse files Browse the repository at this point in the history
…older versions
  • Loading branch information
pstorz committed Oct 7, 2020
1 parent d327ee8 commit d40ccfc
Showing 1 changed file with 2 additions and 42 deletions.
44 changes: 2 additions & 42 deletions core/cmake/BareosFindAllLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,48 +37,8 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set(Python3_FOUND 0)

else()
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
message(STATUS "CMake too old for FindPython2/3, using FindPythonInterp")
set(Python2_FOUND FALSE)
set(Python3_FOUND FALSE)
set(Python_ADDITIONAL_VERSIONS 2.6 2.7)
find_package(PythonInterp)
find_package(PythonLibs)
message(STATUS "Found PYTHON_VERSION_MAJOR" ${PYTHON_VERSION_MAJOR})
if(PYTHON_VERSION_MAJOR EQUAL 2)
set(Python2_FOUND ${PYTHONLIBS_FOUND})
set(Python2_LIBRARIES ${PYTHON_LIBRARIES})
set(Python2_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
set(Python2_EXECUTABLE ${PYTHON_EXECUTABLE})

elseif(PYTHON_VERSION_MAJOR EQUAL 3)
set(Python3_FOUND ${PYTHONLIBS_FOUND})
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
set(Python3_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()

set(Python_ADDITIONAL_VERSIONS 3.6 3.7 3.8 3.9)
find_package(PythonInterp)
find_package(PythonLibs)
message(STATUS "Found PYTHON_VERSION_MAJOR" ${PYTHON_VERSION_MAJOR})

if(PYTHON_VERSION_MAJOR EQUAL 2)
set(Python2_FOUND ${PYTHONLIBS_FOUND})
set(Python2_LIBRARIES ${PYTHON_LIBRARIES})
set(Python2_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
set(Python2_EXECUTABLE ${PYTHON_EXECUTABLE})
elseif(PYTHON_VERSION_MAJOR EQUAL 3)
set(Python3_FOUND ${PYTHONLIBS_FOUND})
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
set(Python3_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()

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

if(${Python2_FOUND} OR ${Python3_FOUND})
set(HAVE_PYTHON 1)
Expand Down

0 comments on commit d40ccfc

Please sign in to comment.