gpt4 book ai didi

Cmake 提示参数数量错误

转载 作者:行者123 更新时间:2023-12-04 22:25:53 27 4
gpt4 key购买 nike

SET_TARGET_PROPERTIES(
wtdbo
PROPERTIES
VERSION ${VERSION_SERIES}.${VERSION_MAJOR}.${VERSION_MINOR}
SOVERSION ${WTDBO_SOVERSION}
DEBUG_POSTFIX "d"
)

错误是:

CMake Error at src/Wt/Dbo/CMakeLists.txt:18 (SET_TARGET_PROPERTIES): set_target_properties called with incorrect number of arguments



如果我删除它,它配置就好了。
知道为什么吗?

谢谢,
欧玛

最佳答案

您确定变量设置正确吗?我已经检查过这个 CMakeLists.txt 文件,它工作正常:

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(test CXX)
ADD_LIBRARY(wtdbo SHARED test.cc)
SET(WTDBO_SOVERSION 1)
SET(VERSION_SERIES 1)
SET(VERSION_MAJOR 0)
SET(VERSION_MINOR 0)

SET_TARGET_PROPERTIES(
wtdbo
PROPERTIES
VERSION ${VERSION_SERIES}.${VERSION_MAJOR}.${VERSION_MINOR}
SOVERSION ${WTDBO_SOVERSION}
DEBUG_POSTFIX "d"
)

但是,如果我注释掉 SET(WTDBO_SOVERSION 1) 行,我会收到与您相同的错误消息。 set_target_properties 的帮助如下,所以你肯定做对了:

Targets can have properties that affect how they are built.

set_target_properties(target1 target2 ...
PROPERTIES prop1 value1
prop2 value2 ...)

Set properties on a target. The syntax for the command is to list all the files you want to change, and then provide the values you want to set next. You can use any prop value pair you want and extract it later with the GET_TARGET_PROPERTY command.

关于Cmake 提示参数数量错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1933552/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com