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".
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
@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/
Change your command to:
-
Code:
Select all
-
cd build/
cmake ../simgear-2019.1.2 -DCMAKE_BUILD_TYPE=Release
Scott
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 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