这是我简单的CMakeLists.txt文件:
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)
Run Code Online (Sandbox Code Playgroud)
这给了我一个错误:
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)
Mic*_*yan 38
SET_TARGET_PROPERTIES的格式为:
SET_TARGET_PROPERTIES(
target1 target2 ... targetM
PROPERTIES
prop1 val1 prop2 val2 ... propN valN
)
Run Code Online (Sandbox Code Playgroud)
您的问题的原因是您的变量LIBUSBMUXD_VERSION和LIBUSBMUXD_SOVERSION未定义,因此您的命令的语法是:
SET_TARGET_PROPERTIES(target PROPERTIES name)
Run Code Online (Sandbox Code Playgroud)
代替:
SET_TARGET_PROPERTIES(target PROPERTIES name value)
Run Code Online (Sandbox Code Playgroud)
要解决这个问题,请尝试引用变量; 使用"$ {LIBUSBMUXD_SOVERSION}"应确保即使变量未定义,它也会采用空字符串的值,从而遵守语法.
| 归档时间: |
|
| 查看次数: |
17497 次 |
| 最近记录: |