Board index FlightGear Support Compiling

simgear compilation fails at cmake

Building FlightGear from source, and in the need for help?

simgear compilation fails at cmake

Postby tckosvic » Tue Dec 22, 2020 7:13 pm

I have been trying to compile simgear first then glightgear but I keep getting cmake failure. I am compiling simgear 2019.1.2. this same error keeps appearing. the terminaloutput from bash is included below. forget the warning and look at the error. cmake is looking for a cmake command where the code is not presenting a cmake command. dont know how to fix this. any ideas????
Look for the line at: CMake Error at bucket/CMakeLists.txt:2 (include):


Code: Select all
tom@DesktopPC:~/simgear-2019.1.2/sgbuild> cmake ../simgear -DCMAKE_BUILD_TYPE=Release
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.

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at bucket/CMakeLists.txt:2 (include):
  include could not find load file:

    SimGearComponent


CMake Error at bucket/CMakeLists.txt:7 (simgear_component):
  Unknown CMake command "simgear_component".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.17)

  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/tom/simgear-2019.1.2/sgbuild/CMakeFiles/CMakeOutput.log".
tckosvic
 
Posts: 16
Joined: Mon May 25, 2020 7:43 pm

Re: simgear compilation fails at cmake

Postby legoboyvdlp » Wed Dec 23, 2020 2:47 pm

Hello, I don't have an answer to your specific question,
But you may want to compile against the release/2020.3 branch. As well as being the latest version, and much much more stable, there are also a number of CMake improvements that make compiling more straightforward - if you have the folder structure set up correctly, for instance, cmake will automatically detect dependencies rather than having to define them :)
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: simgear compilation fails at cmake

Postby Hooray » Wed Dec 23, 2020 3:08 pm

If in doubt, try upgrading your cmake/build environment
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: simgear compilation fails at cmake

Postby xDraconian » Wed Dec 23, 2020 5:15 pm

@tckosvic,

You are skipping the top-level folder. The top level CMakeLists.txt file does already contain the project(SimGear) line the error is complaining about.

Ensure your build folder is alongside the 3rdparty folder, or better, don't put it within the source tree.

Quick-fix:
Code: Select all
cmake .. -DCMAKE_BUILD_TYPE=Release


Recommended:
build/
simgear-2019.1.2/
    3rdparty/
    CMakeModules/

Change your command to:
Code: Select all
cd build/
cmake ../simgear-2019.1.2 -DCMAKE_BUILD_TYPE=Release


Scott
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: simgear compilation fails at cmake

Postby tckosvic » Wed Dec 23, 2020 6:48 pm

SOLVED: Compilation of simgear was successful when puttinh build director parallel to the simgear main directory, not parallel to the simgear sourse directory.
Thanks to all.

Suggest "install file" included in git clone be modified to replace:

"In a directory alongside the SimGear source directory
use:

mkdir sgbuild
cd sgbuild
cmake ../simgear -DCMAKE_BUILD_TYPE=Release
make
sudo make install"

To say: In a directory alongside the SimGear main directory (above the source directory)
use:

mkdir sgbuild
cd sgbuild
cmake ../simgear -DCMAKE_BUILD_TYPE=Release
make
sudo make install"

Now to move on to flightgear. I am trying to install this as a user not into root where space is getting low. So I'll be doing some tinkering
tckosvic
 
Posts: 16
Joined: Mon May 25, 2020 7:43 pm

Re: simgear compilation fails at cmake

Postby Hooray » Wed Dec 23, 2020 7:10 pm

tckosvic wrote in Wed Dec 23, 2020 6:48 pm:Now to move on to flightgear. I am trying to install this as a user not into root where space is getting low. So I'll be doing some tinkering


No tinkering needed: Switch back to the simgear source directory, run cmake . -DCMAKE_INSTALL_PREFIX=$HOME

Use the same flag when configuring/building flightgear, it will just work.

If in doubt, please refer to the docs: http://wiki.flightgear.org/Building_using_CMake
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU


Return to Compiling

Who is online

Users browsing this forum: No registered users and 4 guests