Я пытаюсь собрать tinyxml2, используя ExternalProject_Add
. Он отлично работает в моей основной системе (Arch Linux), но у меня есть некоторые проблемы при запуске в док-кроссе (точнее, dockcross/linux-armv6
).
Следующий минимальный файл CMakeLists.txt работает (настраивается и собирается) из Dockcross:
cmake_minimum_required(VERSION 3.1)
project(external-tinyxml2)
include(ExternalProject)
ExternalProject_add(
tinyxml2
URL https://github.com/leethomason/tinyxml2/archive/7.0.1.tar.gz
PREFIX tinyxml2
)
Но следующее не (обратите внимание на добавленную строку: CONFIGURE_COMMAND ${CMAKE_COMMAND} -S<SOURCE_DIR>
):
cmake_minimum_required(VERSION 3.1)
project(external-tinyxml2)
include(ExternalProject)
ExternalProject_add(
tinyxml2
URL https://github.com/leethomason/tinyxml2/archive/7.0.1.tar.gz
PREFIX tinyxml2
CONFIGURE_COMMAND ${CMAKE_COMMAND} -S<SOURCE_DIR>
)
Фактически это приводит к следующей ошибке:
[ 25%] No patch step for 'tinyxml2'
[ 37%] No update step for 'tinyxml2'
[ 50%] Performing configure step for 'tinyxml2'
CMake Deprecation Warning at CMakeLists.txt:11 (cmake_policy):
The OLD behavior for policy CMP0063 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.
CMake Error at /usr/share/cmake-3.13/Modules/CMakeDetermineCompilerId.cmake:161 (file):
file problem creating directory: /CMakeFiles/3.13.2/CompilerIdC
Call Stack (most recent call first):
/usr/share/cmake-3.13/Modules/CMakeDetermineCompilerId.cmake:31 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
/usr/share/cmake-3.13/Modules/CMakeDetermineCCompiler.cmake:112 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:14 (project)
[... other similar errors ...]
CMake Error at /usr/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:37 (try_compile):
Failed to set working directory to /CMakeFiles/CMakeTmp/testCCompiler.c :
No such file or directory
Call Stack (most recent call first):
CMakeLists.txt:14 (project)
-- Configuring incomplete, errors occurred!
CMake Error: Cannot open file for write: /CMakeCache.txt.tmp
CMake Error: : System Error: Permission denied
CMake Error: Unable to open cache file for save. /CMakeCache.txt
CMake Error: : System Error: Permission denied
CMakeFiles/tinyxml2.dir/build.make:108: recipe for target 'tinyxml2/src/tinyxml2-stamp/tinyxml2-configure' failed
make[2]: *** [tinyxml2/src/tinyxml2-stamp/tinyxml2-configure] Error 1
make[2]: Leaving directory '/work/build'
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/tinyxml2.dir/all' failed
make[1]: *** [CMakeFiles/tinyxml2.dir/all] Error 2
make[1]: Leaving directory '/work/build'
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
make: Leaving directory '/work/build
Сборка tinyxml2 напрямую из Dockcross (т.е. без использования ExternalProject_Add
) работает хорошо.
Что может быть не так?