[GNC-dev] GnuCash 3.0 wine versus Windoze 10

DaveC49 davidcousens at bigpond.com
Sat Apr 21 08:07:47 EDT 2018


Robin,

I think having a separate build directory is what you would consider best
practice using cmake. Where that build directory is located does not appear
to be a major issue from my reading of the CMake documentation so far. 

I have built other applications and libraries using cmake where a separate
build directory was not used but it is certainly cleaner if you have to
rebuild as you can just delete the build directory and start again which is
not possible if you build in the top level source directory. I guess cmake
does not have the equivalent of a make clean. In-source building also
appears to be the default cmake behaviour. I could be wrong  but so far have
not had any problems

For the Gnucash-3.0 program it does not appear to matter whether the build
directory is outside or inside the top level gnucash-3.0 directory. I have
built it successfully both with the build directory as a subdirectory of the
toplevel gnucash-3.0 directory and with it as a parallel directory at the
same level without any problems.  The only difference is you have to ensure
that the target specified in the cmake command is referencing the
gnucash-3.0 directory (which contains the top levelCMakeLists.txt file with
which cmake initiates its execution) particularly if you are using relative
referencing to do so. 

I found a reference to an earlier post for the documentation build for
GnuCash not the program build where it apparently did matter because of an
issue with the intltools package. I suspect this is where the issues over
the location of the build directory arose.

You normally initiate the 
$cmake [options] <target>

command from a terminal which is opened in or set to the build directory.
<target> points to the directory containing the toplevel CmakeLists.txt file
defined for your application, normally the top level source directory.

With this directory structure:

<home>|
             |gnucash-3.0|
                                |build
                                |CMakeLists.txt

<target> can be any of .. or ../ or ../../gnucash-3.0. Here .. or ../ take
you into the gnucash-3.0 directory from which the top level CMakeLists.txt
is found. ../../gnucash-3.0 takes you to the <home> directory with the ../..
part then /gnucash-3.0 puts you into the top level directory.

Alternatively if the directory structure is:

<home>|gnucash-3.0|
             |                  |CMakeLists.txt
             |build

<target> would be ../gnucash-3.0 if you are using relative referencing. 

You can actually have the build diretory anywhere you like as long as there
are no permissions issues and you correctly reference the gnucash-3.0 top
level directory as the target for the cmake command.

Alternatively you could also reference the top level directory absolutely.
If <home> in the above is an absolute path to the location of the toplevel
gnucash-3.0 directory, i.e. of the form /home/<user>/applications, then you
would supply the <target> as /home/<user>/applications/gnucash-3.0.
 
I have a personal preference for having the build directory under the top
level folder because it keeps it all together (as long as it doesn't cause
issues in the build). I just tested extracting a new copy from the
downloaded archive over an existing extracted copy which had a build
directory in it and the build directory and contents still existed and were
unchanged after the second extraction to the same parent directory, so that
is not an issue. 

David



-----
David Cousens
--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html


More information about the gnucash-devel mailing list