码迷,mamicode.com
首页 > 其他好文 > 详细

process

时间:2020-12-23 11:53:16      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:overflow   proc   targe   err   https   参数   pre   flow   turn   

使用execute_process

参数必须要传,不用也要传空

set(getdep1 ${CMAKE_SOURCE_DIR}/clone.sh)

execute_process(
    COMMAND ${getdep1} ""
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/dep
    RESULT_VARIABLE result
    OUTPUT_VARIABLE output
)

if(result EQUAL 0)
    message(STATUS "task done")
else()
    message(STATUS "task Error! " "return code: " ${result})
endif()

set(MAKE_CMD "${CMAKE_CURRENT_SOURCE_DIR}/makeHeaders.sh")
MESSAGE("COMMAND: ${MAKE_CMD} ${CMAKE_CURRENT_SOURCE_DIR} ${INC_DIR}")
execute_process(COMMAND ${MAKE_CMD} ${CMAKE_CURRENT_SOURCE_DIR} ${INC_DIR}
   RESULT_VARIABLE CMD_ERROR
      OUTPUT_FILE CMD_OUTPUT)
  MESSAGE( STATUS "CMD_ERROR:" ${CMD_ERROR})
  MESSAGE( STATUS "CMD_OUTPUT:" ${CMD_OUTPUT})

https://stackoverflow.com/questions/43684051/cmake-execute-process-command

process

标签:overflow   proc   targe   err   https   参数   pre   flow   turn   

原文地址:https://www.cnblogs.com/Searchor/p/14154019.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!