Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Custom process step: build a .net project
QtWS25 Last Chance

Custom process step: build a .net project

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 434 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.
  • M Offline
    M Offline
    Merlino
    wrote on last edited by
    #1

    Hello,

    I have a solution with several Qt subprojects, which is set to build all through command line/qmake (no QtCreator).

    Now I would like to insert a new .net project and configure the custom build for it, in order to have a complete build of all subprojects with only one command.
    With QtCreator is quite simple disable the standard build steps and add a new custom process step, I made it. But in my solution I cannot count on QtCreator and the .pro.user file, but only on the .pro file.

    I have googled and I found that is possibile to use QMAKE_EXTRA_TARGETS in .pro file to add the custom build step so I wrote this in the .pro file:

    CONFIG = debug_and_release
    
    DOTNET_SDK = FALSE
    system("dotnet --version"): DOTNET_SDK = TRUE
    equals(DOTNET_SDK, "FALSE") {
      error("Mandatory dotnet SDK not found!!!!")
    }
    
    dotenet_build.commands = dotnet.exe build ./mydotnetproject.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary
    QMAKE_EXTRA_TARGETS += dotenet_build
    

    But I have encountered two problems:

    • The build execute some "standard" compilation steps that should be disabled (this project cannot be build with g++).
    • The custom build step is not executed.

    Can anybody help me?

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

      Hi,

      Wouldn't a custom compiler be better suited in this ?

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

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Wouldn't a custom compiler be better suited in this ?

        M Offline
        M Offline
        Merlino
        wrote on last edited by
        #3

        @SGaist said in Custom process step: build a .net project:

        Hi,

        Wouldn't a custom compiler be better suited in this ?

        I wondered, but the configuration of the custom compiler seemed to me more oriented to having a list of sources to be processed in input and a list of files in output; In my case I just need a single command that takes in input a single file.

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

          The fact that you only need to pass one file is not important. If the tool does what you want, it's all that matters.

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

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            The fact that you only need to pass one file is not important. If the tool does what you want, it's all that matters.

            M Offline
            M Offline
            Merlino
            wrote on last edited by
            #5

            @SGaist said in Custom process step: build a .net project:

            The fact that you only need to pass one file is not important. If the tool does what you want, it's all that matters.

            I finally managed to configure my custom build step, but a problem remains: as the first step always activates the compilation with the standard compiler, which in my case, since there are no sources to process, says that it has no file to work on. I wish only the build with the extra compiler would remain, deactivating the standard one.

            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