Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator + CMake: Several targets from the same code with #ifdef's
Forum Updated to NodeBB v4.3 + New Features

QtCreator + CMake: Several targets from the same code with #ifdef's

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 306 Views
  • 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.
  • F Offline
    F Offline
    Fran
    wrote on last edited by
    #1

    I am using the same sources to generate two binaries that are mostly the same except for some code in #ifdefs. I know this is a bad practice (common in the scientific/Fortran world), but sometimes is useful and simple for optimization.

    When I generate my project in CMake, QtCreator recognises each of the targets and I can select which executable I want to compile/run/debug without problems. However, the syntax evaluator does not take this into account and I don't see the #ifdef'd parts of the code change from inactive to active when I do so, and code completion does not work properly in those regions.

    I believe with previous versions of QtCreator (I am using 4.1) this would work, but I am not too sure. Is this supported at all? If so, which is the way to make it work?

    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