[Beignet] [PATCH] build: use EXECUTE_PROCESS to replace the deprecated EXEC_PROGRAM.
Zhigang Gong
zhigang.gong at intel.com
Mon May 18 22:46:01 PDT 2015
I found EXEC_PROMGRAM may truncate the output variable for some case
thus we may get incorrect generated unit test cases thus break the
configuration some times.
This patch use EXECUTE_PROCESS to replace all the deprecated EXEC_PROGRAM
and it will not truncate the output variable of the command.
Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
examples/CMakeLists.txt | 8 ++++----
utests/CMakeLists.txt | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 904f259..3dc5e24 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,8 +1,8 @@
-EXEC_PROGRAM(ls ARGS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libva" OUTPUT_VARIABLE LS_OUTPUT)
+EXECUTE_PROCESS(COMMAND ls "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libva" OUTPUT_VARIABLE LS_OUTPUT)
IF(NOT LS_OUTPUT)
-EXEC_PROGRAM(git "${CMAKE_CURRENT_SOURCE_DIR}/.." ARGS "submodule init")
-EXEC_PROGRAM(git "${CMAKE_CURRENT_SOURCE_DIR}/.." ARGS "submodule update")
-EXEC_PROGRAM(git "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libva" ARGS "checkout master")
+EXECUTE_PROCESS(COMMAND git "${CMAKE_CURRENT_SOURCE_DIR}/.." "submodule init"
+ COMMAND git "${CMAKE_CURRENT_SOURCE_DIR}/.." "submodule update"
+ COMMAND git "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libva" "checkout master")
ENDIF(NOT LS_OUTPUT)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt
index d5bf14a..19e92c4 100644
--- a/utests/CMakeLists.txt
+++ b/utests/CMakeLists.txt
@@ -2,8 +2,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../include)
##### Math Function Part:
-EXEC_PROGRAM(mkdir ${CMAKE_CURRENT_SOURCE_DIR} ARGS generated -p)
-EXEC_PROGRAM(${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} ARGS utest_math_gen.py OUTPUT_VARIABLE GEN_MATH_STRING)
+EXECUTE_PROCESS(COMMAND mkdir generated -p WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} utest_math_gen.py WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GEN_MATH_STRING)
string(REGEX REPLACE " " ";" ADDMATHFUNC ${GEN_MATH_STRING})
string(REGEX REPLACE "generated/([^\ ]*)\\.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/../kernels/\\1.cl" KERNEL_MATH_LIST ${GEN_MATH_STRING})
--
1.9.1
More information about the Beignet
mailing list