2016-11-16 93 views
0

我想從編譯1.1.2 Manyears來源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) 

有人能告訴我什麼是問題以及如何解決它?

非常感謝。 Lun

回答

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)