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. How to make qt to detect embeded device on compiling time?

How to make qt to detect embeded device on compiling time?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
6 Posts 2 Posters 1.4k 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 A Former User
    #1

    at the moment I'm playing with a raspberry pi and I have a problem with the Qt Creator when want to run the app on my PC or on Raspberry.

    When running the program on pi I have to add

    target.path = /home/pi/atpSmartHome
    INSTALLS += target
    

    but when I have to run it on PC I have to comment out thowse lines... any way to do comething like

    embeded_PI {
             target.path = /home/pi/atpSmartHome
             INSTALLS += target
    }
    

    or anithing similar to this?

    Many thanks

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

      HI
      Im sure its possible but not sure what to check on - when compiling for the ARM

      http://stackoverflow.com/questions/24549612/qt-project-file-add-libs-depending-on-kit

      I assume you must change the kit to compile to the RB, so maybe the
      CONFIG(Desktop, Desktop|Target_ARM) xx can be used.

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

        yes but I'm looking for something like

        KIT = Desktop
        #KIT = RPI
        
        And use contains function
        
        contains( KIT, Desktop ) {
             LIBS += ...
        }
        contains( KIT, RPI) {
             target.path = /home/pi/atpSmartHome
        INSTALLS += target
        }
        

        how to maker qt Creator to detect witch settings to use?

        mrjjM 2 Replies Last reply
        0
        • A arsinte_andrei

          yes but I'm looking for something like

          KIT = Desktop
          #KIT = RPI
          
          And use contains function
          
          contains( KIT, Desktop ) {
               LIBS += ...
          }
          contains( KIT, RPI) {
               target.path = /home/pi/atpSmartHome
          INSTALLS += target
          }
          

          how to maker qt Creator to detect witch settings to use?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @arsinte_andrei
          Ok, does this work then?
          You have to "flip" KIT when you change but I guess that is ok?

          1 Reply Last reply
          0
          • A arsinte_andrei

            yes but I'm looking for something like

            KIT = Desktop
            #KIT = RPI
            
            And use contains function
            
            contains( KIT, Desktop ) {
                 LIBS += ...
            }
            contains( KIT, RPI) {
                 target.path = /home/pi/atpSmartHome
            INSTALLS += target
            }
            

            how to maker qt Creator to detect witch settings to use?

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by mrjj
            #5

            @arsinte_andrei
            It wont auto detect.

            You could just check kit name maybe

            MY_QT_INSTALL_PREFIX=$$[QT_INSTALL_PREFIX]
            equals(MY_QT_INSTALL_PREFIX,"C:/Qt/5.7/mingw53_32"){
            message($$[QT_INSTALL_PREFIX])
            }

            When i change between STATIC and normal kits i can catch it this way.
            I assume you can do the same for ARM.

            To check it that can work for you

            insert
            message($$[QT_INSTALL_PREFIX])

            in the .pro file and change kits and see what it prints.
            You should then easy be able to use equals to know when
            its for ARM.

            Searching the forum it also seems that

            linux-arm-gnueabi-g++ {
            ...
            }

            also works for some platforms. So I guess it also depends on the
            mkspec actually used on your platform.

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

              yes.. this is what I've been looking for
              now is working
              here you have the code

              
              MY_QT_INSTALL_PREFIX=$$[QT_INSTALL_PREFIX]
              equals(MY_QT_INSTALL_PREFIX,"/home/andrei/raspi/qt5pi"){
              message($$[QT_INSTALL_PREFIX])
              target.path = /home/pi/myApp
              INSTALLS += target
              }
              

              many thanks

              1 Reply Last reply
              1

              • Login

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