Đây là đơn giản tập tin CMakeLists.txt tôi:set_target_properties được gọi với số lượng đối số không chính xác?
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)
này mang lại cho tôi một lỗi:
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):
Đó là những set_target_properties thứ hai và thứ ba. Các set_target_properties đầu tiên không bao giờ có vấn đề đó?
set_target_properties called with incorrect number of arguments
(Nếu bạn chưa nhận ra đã có, tôi đang cố gắng để xây dựng usbmuxd-1.0.4)
Câu cuối cùng là chính xác những gì đã giải quyết được vấn đề của tôi. tiếc là tôi có thể upvote câu trả lời của bạn chỉ một lần. Cảm ơn! – ollo
Tôi có thể đặt một danh sách dưới dạng giá trị không? Tức thì, bạn sẽ đặt 'LINKER_FLAG' bằng nhiều cờ như thế nào? – Royi