一、介绍
命令的格式如下
set_target_properties(target1 target2 ...
PROPERTIES prop1 value1
prop2 value2 ...)
Sets properties on targets. The syntax for the command is to list all the targets 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_property() or get_target_property() command.
意思就是:
这个命令是设置目标的属性,该命令的语法是列出想要更改的所有目标,然后提供接下来想要设置的值。您可以使用该命令任何所需的键值对,然后使用get_property()或get_target_property()命令提取它。
二、使用
有如下例子
1、建立一个静态库和动态库,提供HelloFunc函数供其他程序编程使用,HelloFunc
向终端输出Hello World字符串。
2、安装头文件与共享库。
3、编写一个程序,来使用创建的共享库(静态库和动态库)。
首先,新建一个目录,创建MakeList.txt
/home/code/test/build
PROJECT(HELLOLIB)
# 通过在主工程文件CMakeLi