我有以下构建结构:
/blah/3rdparty/yang
/blah/3rdparty/Makefile
/blah/3rdparty/toolchain.cmake
/blah/3rdparty/yang/libyang-0.14.78
我有这个模型Makefile
,我试图调用底层的cmake
all: prep
prep:
cd libyang-0.14.78 ; \
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake \
-DENABLE_BUILD_TESTS=OFF \
-DENABLE_VALGRIND_TESTS=OFF \
-DPCRE_LIBRARY=/blah/lib/lipcre.so \
-DPCRE_INCLUDE_DIR=/blah/include \
-DCMAKE_BUILD_TYPE:String="Release"
但无论我做什么,cmake
都不会选择我toolchain.cmake
中的设置。
toolchain.cmake
:
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR arm)
SET(CMAKE_C_COMPILER arm-openwrt-linux-gcc)
SET(CMAKE_CXX_COMPILER arm-openwrt-linux-gcc)
SET(host arm-linux)
SET(SYSROOT /blah/tools/armv7-openwrt-linux-gnu-uClibc-0.9.33.2)
SET(CMAKE_SYSROOT ${SYSROOT})
SET(CMAKE_FIND_ROOT_PATH ${SYSROOT})
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
当我去检查它正在使用哪些可执行文件时,我看到的只是主机可执行文件,而不是我的工具链......这就是当我使用-LAH
选项时cmake打印出来的...
// Path to a program.
CMAKE_AR:FILEPATH=/usr/bin/ar
// C compiler.
CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc
// Path to a program.
CMAKE_LINKER:FILEPATH=/usr/bin/ld
CMake版本为2.8.12.2
,我无法升级版本。
问题:
cmake
调用Makefile
的正确方法是什么?prep
?似乎CMAKE_TOOLCHAIN_FILE
或其他设置从未结转。toolchain.cmake
是否正确?答案 0 :(得分:0)
我最终放弃使用CMAKE_TOOLCHAIN_FILE
,事实证明你可以将所有内容直接传递给它。以下结果适用于我Makefile
调用cmake
:
configure:
cd libyang-0.14.78; \
rm -rf build; mkdir -p build; cd build; \
cmake \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=arm \
-DCMAKE_C_COMPILER=arm-openwrt-linux-gcc \
-DCMAKE_INSTALL_PREFIX:PATH=$(MY_TOOLCHAIN) \
-DCMAKE_FIND_ROOT_PATH=$(MY_TOOLCHAIN) \
-DPCRE_LIBRARY=$(MY_TOOLCHAIN)/lib/libpcre.so \
-DPCRE_INCLUDE_DIR=$(MY_TOOLCHAIN)/include \
-DENABLE_BUILD_TESTS=OFF \
-DENABLE_VALGRIND_TESTS=OFF \
-DCMAKE_BUILD_TYPE:String="Release" .. > config.log;
我不确定cmake
2.8.12是否支持CMAKE_TOOLCHAIN_FILE
或不支持 aporte_apv <- c("Fondo", "Serie", "Cantidad.de.Aportes")
aporte_ffmm <- c("Rut.Cliente", "Cuenta", "Fecha")
colnames(base) <- ifelse(tolower(transaccion)=="apv", aporte_apv,
ifelse(tolower(transaccion)=="ffmm", aporte_ffmm, stop("not valid inputs")))
,但由于它有效,我不再关心。 :P