Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Using cmake with statically linked Qt (Linux embedded EGLFS)



  • I have written a Qt application that uses CMake as build system, and runs under a minimal custom Linux distribution (EGLFS QPA platform).
    Works fine when dynamically linked to Qt. But when I build Qt statically, and just try to compile my application (without making any changes to build script) I get:

    CMake Error:
      Error evaluating generator expression:
    
        $<IN_LIST:Qt5::QDebugMessageServiceFactory,$<TARGET_PROPERTY:QT_PLUGINS>;$<TARGET_PROPERTY:QT_PLUGINS_qmltooling>>
    
      Expression did not evaluate to a known generator expression
    
    
    CMake Error:
      Error evaluating generator expression:
    
        $<IN_LIST:Qt5::QEglFSEmulatorIntegrationPlugin,$<TARGET_PROPERTY:QT_PLUGINS>;$<TARGET_PROPERTY:QT_PLUGINS_egldeviceintegrations>>
    
      Expression did not evaluate to a known generator expression
    
    
    CMake Error:
      Error evaluating generator expression:
    
        $<IN_LIST:Qt5::QDebugMessageServiceFactory,$<TARGET_PROPERTY:QT_PLUGINS>;$<TARGET_PROPERTY:QT_PLUGINS_qmltooling>>
    
      Expression did not evaluate to a known generator expression
    
    
    CMake Error:
      Error evaluating generator expression:
    
        $<IN_LIST:Qt5::QEglFSEmulatorIntegrationPlugin,$<TARGET_PROPERTY:QT_PLUGINS>;$<TARGET_PROPERTY:QT_PLUGINS_egldeviceintegrations>>
    
      Expression did not evaluate to a known generator expression
    
    
    CMake Error:
      Error evaluating generator expression:
    
        $<IN_LIST:Qt5::QDebugMessageServiceFactory,$<TARGET_PROPERTY:QT_PLUGINS>;$<TARGET_PROPERTY:QT_PLUGINS_qmltooling>>
    
      Expression did not evaluate to a known generator expression
    
    
    CMake Error:
      Error evaluating generator expression:
    
        $<IN_LIST:Qt5::QEglFSEmulatorIntegrationPlugin,$<TARGET_PROPERTY:QT_PLUGINS>;$<TARGET_PROPERTY:QT_PLUGINS_egldeviceintegrations>>
    
      Expression did not evaluate to a known generator expression
    

    Is there any documentation on what modifications needs to be done in CMakelists.txt to get this to work with a static Qt library?
    Only documentation on the Qt site is for qmake projects.



  • In case somebody else stumbles over this:

    Problem seems to be limited to older versions of CMake (like 3.10.2 which comes with Ubuntu 18.04 LTS)
    With newer CMake it does work properly.


Log in to reply