且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在CMake中重命名库文件名?

更新时间:2022-01-26 07:55:24

您可以更改前缀,输出名称和后缀,使用 set_target_properties()函数和 PREFIX / OUTPUT_NAME / SUFFIX 属性的方式如下:

You can change the Prefix, Output Name and Suffix using the set_target_properties() function and the PREFIX / OUTPUT_NAME / SUFFIX property in the following way:

前缀:

    set_target_properties(new_thing PROPERTIES PREFIX "")

输出名称:

    set_target_properties(new_thing PROPERTIES OUTPUT_NAME "better_name")

后缀:

    set_target_properties(new_thing PROPERTIES SUFFIX ".so.1")