我正在建立开放空间,这是AoE2精灵引擎的克隆。我的cmake命令没有被处理。在这里不能使用“ add_py_modules”吗?
这是使用vcpkg的Windows 10。使用的命令:
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)
输出:
-- 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>
答案 0 :(得分:0)
获取
Unknown CMake command
配置其他人项目时出现错误通常意味着选择了错误的源目录。
在您的情况下,正确的源目录是存储库中的顶级目录,但是您使用其openage
子目录。这就是您得到错误的原因。