# Object Libraries: PREFIX, OUTPUT\_NAME, SUFFIX are not working

**URL:** <https://discourse.cmake.org/t/object-libraries-prefix-output-name-suffix-are-not-working/13235>\
**Category:** Code\
**Created:** [December 19, 2024, 6:23pm UTC](https://discourse.cmake.org/t/object-libraries-prefix-output-name-suffix-are-not-working/13235 "2024-12-19T18:23:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![miroslavbel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@miroslavbel](https://discourse.cmake.org/u/miroslavbel)\
**Post date:** [December 19, 2024, 6:23pm UTC](https://discourse.cmake.org/t/object-libraries-prefix-output-name-suffix-are-not-working/13235/1 "2024-12-19T18:23:38Z")

</div>

I am trying to build custom crt0.o using CMake and produce a file named `crt0.o`. To achieve this, I have created an [object library](https://cmake.org/cmake/help/latest/command/add_library.html#object-libraries) target and overwritten `PREFIX`, `OUTPUT_NAME`, and `SUFFIX` target properties:

```auto
add_library(crt0 OBJECT src/crt0.S)
set_target_properties(crt0
  PROPERTIES
    PREFIX ""
    OUTPUT_NAME "crt0"
    SUFFIX ".o")

```

However CMake emits a file named `crt0.S.o` instead of the desired `crt0.o`.

So, the questions are:

1. How can I properly set the output name for an object library?
2. If (1) is not possible, is there a way to ask CMake to rename the output file using the [file](https://cmake.org/cmake/help/latest/command/file.html#rename) command and remember (for further operations like linking) that the renaming operation has been done?

Thanks in advance

P.S. I had to remove some links to the documentation due to the forum policy limiting new users to 2 links per post.
