尝试注释" cmake_policy(SET CMP0022"在一个cmake文件中,使用来自另一个cmake文件的#seed。尝试转义(和空格,但我不是以某种方式做对了。什么'是正确的语法?
set(PATCH_CMP0022 "s/cmake_policy\\(SET\\ CMP0022/#cmake_policy(SET\\ CMP0022/")
sed ${PATCH_CMP0022} ${PATCH_FILE} -i
如果重要,请点击我的整个cmake代码块...
if(NOT EXISTS ${NAME}-patch)
message("--- Patching ${NAME} ---")
set(PATCH_CMP0022 "s/cmake_policy\\(SET\\ CMP0022/#cmake_policy(SET\\ CMP0022/")
message(${PATCH_CMP0022})
set(PATCH_SOURCE_DIR "s/CMAKE_SOURCE_DIR/CMAKE_CURRENT_SOURCE_DIR/")
set(PATCH_FILE "${NAME}-src/CMakeLists.txt")
execute_process(
COMMAND sed ${PATCH_CMP0022} ${PATCH_FILE} -i
COMMAND sed ${PATCH_SOURCE_DIR} ${PATCH_FILE} -i
COMMAND touch ${NAME}-patch
WORKING_DIRECTORY ${PATH_LIB})
endif()
答案 0 :(得分:0)
如果您的数据位于“ d”文件中,请尝试最多检查3()对,
sed -E 's/.*\([^\)]+[^\)]*$|.*(\(.*){2}\)[^\)]*$|.*(\(.*){3}\)\)[^\)]*$/#&/'