Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Using QT_SYSROOT or CMAKE_SYSROOT in .pro file
Forum Updated to NodeBB v4.3 + New Features

Using QT_SYSROOT or CMAKE_SYSROOT in .pro file

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 2 Posters 1.5k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arsinte_andrei
    wrote on last edited by
    #1

    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"

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • A Offline
        A Offline
        arsinte_andrei
        wrote on last edited by
        #3

        @SGaist said in Using QT_SYSROOT or CMAKE_SYSROOT in .pro file:

        linux-rasp-pi*

        tried like that

        linux-rasp-pi*{
            message("working???")
        }
        

        and I'm getting this message even when I'm doing for desktop (Ubuntu Linux)

        1 Reply Last reply
        0
        • A Offline
          A Offline
          arsinte_andrei
          wrote on last edited by
          #4

          Here you have a working code.. after a lot of research:

          MY_QT_INSTALL_PREFIX=$$[QT_INSTALL_PREFIX]
          equals(MY_QT_INSTALL_PREFIX,"/home/andrei/raspi/qt5pi"){
              message($$[QT_INSTALL_PREFIX])
              message("Is Raspberry")
              target.path = /home/pi/myApp
              INSTALLS += target
          }
          
          # other stuff here
          
          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved