可能重复:
处理器功能的 CMake 测试
我尝试使用 cmake execute_process 运行以下命令:
nm /home/cquiros/GOBLET/tools/3rdParty/shapelib/libshp.a | grep 'DBFReorderFields'
但我总是命令找不到。这是代码:
SET (CMD "nm")
SET (CMDA "${SHAPELIB_LIBRARY} | grep 'DBFReorderFields'")
execute_process(COMMAND ${CMD} ${CMDA} RESULT_VARIABLE rv)
${SHAPELIB_LIBRARY} = /home/cquiros/GOBLET/tools/3rdParty/shapelib/libshp.a 。结果应为空或“000000000000358d T DBFReorderFields”
知道如何使它工作吗?