Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Multiple binaries from same source files

Multiple binaries from same source files

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
1 Posts 1 Posters 328 Views 1 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.
  • D Offline
    D Offline
    deleted287
    wrote on last edited by
    #1

    Hi there,

    We have a complex build that's set up with qmake at the moment. We need to build libraries and executables with 4 different options, which correspond to:

    1. Single precision, serial
    2. Double precision, serial
    3. Single precision, parallel
    4. Double precision, parallel

    The pattern that we've followed up to now is to have a lib_common.pri file which lists the sources, and then four *.pro files like:

    lib_s_s.pro
    lib_d_s.pro
    lib_s_p.pro
    lib_d_p.pro
    

    which set the compiler options specific to each version of the library, and then include the lib_common.pri file. We then have an overarching 'lib.pro' file which is like:

    TEMPLATE = subdirs
    SUBDIRS = \
         lib_s_s.pro \
         lib_d_s.pro \
         lib_s_p.pro \
         lib_d_p.pro 
    

    While this works, we're finding that it's not a very elegant solution, and it means that for e.g. for a test binary, we can have a single source file and 6 build files.

    Is there any way to do this more elegantly? Ideally, we'd like to be able to do something akin to:

    for precision in [single, double]
        for concurrency in [serial, parallel]
            CONFIG = $precision $concurrency
            TARGET = lib_${precision}_${concurrency}
            SOURCES = somesources.cpp
        end for
    end for
    

    which would allow us to keep each library/executable's build script to at most one or two files.

    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