Skip to content

Commit

Permalink
implement tiny layer for PySide/PySide2
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Dec 28, 2016
1 parent 2df8402 commit 23b0793
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions CMakeLists.txt
Expand Up @@ -852,6 +852,25 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif(NOT PYSIDE_INCLUDE_DIR)

find_package(PySide2Tools REQUIRED) # PySide2 utilities (pyside2-uic & pyside2-rcc)

file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/PySide)
file(WRITE ${CMAKE_BINARY_DIR}/bin/PySide/__init__.py "# PySide wrapper\n")
file(WRITE ${CMAKE_BINARY_DIR}/bin/PySide/QtCore.py "from PySide2.QtCore import *\n\n"
"#QCoreApplication.CodecForTr=0\n"
"#QCoreApplication.UnicodeUTF8=1\n")
file(WRITE ${CMAKE_BINARY_DIR}/bin/PySide/QtGui.py "from PySide2.QtGui import *\n"
"from PySide2.QtWidgets import *\n")
file(WRITE ${CMAKE_BINARY_DIR}/bin/PySide/QtSvg.py "from PySide2.QtSvg import *\n")

INSTALL(
FILES
${CMAKE_BINARY_DIR}/bin/PySide/__init__.py
${CMAKE_BINARY_DIR}/bin/PySide/QtCore.py
${CMAKE_BINARY_DIR}/bin/PySide/QtGui.py
${CMAKE_BINARY_DIR}/bin/PySide/QtSvg.py
DESTINATION
bin/PySide
)
else()
# set(PYTHON_SUFFIX -python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
SET(PYTHON_SUFFIX -python2.7) # for shiboken
Expand Down

0 comments on commit 23b0793

Please sign in to comment.