[SOLVED]Choosing a Lib version depending on the platform



  • Hi!

    I have a project that uses a little .lib , but this lib must be compiled in Win32 and another version in Win64 to work properly.
    I compile properly the lib to each platform, but now i´m linking it to the project and i need a way to detect the Kit i´m using to choose the correct version of the .lib .

    Anyone know how can i do this using the .pro file?

    Kind Regards.



  • "Condition and platform names":http://qt-project.org/forums/viewthread/11739 should help you.



  • I read the post , and thanks so much for it, but i´m still with doubt if i can make a more inteligent .pro file, for example:

    I have the following part on my .pro:

    @
    ############################################
    #WIN64 lib version #
    ############################################
    #win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../libs/ins3d/Win64/release/ -lINS3D
    #else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../libs/ins3d/Win64/debug/ -lINS3D

    #INCLUDEPATH += $$PWD/../libs/ins3d/Win64/include
    #DEPENDPATH += $$PWD/../libs/ins3d/Win64/include

    #win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../libs/ins3d/Win64/release/INS3D.lib
    #else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../libs/ins3d/Win64/debug/INS3D.lib
    ############################################
    #WIN32 Lib Version #
    ############################################
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../libs/ins3d/Win32/release/ -lINS3D
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../libs/ins3d/Win32/debug/ -lINS3D

    INCLUDEPATH += $$PWD/../libs/ins3d/Win32/include
    DEPENDPATH += $$PWD/../libs/ins3d/Win32/include

    win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../libs/ins3d/Win32/release/INS3D.lib
    else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../libs/ins3d/Win32/debug/INS3D.lib
    @

    Everytime when i need switch platform, i need comment and uncomment the .pro file to work with the correct version.

    Exists a variable or a way to do this without this type of thing?

    Kind Regards.



  • You should be able to use blocks like

    @win32{

    win32 library stuff here

    }
    win64{
    #win64 stuff here
    }@



  • Thanks so much!
    I will try it.

    Kind Regards.


Log in to reply
 

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