这里是我的简单的CMakeLists.txt文件:set_target_properties调用的参数数量不正确?
include_directories (${CMAKE_SOURCE_DIR}/common)
find_package(Threads)
add_library (libusbmuxd SHARED libusbmuxd.c sock_stuff.c ${CMAKE_SOURCE_DIR}/common/utils.c)
find_library (PTHREAD pthread)
target_link_libraries (libusbmuxd ${CMAKE_THREAD_LIBS_INIT})
# 'lib' is a UNIXism, the proper CMake target is usbmuxd
# But we can't use that due to the conflict with the usbmuxd daemon,
# so instead change the library output base name to usbmuxd here
set_target_properties(libusbmuxd PROPERTIES OUTPUT_NAME usbmuxd)
set_target_properties(libusbmuxd PROPERTIES VERSION ${LIBUSBMUXD_VERSION})
set_target_properties(libusbmuxd PROPERTIES SOVERSION ${LIBUSBMUXD_SOVERSION})
install(TARGETS libusbmuxd
ARCHIVE DESTINATION lib${LIB_SUFFIX}
LIBRARY DESTINATION lib${LIB_SUFFIX}
)
install(FILES usbmuxd.h usbmuxd-proto.h DESTINATION include)
这给了我一个错误:
CMake error at CMakeLists.txt:12 (set_target_properties):
set_target_properties called with incorrect number of arguments
CMake error at CMakeLists.txt:13 (set_target_properties):
这些是第二和第三set_target_properties。第一个set_target_properties从来没有这个问题?
set_target_properties called with incorrect number of arguments
(如果你还没有已经意识到,我正在试图建立usbmuxd-1.0.4)
最后一句话正是解决了我的问题。不幸的是,我只能提出一次答案。谢谢! – ollo 2013-03-06 21:38:50
我可以将一个列表作为值吗?立即,你会如何设置带有多个标志的LINKER_FLAG? – Royi 2018-02-21 00:29:30