Manyears 1.1.2源代码,编译cmake文件

时间:2016-11-16 16:58:06

标签: cmake

我想从Manyears 1.1.2源代码编译cmake文件,但我得到的错误如下:

WARNING : manyears GUI will not be compiled because Qt4 not found
-- Buiding ManyEarsLib Library...
CMake Error at dsplib/CMakeLists.txt:75 (set_target_properties):
  set_target_properties called with incorrect number of arguments.
-- Buiding RTAudio Library...
CMake Error at example/CMakeLists.txt:22 (set_target_properties):
  set_target_properties called with illegal arguments, maybe missing a
  PROPERTIES specifier?

原始程序编写如下:

target_link_libraries(ManyEarsLib )
set_target_properties(ManyEarsLib PROPERTIES LINK_FLAGS ${MANYEARS_LINK_FLAGS} OUTPUT_NAME man-years)

add_executable(manyears_console manyears_console.c)
set_target_properties(manyears_console PROPERTIES LINK_FLAGS ${MANYEARS_LINK_FLAGS})
target_link_libraries(manyears_console ManyEarsLib -lm)

有人可以告诉我问题是什么以及如何解决问题?

非常感谢。 纶

1 个答案:

答案 0 :(得分:0)

命令set_target_properties只能设置单值属性。

但您尝试设置属性 LINK_FLAGS ,通常是多值列表),但在您的情况下,它只是简单空。这就是为什么第一次调用检测到错误的参数数量(它应该是偶数),第二次调用检测到参数数量不足(至少应该是4)。

对于设置多值属性或清除它们,请使用命令set_property

# Multi-value (or empty) property
set_property(TARGET ManyEarsLib PROPERTY LINK_FLAGS ${MANYEARS_LINK_FLAGS})
# Single-value property
set_target_properties(ManyEarsLib PROPERTIES OUTPUT_NAME man-years)
# Multi-value (or empty) property again
set_property(TARGET manyears_console PROPERTY LINK_FLAGS ${MANYEARS_LINK_FLAGS})

甚至

# Multi-value (or empty) property for several targets
set_property(TARGET ManyEarsLib manyears_console PROPERTY LINK_FLAGS ${MANYEARS_LINK_FLAGS})
# Single-value property for single target
set_target_properties(ManyEarsLib PROPERTIES OUTPUT_NAME man-years)