[GNC-dev] building gnucash

john jralls at ceridwen.us
Fri Jul 8 12:21:37 EDT 2022



> On Jul 8, 2022, at 7:36 AM, Kevin T <nevikintx at yahoo.com> wrote:
> 
> On Thu, 2022-07-07 at 17:21 -0700, John Ralls wrote:
>>> On Jul 7, 2022, at 4:34 PM, Kevin T via gnucash-devel <gnucash-devel at gnucash.org> wrote:
>>> 
>>> 
>>> Hi All,
>>> 
>>> yan.  yet another newbie
>>> 
>>> New installation of centos stream 8
>>> 
>>> [kt at localhost gnucash-build]$ cat /etc/redhat-release 
>>> CentOS Stream release 8
>>> [kt at localhost gnucash-build]$ cmake --version
>>> cmake version 3.20.2
>>> 
>>> i had to install these packages to get to the starting point for
>>> gnucash.
>>> 
>>> drwxrwxr-x. 13 kt kt     4096 Jul  6 14:43 gc-8.0.6
>>> drwxrwxr-x. 16 kt kt     4096 Jul  5 21:27 gmp-6.2.1
>>> drwxr-xr-x. 15 kt kt     4096 Jul  6 19:04 gnucash-4.11
>>> drwxr-xr-x. 21 kt kt     4096 Jul  6 14:45 guile-3.0.8
>>> drwxrwxr-x. 11 kt kt     4096 Jul  6 14:20 libffi-3.4.2
>>> drwxrwxr-x. 10 kt kt     4096 Jul  5 21:32 libunistring-1.0
>>> 
>>> 
>>> I had to create the /glib-2.0 dir and other sub dirs.
>>> 
>>> [kt at localhost gnucash-build]$ echo $SRCROOT
>>> /home/kt/Sources/gnucash-4.11
>>> 
>>> [kt at localhost gnucash-build]$ ls $SRCROOT
>>> AUTHORS         ChangeLog.2001  ChangeLog.2007  ChangeLog.2013  ChangeL
>>> og.2019  CMakeLists.txt  gnucash     README
>>> bindings        ChangeLog.2002  ChangeLog.2008  ChangeLog.2014  ChangeL
>>> og.2020  common          HACKING     README.dependencies
>>> borrowed        ChangeLog.2003  ChangeLog.2009  ChangeLog.2015  ChangeL
>>> og.2021  data            libgnucash  test-templates
>>> ChangeLog       ChangeLog.2004  ChangeLog.2010  ChangeLog.2016  cmake  
>>>        doc             LICENSE     util
>>> ChangeLog.1999  ChangeLog.2005  ChangeLog.2011  ChangeLog.2017  CMakeCa
>>> che.txt  DOCUMENTERS     NEWS
>>> ChangeLog.2000  ChangeLog.2006  ChangeLog.2012  ChangeLog.2018  CMakeFi
>>> les      gnome           po
>>> 
>>> 
>>> The error @ line 66, I dont know what to do with.  The equal signs
>>> demarcate the output of the screen.
>>> 
>>> =======================================================================
>>> [kt at localhost gnucash-build]$ pwd
>>> /home/kt/gnucash-build
>>> [kt at localhost gnucash-build]$ cmake $SRCROOT/gnucash
>>> CMake Warning (dev) in CMakeLists.txt:
>>> No project() command is present.  The top-level CMakeLists.txt file
>>> must
>>> contain a literal, direct call to the project() command.  Add a line
>>> of
>>> code such as
>>> 
>>>   project(ProjectName)
>>> 
>>> near the top of the file, but after cmake_minimum_required().
>>> 
>>> CMake is pretending there is a "project(Project)" command on the
>>> first
>>> line.
>>> This warning is for project developers.  Use -Wno-dev to suppress it.
>>> 
>>> CMake Error at gnome/CMakeLists.txt:66 (gnc_add_swig_guile_command):
>>> Unknown CMake command "gnc_add_swig_guile_command".
>>> 
>>> 
>>> CMake Warning (dev) in CMakeLists.txt:
>>> No cmake_minimum_required command is present.  A line of code such as
>>> 
>>>   cmake_minimum_required(VERSION 3.20)
>>> 
>>> should be added at the top of the file.  The version specified may be
>>> lower
>>> if you wish to support older CMake versions for this project.  For
>>> more
>>> information run "cmake --help-policy CMP0000".
>>> This warning is for project developers.  Use -Wno-dev to suppress it.
>>> 
>>> -- Configuring incomplete, errors occurred!
>>> ================================================================
>>> 
>>> this error line is in the file: $SRCROOT/gnucash/gnome/CMakeLists.txt
>>> 
>>> Untar'd and I have changed NOTHING in the source code. 
>>> I have also tried the following (results from web search). Both
>>> resulted in the same error. 
>>> 
>>> cmake $SRCROOT -DCMAKE_INSTALL_PREFIX=/usr/local
>>> cmake $SRCROOT -DCMAKE_INSTALL_PREFIX=$HOME/.local
>>> 
>>> what is the solution to this stumbling block?
>> 
>> Follow the instructions more carefully: The cmake command should be `cmake $SRCROOT` not `cmake $SRCROOT/gnucash`.
> 
> The build directory is not the same as the src directory.
> 
> I tried that as well.  Same result.  The CMakeOutput.log has no errors listed.
> 
> [kt at localhost gnucash-build]$ cmake $SRCROOT
> CMake Warning (dev) in CMakeLists.txt:
>  No project() command is present.  The top-level CMakeLists.txt file must
>  contain a literal, direct call to the project() command.  Add a line of
>  code such as
> 
>    project(ProjectName)
> 
>  near the top of the file, but after cmake_minimum_required().
> 
>  CMake is pretending there is a "project(Project)" command on the first
>  line.
> This warning is for project developers.  Use -Wno-dev to suppress it.
> 
> CMake Error at gnome/CMakeLists.txt:66 (gnc_add_swig_guile_command):
>  Unknown CMake command "gnc_add_swig_guile_command".
> 
> 
> CMake Warning (dev) in CMakeLists.txt:
>  No cmake_minimum_required command is present.  A line of code such as
> 
>    cmake_minimum_required(VERSION 3.20)
> 
>  should be added at the top of the file.  The version specified may be lower
>  if you wish to support older CMake versions for this project.  For more
>  information run "cmake --help-policy CMP0000".
> This warning is for project developers.  Use -Wno-dev to suppress it.
> 
> -- Configuring incomplete, errors occurred!
> See also "/home/kt/Sources/gnucash-4.11/CMakeFiles/CMakeOutput.log".
> [kt at localhost gnucash-build]$ 


The errors "no project() command is present" and "unknown cmake command gnc_add_swig_guile_command" are from telling cmake to start with gnucash-4.11/gnucash/CMakeLists.txt instead of gnucash-4.11/CMakeLists.txt, that is `cmake $SRCROOT/gnucash` instead of `cmake $SRCROOT`.

You must have run cmake inside of the source directory at some point, otherwise there would be no "/home/kt/Sources/gnucash-4.11/CMakeFiles/CMakeOutput.log". The existence of a CMakeCache.txt in $SRCROOT overrides the CMakeLists.txt there and foils any future build attempts.

Do the following:
  cd /home/kt/Sources
  rm -rf gnucash-4.11
  tar -xf /home/kt/Downloads/gnucash-4.11.tar.bz2 # Substitute the path you downloaded if it's different
  cd /home/kt/gnucash-build # Or wherever gnucash-build is really
  cmake /home/kt/Sources/gnucash-4.11

to make sure everything is clean.

You said in your first message that you'd had to install several packages and create /glib-2.0, but you didn't say how you'd done that. If you used dnf and installed the development packages then that's OK, but having to create /glib-2.0 (you meant /usr/lib64/glib-2.0, right?) indicates that you'll need to install a bunch of developer packages for at least the gtk stack. Cmake will continue to fail until you've satisfied all of the dependencies with headers as well as libraries; headers come from the development version of packages, commonly named with a -dev or -devel suffix, e.g. `sudo dnf install glib2-devel`.

Regards,
John Ralls



More information about the gnucash-devel mailing list