Note that there are some explanatory texts on larger screens.

plurals
  1. POBuilding a Shared Library, Updating Header Files to Compiler/System Directories
    text
    copied!<p>A friend and I are using Qt Creator with Boost to build a game engine. So far we have this idea that the engine is going to be a shared library, with the idea that we can run it with a test executable which will turn into the game we eventually want to make.</p> <p>The problem is header files, mainly. I'd like to find some way for Qt Creator to be able to recognize the header files as soon as the latest builds of the engine have been built or even when they're added. At first I was thinking a script in Python which executed as a build step in Qt Creator after the engine had been built, would simply copy the header files to a system directory (<code>/usr/include</code>, for example - if operating on a *nix system), where the IDE would then recognize the header files when linking the engine with the test executable, and we'd also have full auto completion support.</p> <p>Of course, environmental variables would be used, and while I prefer developing in Linux, my friend prefers Windows, so we agreed to take care of development in regards to our respective platform preferences.</p> <p>While this seems like a good solution, I think this Python script idea may be over kill. Is there a better way to do this?</p> <p><strong>Update</strong></p> <p>From to the suggested Qmake script, I end up getting this error.</p> <pre><code>cp -f "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/"AtlasEngine_global.h "/" cp: cannot create regular file `/AtlasEngine_global.h': Permission denied make: Leaving directory `/home/amsterdam/Programming/atlas/Engine/AtlasEngine__GCC__Linux__Debug' make: *** [libAtlasEngine.so.1.0.0] Error 1 15:20:52: The process "/usr/bin/make" exited with code 2. Error while building project AtlasEngine (target: Desktop) When executing build step 'Make' </code></pre> <p>My adjustments look as follows:</p> <pre><code># Copy over build artifacts SRCDIR = $$ATLAS_PROJ_ROOT DESTDIR = $$ATLAS_INCLUDE # Look for header files there too INCLUDEPATH += $$SRCDIR # Dependencies: mylib. Only specify the libs you depend on. # Leave out for building a shared library without dependencies. #win32:LIBS += $$quote($$SRCDIR/mylib.dll) # unix:LIBS += $$quote(-L$$SRCDIR) -lmylib DDIR = \"$$SRCDIR/\" #&lt;--DEFAULTS SDIR = \"$$IN_PWD/\" # Replace slashes in paths with backslashes for Windows win32:file ~= s,/,\\,g win32:DDIR ~= s,/,\\,g win32:SDIR ~= s,/,\\,g for(file, HEADERS) { QMAKE_POST_LINK += $$QMAKE_COPY $$quote($${SDIR}$${file}) $$quote($$DDIR) $$escape_expand(\\n\\t) } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload