QtCreator + SDL same projects different targets(Debian and Raspberry)



  • I'm developing an application that uses SDL Libraries using QtCreator as IDE. My end target is Raspberry Pi but I've already configured a cross compiler to work on Debian.

    My aim is to have the same project and just switch target on QtCreator, I've already configured kits for both platforms and even added the Raspberry Pi as device on QtCreator.

    The point is that I don't know what to write into the .pro file to include different libs/includes and defines based in the target, here's a small piece of the .pro file:

    whathere? # RaspBerry
    	   {
    	   LIBS += -L/raspberry/SDL_pi/lib/ -lSDL2 -lSDL2_image
    	   INCLUDEPATH = /raspberry/SDL_pi/include
    	   DEFINES += RASPI
    	   }
    whathere?
    	   {
    	   LIBS += -L/usr/local/lib/ -lSDL2 -lSDL2_image
    	   INCLUDEPATH = /usr/local/include
    	   DEFINES += LINUX
    	   }
    

    Thank you in advance.


  • Moderators

    You can put the name of mkspec you are used for the given platform. I think for Raspberry it's something like linux-rasp-pi-g++. Open the mkspecs/devices folder in your Qt installation and check it out or open the Kits propertties page in Qt Creator and see which mkspec your kits are using.



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