Unknown CMake command "add_py_modules" - cmake

I'm setting up to build openage, a clone of AoE2 genie engine. My cmake command is not being processed. Is "add_py_modules" not possible here?
This is for windows 10, using vcpkg. Command used :
cmake -DCMAKE_TOOLCHAIN_FILE=C:\Software\vcpkg/scripts/buildsystems/vcpkg.cmake ..
CMakeLists.txt:
# python module configurations
# python config file is created in libopenage
# in order to get options from libopenage
cmake_minimum_required(VERSION 3.15)
project(openage)
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
add_py_modules(
__init__.py
__main__.py
assets.py
${CMAKE_CURRENT_BINARY_DIR}/config.py
default_dirs.py
NOINSTALL devmode.py
)
add_cython_modules(
cython_check.pyx
)
add_subdirectory(cabextract)
add_subdirectory(codegen)
add_subdirectory(convert)
add_subdirectory(cppinterface)
add_subdirectory(cvar)
add_subdirectory(event)
add_subdirectory(game)
add_subdirectory(log)
add_subdirectory(util)
add_subdirectory(renderer)
add_subdirectory(testing)
Output:
-- Building for: Visual Studio 16 2019
CMake Warning at C:/Software/vcpkg/scripts/buildsystems/vcpkg.cmake:107
(message):
There are no libraries installed for the Vcpkg triplet x64-windows.
Call Stack (most recent call first):
C:/Software/cmake-3.15.0-rc2-win64-x64/share/cmake-3.15/Modules/CMakeDetermineSystem.cmake:93 (include)
CMakeLists.txt:7 (project)
-- The C compiler identification is MSVC 19.21.27702.2
-- The CXX compiler identification is MSVC 19.21.27702.2
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio/2019/Community/VC/Tools/MSVC/14.21.27702/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio/2019/Community/VC/Tools/MSVC/14.21.27702/bin/Hostx64/x64/cl.exe --
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: C:/Program Files (x86)/Microsoft Visual
Studio/2019/Community/VC/Tools/MSVC/14.21.27702/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
Studio/2019/Community/VC/Tools/MSVC/14.21.27702/bin/Hostx64/x64/cl.exe --
works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:10 (add_py_modules):
Unknown CMake command "add_py_modules".
-- Configuring incomplete, errors occurred!
See also
"C:/Users/kafon/Desktop/openage/openage/build/CMakeFiles/CMakeOutput.log".
PS C:\Users\kafon\Desktop\openage\openage\build>

Getting
Unknown CMake command
error when configuring someone's else project usually means, that wrong source directory has been chosen.
In your case the correct source directory is the top-level directory in the repository, but you use its openage subdirectory. This is why you got the error.

Related

no package 'sigc++-2.0' found with cmake, vcpkg and pkg-config on windows 10

I am trying to build synfig project with cmake, vcpkg and pkg-config on windows 10 with below commands:
d:\gtkmm\vs>cmake -DCMAKE_TOOLCHAIN_FILE=C:\src\vcpkg\scripts\buildsystems\vcpkg.cmake ..\synfig\
and with errors:
-- Building for: Visual Studio 15 2017
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.16.27043.0
-- The CXX compiler identification is MSVC 19.16.27043.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_BUILD_TYPE: Debug
-- Found Git: C:/Program Files/Git/bin/git.exe (found version "2.27.0.windows.1")
CMake Deprecation Warning at ETL/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found Boost: C:/src/vcpkg/installed/x86-windows/include (found version "1.73.0") found components: system
-- Found ZLIB: optimized;C:/src/vcpkg/installed/x86-windows/lib/zlib.lib;debug;C:/src/vcpkg/installed/x86-windows/debug/lib/zlibd.lib (found version "1.2.11")
-- Found PkgConfig: C:/pkgconfig/pkg-config.exe (found version "0.26")
-- Checking for module 'sigc++-2.0'
-- No package 'sigc++-2.0' found
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.19/Modules/FindPkgConfig.cmake:553 (message):
A required package was not found
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.19/Modules/FindPkgConfig.cmake:741 (_pkg_check_modules_internal)
synfig-core/src/CMakeLists.txt:27 (pkg_check_modules)
-- Configuring incomplete, errors occurred!
See also "D:/gtkmm/vs/CMakeFiles/CMakeOutput.log".
See also "D:/gtkmm/vs/CMakeFiles/CMakeError.log".
My vcpkg is placed in c:\src\vcpkg
CMkake is installed in C:/Program Files (x86)/CMake/
and downloaded pkg-config files in C:\pkgconfig according to here
I think the pkg-config don't know the place the sigc++ installed with vcpkg, because when I check the libsigcpp with command:
vcpkg install libsigcpp
it tells:
Computing installation plan...
The following packages are already installed:
libsigcpp[core]:x86-windows
Package libsigcpp:x86-windows is already installed
Can anyone help, thank you in advance.

How to build Aseprite from source in ubuntu 20.04? CMake Warning: "No source or binary directory provided"

I was trying to build Aseprite from its source in Ubuntu 20.04 and got stuck while executing cmake.
I followed all the instructions provided in the install.md file.
This is the output I got after executing cmake :
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
The OLD behavior for policy CMP0046 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
CMake Error at /usr/share/cmake-3.16/Modules/CMakeCInformation.cmake:84 (include):
include could not find load file:
/home/shree/aseprite/build/laf/cmake/c_flag_overrides.cmake
Call Stack (most recent call first):
CMakeLists.txt:31 (project)
-- 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
CMake Error at /usr/share/cmake-3.16/Modules/CMakeCXXInformation.cmake:89 (include):
include could not find load file:
/home/shree/aseprite/build/laf/cmake/cxx_flag_overrides.cmake
Call Stack (most recent call first):
CMakeLists.txt:31 (project)
-- 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 CMakeLists.txt:41 (message):
Your Aseprite repository is incomplete, initialize submodules using:
git submodule update --init --recursive
-- Configuring incomplete, errors occurred!
See also "/home/shree/aseprite/build/CMakeFiles/CMakeOutput.log".
This error happens because the 'laf' folder is empty. You must download this project from Github and put the content inside that folder.
https://github.com/aseprite/laf/tree/8f91e164d1d23a3b0dc751bc0f9185af27dcb2c7

CMake can't find fortran even tho i have it installed

I've been trying to edit cura by ultimaker source code and trying to compile it using CMake but I can't seem to be able to do it even though I have fortran installed
(i use manjaro linux)
here is my CMake console output
The C compiler identification is GNU 10.1.0
The CXX compiler identification is GNU 10.1.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
Building for Linux
Prepare lib and lib64 on Linux...
ln: failed to create symbolic link 'lib64': Permission denied
CMake Error at /usr/share/cmake-3.17/Modules/CMakeDetermineFortranCompiler.cmake:33 (message):
Could not find compiler set in environment variable FC:
CMAKE_Fortran_COMPILER-NOTFOUND.
Call Stack (most recent call first):
projects/openblas.cmake:3 (enable_language)
CMakeLists.txt:58 (include)
Configuring incomplete, errors occurred!
See also "/home/alsoussi/Projects/NewPrinter/cura/source/cura-build-environment/build/CMakeFiles/CMakeOutput.log".
and here is my CMakeOutput.log file
(The log file is too large so here is a github page)

Why is this find_package failing in newer CMake versions?

I am experiencing a problem in a project, when upgrading from CMake 3.8 to 3.14. I have reduced this to the following issue. Note that project is before find_package (the other way around I do not have the issue I am describing).
cmake_minimum_required(VERSION 3.2.1)
find_package(MPI REQUIRED)
project(Test CXX)).
When I build with CMake 3.8, the output is as follows:
build3_8$ cmake ../source/
-- The CXX compiler identification is Intel 17.0.5.20170817
-- Check for working CXX compiler: (...)/linux/bin/intel64/icpc
-- Check for working CXX compiler: (...)/linux/bin/intel64/icpc -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: (...)/build3_8
With CMake 3.14 I get the following output:
build3_14$ cmake ../source/
CMake Error at (...)/CMake/3.14.0/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:211 (message):
No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()
Call Stack (most recent call first):
(...)/CMake/3.14.0/share/cmake-3.14/Modules/FindMPI.cmake:1672 (find_package_handle_standard_args)
CMakeLists.txt:3 (find_package)
-- Configuring incomplete, errors occurred!
I wonder why this is happening with the newer CMake version (although FindMPI.cmake is completely different)?
Also, what can I do to solve this? Do I need to write my own config?
(I cannot just change the order of project and find_package, because wrappers are created for the compilers (not my choice, please don't blame me))

How to use CMake

I am trying to rebuild this on my machine:
https://github.com/sfdodge/xnet
For this I needed to install xtensor and xtensor-blas. I followed the steps and successfully installed xtensor. However, I have trouble installing xtensor-blas. I create a fresh directory and run this command
cmake /home/fatima/Downloads/xtensor-blas-master
It generates the following log:
The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.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
-- xtensor-blas v0.14.0
CMake Error at CMakeLists.txt:45 (find_package):
By not providing "Findxtensor.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "xtensor", but
CMake did not find one.
Could not find a package configuration file provided by "xtensor" with any
of the following names:
xtensorConfig.cmake
xtensor-config.cmake
Add the installation prefix of "xtensor" to CMAKE_PREFIX_PATH or set
"xtensor_DIR" to a directory containing one of the above files. If
"xtensor" provides a separate development package or SDK, be sure it has
been installed.
-- Configuring incomplete, errors occurred!
See also "/home/fatima/Downloads/Untitled Folder 3/CMakeFiles/CMakeOutput.log".
What am I doing wrong?