[CMake] cmake -E env equivalent in 2.8

zer0 0ne zer0__0ne at outlook.com
Sat May 26 19:09:51 EDT 2018


Hi,

I am new to cmake and i am working with CMakefile with -E env option written for 3.1 and I am backporting it to 2.8. What is the compatible or equivalent option in 2.8?

https://github.com/CZ-NIC/turris-os/blob/master/package/system/ubus/patches/001-python.patch

The line I am dealing with is
+ADD_CUSTOM_TARGET(python ALL
+ COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}" "LDSHARED=${LDSHARED}" "CFLAGS=${PYTHON_CFLAGS}" ${PYTHON} ${SETUP_PY} build
+ DEPENDS ubus "${CURRENT_SOURCE_DIR}/ubus_python.c"
+)
+
+INSTALL(
+ CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E env \"CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}\" \"LDSHARED=${LDSHARED}\" \"CFLAGS=${PYTHON_CFLAGS}\" ${PYTHON} ${SETUP_PY} install --prefix=${CMAKE_INSTALL_PREFIX})"
+)

Thanks
Zer0 0ne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180526/b2497e12/attachment.html>


More information about the CMake mailing list