Using QT_SYSROOT or CMAKE_SYSROOT in .pro file



  • what I'm doing is an app that will run on both Raspberry Pi and on desktop - linux also
    so I can't use

    win32 {
    my stuff here
    }
    

    or

    linux {
    also other stuff here - for linux only
    }
    

    I've tried

    RPI3 {
     my stuff
    }
    

    but it does not exist...

    so my next try was to detect the sysroot - this is different between desktop and Pi. but how can I do it?
    I've tested something like

    contains([QT_SYSROOT], /home/user/raspi/sysroot){
        message(I'm in Pi 1)
    }
    
    contains([CMAKE_SYSROOT], /home/user/raspi/sysroot){
        message(I'm in Pi 2)
    }
    
    
    contains(QT_SYSROOT, /home/user/raspi/sysroot){
        message(I'm in Pi 3)
    }
    
    contains(CMAKE_SYSROOT, /home/user/raspi/sysroot){
        message(I'm in Pi 4)
    }
    
    message(I'm out)
    

    None of them is working. what do I miss?? Is always printing: "I'm out"


  • Lifetime Qt Champion

    Hi,

    IIRC, the linux-rasp-pi* scope should do what you want.

    Hope it helps


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.