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. need to list included .c files as test file dependancies

need to list included .c files as test file dependancies

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 645 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.
  • strawbotS Offline
    strawbotS Offline
    strawbot
    wrote on last edited by
    #1

    As an embedded C developer I make good use of Qt Creator as a cross platform test environment. Typically I generate a unit test file and then to include the C source files for testing I add this at the beginning:

    extern "C" {
    #include "source1.c"
    #include "source2.c"
    }
    

    This works great as I get access to static variables and functions. The problem I need to solve is dependancies. When I change a C source file, the enclosing c++ test file doesn't rebuild. I have to manually do that myself or make a null change in the test file.

    Is there a way in the .pro file to state that the testfile.cpp is dependant on source1.c and source2.c?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      qmake's DEPENDPATH might be of use.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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