在我的 CMakeLIsts.txt 文件中,我这样写:
set(LIBHELLO_SRC hello.c)
set_target_properties(hello_static PROPERTIES OUTPUT_NAME "hello")
get_target_property(OUTPUT_VALUE hello_static OUTPUT_NAME)
message(STATUS "This is the hello_static OUTPUT_NAME:"${OUTPUT_VALUE})
当我运行时cmake
,它显示错误消息:
set_target_properties Can not find target to add properties to: hello_static