Skip to content

Commit

Permalink
cmake/findDependencies.cmake: avoid some duplicated code
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Sep 16, 2024
1 parent 4f9732f commit d79dc81
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmake/findDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,20 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)

if(CMAKE_VERSION VERSION_EQUAL "3.12" OR CMAKE_VERSION VERSION_GREATER "3.12")
find_package(Python COMPONENTS Interpreter)
if(NOT Python_Interpreter_FOUND AND NOT USE_MATCHCOMPILER_OPT STREQUAL "Off")
message(WARNING "No python interpreter found - disabling matchcompiler.")
set(USE_MATCHCOMPILER_OPT "Off")
endif()
else()
find_package(PythonInterp 3 QUIET)
if(NOT PYTHONINTERP_FOUND AND NOT USE_MATCHCOMPILER_OPT STREQUAL "Off")
message(WARNING "No python interpreter found - disabling matchcompiler.")
endif()
if(PYTHONINTERP_FOUND)
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
set(Python_VERSION ${PYTHON_VERSION_STRING})
set(Python_Interpreter_FOUND ${PYTHONINTERP_FOUND})
endif()
endif()

if(NOT Python_Interpreter_FOUND AND NOT USE_MATCHCOMPILER_OPT STREQUAL "Off")
message(WARNING "No python interpreter found - disabling matchcompiler.")
set(USE_MATCHCOMPILER_OPT "Off")
endif()

if(NOT USE_BUNDLED_TINYXML2)
find_package(tinyxml2 QUIET)
if(TARGET tinyxml2::tinyxml2)
Expand Down

0 comments on commit d79dc81

Please sign in to comment.