Qt5 build related improvements
Addition of PYTHON_SUFFIX and PYTHON_BASENAME available in all build scenarios offers more control when compiling (Py2/Py3/Qt5). Using symlinks as a workaround is not needed anymore. Forum discussion: https://forum.freecadweb.org/viewtopic.php?f=10&t=12534&p=208323#p208323
This commit is contained in:
@@ -921,8 +921,15 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
if(BUILD_QT5)
|
||||
# set(PYTHON_SUFFIX -python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||
SET(PYTHON_SUFFIX -python2.7) # for shiboken
|
||||
SET(PYTHON_BASENAME -python2.7) # for PySide
|
||||
# Below are two variables that can be left empty for standard python 3 version,
|
||||
# but must be set by the user for different python versions such as 2.7, 3.5 ...
|
||||
if (PYTHON_VERSION_MAJOR LESS 3)
|
||||
SET(PYTHON_SUFFIX -python2.7 CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: <ShibokenConfigPYTHON_SUFFIX.cmake>")
|
||||
SET(PYTHON_BASENAME -python2.7 CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: <PySideConfigPYTHON_BASENAME.cmake>")
|
||||
else()
|
||||
SET(PYTHON_SUFFIX "" CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: <ShibokenConfigPYTHON_SUFFIX.cmake>")
|
||||
SET(PYTHON_BASENAME "" CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: <PySideConfigPYTHON_BASENAME.cmake>")
|
||||
endif()
|
||||
|
||||
if(DEFINED MACPORTS_PREFIX)
|
||||
find_package(Shiboken REQUIRED HINTS "${PYTHON_LIBRARY_DIR}/cmake")
|
||||
@@ -973,15 +980,17 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
if (PYTHON_VERSION_MAJOR LESS 3)
|
||||
SET(PYTHON_SUFFIX -python2.7)
|
||||
SET(PYTHON_BASENAME -python2.7)
|
||||
else(PYTHON_VERSION_MAJOR LESS 3)
|
||||
# set(PYTHON_SUFFIX -python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||
# below are two variables that can be left empty for standard python, but must be set by the user for different python versions such as 3.5
|
||||
SET(PYTHON_SUFFIX "" CACHE STRING "Shiboken cmake file suffix. If left empty, system default python version will be used: <ShibokenConfigPYTHON_SUFFIX.cmake>")
|
||||
SET(PYTHON_BASENAME "" CACHE STRING "Same as PYTHON_SUFFIX but for PySide. if left empty, PYTHON_SUFFIX will be used: <PySideConfigPYTHON_BASENAME.cmake>")
|
||||
endif(PYTHON_VERSION_MAJOR LESS 3)
|
||||
# Below are two variables that can be left empty for standard python 3 version,
|
||||
# but must be set by the user for different python versions such as 2.7, 3.5 ...
|
||||
if (PYTHON_VERSION_MAJOR LESS 3)
|
||||
SET(PYTHON_SUFFIX -python2.7 CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: <ShibokenConfigPYTHON_SUFFIX.cmake>")
|
||||
SET(PYTHON_BASENAME -python2.7 CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: <PySideConfigPYTHON_BASENAME.cmake>")
|
||||
else()
|
||||
SET(PYTHON_SUFFIX "" CACHE STRING "Shiboken cmake file suffix. If left empty, system default will be used: <ShibokenConfigPYTHON_SUFFIX.cmake>")
|
||||
SET(PYTHON_BASENAME "" CACHE STRING "Same as PYTHON_SUFFIX but for PySide. If left empty, PYTHON_SUFFIX will be used: <PySideConfigPYTHON_BASENAME.cmake>")
|
||||
endif()
|
||||
|
||||
if(DEFINED MACPORTS_PREFIX)
|
||||
find_package(Shiboken REQUIRED HINTS "${PYTHON_LIBRARY_DIR}/cmake")
|
||||
find_package(PySide REQUIRED HINTS "${PYTHON_LIBRARY_DIR}/cmake")
|
||||
|
||||
Reference in New Issue
Block a user