CMakeLists.txt 2.2 KB
Newer Older
1 2
SET(PREFIX_ext_pyqt "${EXTPREFIX}" )
if (UNIX)
3
    SET(PYTHON_EXECUTABLE_PATH ${PREFIX_ext_pyqt}/bin/python3)
4 5 6 7
    if(NOT EXISTS ${PYTHON_EXECUTABLE_PATH})
      message("WARNING: using system python3!")
      SET(PYTHON_EXECUTABLE_PATH python3)
    endif()
8 9 10 11 12 13 14 15

    list(APPEND _PYQT_conf
        --confirm-license
        --qmake ${PREFIX_ext_pyqt}/bin/qmake
        --sip ${PREFIX_ext_pyqt}/bin/sip
        --sip-incdir ${PREFIX_ext_pyqt}/include
        --sipdir ${PREFIX_ext_pyqt}/share/sip
    )
16 17
    ExternalProject_Add( ext_pyqt
        DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
18 19
        URL https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.12.1/PyQt5_gpl-5.12.1.tar.gz
        URL_MD5 67508b652098d2e05c4c2b5baeb170cc
20
        
21
        CONFIGURE_COMMAND ${PYTHON_EXECUTABLE_PATH} <SOURCE_DIR>/configure.py ${_PYQT_conf}
22 23 24 25 26 27 28
        BUILD_COMMAND make
        INSTALL_COMMAND make install
        
        BUILD_IN_SOURCE 1

        UPDATE_COMMAND ""
    )
29
elseif(MINGW)
30

Alvin Wong's avatar
Alvin Wong committed
31 32 33 34 35 36 37 38 39 40
    list(APPEND _PYQT_conf
        --confirm-license
        --target-py-version 3.6
        --bindir ${PREFIX_ext_pyqt}/bin
        --qt ${PREFIX_ext_pyqt}
        --sip ${PREFIX_ext_pyqt}/bin/sip.exe
        --sip-incdir ${PREFIX_ext_pyqt}/include
        --spec win32-g++
        --verbose
        --sipdir ${PREFIX_ext_pyqt}/share/sip
41 42
        --destdir ${PREFIX_ext_pyqt}/lib/krita-python-libs
        --stubsdir ${PREFIX_ext_pyqt}/lib/krita-python-libs/PyQt5
Alvin Wong's avatar
Alvin Wong committed
43
        --no-qml-plugin --no-python-dbus --no-qsci-api --no-tools
44
        --disable QtSql --disable QtTest --disable QtWinExtras --disable QtHelp
Alvin Wong's avatar
Alvin Wong committed
45
    )
46 47
    ExternalProject_Add( ext_pyqt
        DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
48 49 50
        URL https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.12.1/PyQt5_gpl-5.12.1.zip
        URL_MD5 0b2912828a4d59e13d86decdce1687e6

Alvin Wong's avatar
Alvin Wong committed
51 52
        PATCH_COMMAND  ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/pyqt-configure-fix.patch

53
        CONFIGURE_COMMAND ${PYTHON_EXECUTABLE} <SOURCE_DIR>/configure.py ${_PYQT_conf}
54
        BUILD_COMMAND mingw32-make -j${SUBMAKE_JOBS} CXXFLAGS=-D_hypot=hypot LDFLAGS=${SECURITY_SHARED_LINKER_FLAGS}
55
        INSTALL_COMMAND mingw32-make install
56 57 58 59 60 61
        
        BUILD_IN_SOURCE 1

        UPDATE_COMMAND ""
    )

62 63
endif()