Results 1 to 3 of 3

Thread: How to know what configuration type shared|static

  1. #1
    Join Date
    May 2009
    Posts
    56
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default How to know what configuration type shared|static

    hi there,

    I have a question:
    In the .pro file while compiling i can check if the qt configuration is static or shared using this:
    CONFIG(static, static|shared)

    I would like to know if there is a way to do this in the code as well somthing like this

    #ifdef Qt_SHARED
    //do something
    #elif define(Qt_STATIC)
    //do something else
    #endif

    thanks for the help

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to know what configuration type shared|static

    You can always define yourself:
    Qt Code:
    1. build_pass:CONFIG(static, static|shared){
    2. DEFINES += STATIC_BUILD
    3. } else{
    4. DEFINES += SHARED_BUILD
    5. }
    To copy to clipboard, switch view to plain text mode 

    Then in code:
    Qt Code:
    1. #ifdef STATIC_BUILD
    2. // static build code
    3. #elif defined(SHARED_BUILD)
    4. // shared build code
    5. #endif
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    May 2009
    Posts
    56
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to know what configuration type shared|static

    Thanks for the answer, i know this but what i do not want to do is to add that lines to all .pro files?

    thanks,

Similar Threads

  1. Using shared for debugging and static for deployment
    By bnilsson in forum Installation and Deployment
    Replies: 1
    Last Post: 25th July 2009, 12:24
  2. Replies: 4
    Last Post: 29th December 2008, 19:50
  3. shared vs static
    By alisami in forum Installation and Deployment
    Replies: 3
    Last Post: 4th October 2008, 13:04
  4. STATIC vs. SHARED
    By KaptainKarl in forum Installation and Deployment
    Replies: 1
    Last Post: 27th August 2007, 16:31
  5. shared versus static build
    By jcr in forum Installation and Deployment
    Replies: 2
    Last Post: 28th January 2006, 08:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.