Ultimaker / cura-build-environment

CMake project to build dependencies for Cura
GNU Affero General Public License v3.0
24 stars 55 forks source link

PyQt build fails on mac if DYLD_LIBRARY_PATH is set in CONFIGURE_COMMAND #78

Open aharshac opened 4 years ago

aharshac commented 4 years ago

In pyqt.cmake, if DYLD_LIBRARY_PATH is set in the CONFIGURE_COMMAND, build fails with an sqlite3 error.

Querying qmake about your Qt installation... dyld: Symbol not found: _sqlite3_intarray_bind Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData Expected in: /Users/harsha/Documents/cura4-env/env_py/lib/libsqlite3.dylib in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData Error: PyQt5 requires Qt v5.0 or later. You seem to be using v3. Use the --qmake flag to specify the correct version of qmake.

However, removing "DYLD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib" from pyqt_command builds successfully.

set(pyqt_command
    ${Python3_EXECUTABLE} configure.py
    --sysroot ${CMAKE_INSTALL_PREFIX}
    --qmake ${CMAKE_INSTALL_PREFIX}/bin/qmake
    --sip ${CMAKE_INSTALL_PREFIX}/bin/sip
    --confirm-license
)
Ghostkeeper commented 4 years ago

This was necessary for Linux because there the PyQt library doesn't respect the RPath, apparently: https://github.com/Ultimaker/cura-build-environment/commit/4f46651002ccfa50cd5bdce714db64dd0eb30f36

I'm thinking that in this ${CMAKE_INSTALL_PREFIX}/lib path for you there might be a different libsqlite3.dylib file that is incompatible with PyQt? Like an older SQLite version? Maybe that's why it's failing?

Otherwise an exception can be made that this only happens on Linux, but for simplicity I'd rather keep it the same if not completely necessary.