Search code examples
cmakemingwgnu

what OUTPUT_NAME is use for in cmake


code from CMakeFiles.txt what's the reason of setting the propetties of OUTPUT_NAME

SET_TARGET_PROPERTIES(hello_static PROPERTIES OUTPUT_NAME "hello")


Solution

  • That controls the name of the actual file that's generated, independent from the target's name.

    In this case, the file will be named hello.a or hello.lib instead of hello_static.a or hello_static.lib

    See the documentation for the property: https://cmake.org/cmake/help/latest/prop_tgt/OUTPUT_NAME.html