Skip to content
Snippets Groups Projects
Commit 1324c0c4 authored by Bienchen's avatar Bienchen
Browse files

SCHWED-4635: Changes to make the container work

parent ab13e8d4
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
# Author: Marco Biasini
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.12.1 FATAL_ERROR)
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
# Set CMake policies
# Behaviour of target_link_libraries, always link by full path. CMP0060 can
......@@ -277,8 +277,8 @@ if (ENABLE_GUI)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5OpenGL REQUIRED)
set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Gui Qt5::Widgets Qt5::Core)
ost_find_python_module(PyQt5.sip)
ost_find_python_module(PyQt5)
ost_find_python_module_alt("PyQt5.sip;sip")
endif()
if (ENABLE_SPNAV)
......
......@@ -759,6 +759,34 @@ macro(ost_find_python_module MODULE)
endif()
endmacro()
#-------------------------------------------------------------------------------
# make sure the previously detected Python interpreter has the given module
# while allowing alternative module names
#-------------------------------------------------------------------------------
macro(ost_find_python_module_alt MODULES)
set(_PY_MODS "")
foreach(py_mod ${MODULES})
if (NOT PYTHON_MODULE_${py_mod})
set(_PY_MODS "${_PY_MODS} ${py_mod}")
message(STATUS "Searching for python module ${py_mod} for ${PYTHON_BINARY}")
execute_process(COMMAND ${PYTHON_BINARY} -c "import ${py_mod}"
OUTPUT_QUIET ERROR_QUIET
RESULT_VARIABLE _IMPORT_ERROR)
if (NOT _IMPORT_ERROR)
message(STATUS "Found python module ${py_mod}")
set("PYTHON_MODULE_${py_mod}" FOUND CACHE STRING "" FORCE)
break()
endif (NOT _IMPORT_ERROR)
else ()
message(STATUS "Already found python module ${py_mod}")
unset(_IMPORT_ERROR)
break()
endif (NOT PYTHON_MODULE_${py_mod})
endforeach(py_mod ${MODULES})
if (_IMPORT_ERROR)
message(FATAL_ERROR "Could not find one of python modules ${_PY_MODS}. Please install one of them.")
endif ()
endmacro()
#-------------------------------------------------------------------------------
# this macro tries to detect a very common problem during configuration stage:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment