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. [solved] PRO function calls

[solved] PRO function calls

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 4 Posters 3.1k 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.
  • U Offline
    U Offline
    urgentDiplomacy
    wrote on last edited by
    #1

    Hello,

    I am developing on 64bit Win7 and am trying to figure out why a
    @system(cd $$mydir)@

    call in my .pro file is not working. I have tried hard coding the path
    @system(cd C:/)@

    changing the cd call to chdir and even trying different combinations of parenthesis and still have issues. Here is my stub:
    @
    #-------------------------------------------------

    Project created by QtCreator 2012-05-11T11:47:17

    #-------------------------------------------------

    QT += core

    QT -= gui

    TARGET = test
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp

    system(cd C:/)
    system(dir)
    @

    This setup seems to work fine on Linux (with the appropriate changes to mydir and dir call). Is this a known compatibility issue? I have not found any documented forms of it...

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      I do not think changing directories is a good idea in qmake. What do you want to do?

      1 Reply Last reply
      0
      • U Offline
        U Offline
        urgentDiplomacy
        wrote on last edited by
        #3

        I have some code generation scripts that need to run on compilation in another directory, normally I would readjust the way the script executes but this is a part of a much larger project and editing the script may destabilize other coder's projects. I cannot really make this a 'one-off' solution unfortunately.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dbzhang800
          wrote on last edited by
          #4

          [quote author="urgentDiplomacy" date="1336762437"]Hello,

          This setup seems to work fine on Linux (with the appropriate changes to mydir and dir call).[/quote]

          I don't know why you think this works on Linux. IMO, this should fail under any OS. As the command passed to system() will run in another process.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            If you're not able to change the original scripts, I would write wrapper script that takes the desired directory as argument, changes directory to it and calls then calls the original script.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • U Offline
              U Offline
              urgentDiplomacy
              wrote on last edited by
              #6

              Thanks Volker and Herder for your help! I should have said that some people on my project believe that it works in linux but it doesn't for the reasons you specified Herder.

              [SOLVED] thanks to Herder.

              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