zsunflowerwq 2019-04-28 19:46 采纳率: 0%
浏览 1094

CMake Error at CMakeLists.txt:97 (ADD_TARGET_DEFINITIONS): Unknown CMake command "ADD_TARGET_DEFIN

cmake version 3.14.3
这个问题怎么解决啊

– The C compiler identification is GNU 7.3.0
– The CXX compiler identification is GNU 7.3.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
CMake Error at CMakeLists.txt:97 (ADD_TARGET_DEFINITIONS):
Unknown CMake command “ADD_TARGET_DEFINITIONS”.

– Configuring incomplete, errors occurred! See also “/home/wang/code/epoch-4.12.8/SDF/VisIt/CMakeFiles/CMakeOutput.log”.
make[1]: Entering directory ‘/home/wang/code/epoch-4.12.8/SDF/VisIt’
make[1]: *** No targets specified and no makefile found. Stop.
make[1]: Leaving directory ‘/home/wang/code/epoch-4.12.8/SDF/VisIt’
ERROR: Failed to build VisIt reader. Makefile:384: recipe for target
‘visit’ failed make: *** [visit] Error 1
--------------------- 
作者:zsunflowerwq 
来源:CSDN 
原文:https://blog.csdn.net/zsunflowerwq/article/details/89644390 
版权声明:本文为博主原创文章,转载请附上博文链接!
  • 写回答

1条回答 默认 最新

  • 你知我知皆知 2024-08-09 05:20
    关注

    以下回答参考 皆我百晓生券券喵儿 等免费微信小程序相关内容作答,并由本人整理回复。

    这个问题是由于在添加目标定义时使用了不正确的命令导致的。ADD_TARGET_DEFINITIONS 命令是在 CMake 中用于指定目标文件中使用的宏和符号的。它应该以一个包含宏名及其值的字符串列表的形式来配置。

    在这个例子中,你尝试使用 ADD_TARGET_DEFINITIONS 命令来指定宏 ADD_TARGET_DEFINITIONS 的名称和值,但这个命令并不支持宏定义。你需要使用另一种方式来指定这些宏和符号。

    如果你的目标是将宏 ADD_TARGET_DEFINITIONS 添加到目标文件中,你可以这样做:

    add_definitions(-DADD_TARGET_DEFINITIONS)
    

    这将告诉编译器在构建过程中使用宏 ADD_TARGET_DEFINITIONS。然后,在生成目标文件时,CMake 将会将这些宏替换为你提供的值。

    如果这是你的最终目标,请确保你的 CMakeLists.txt 文件正确地设置了 -DADD_TARGET_DEFINITIONS 宏,并且你已经正确地指定了要定义的宏和其对应的值。

    评论

报告相同问题?