# How to prevent CMake from creating a symlink for shared libraries ?

**URL:** <https://discourse.cmake.org/t/how-to-prevent-cmake-from-creating-a-symlink-for-shared-libraries/5316>\
**Category:** Code\
**Tags:** os:linux\
**Created:** [March 29, 2022, 1:28pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-from-creating-a-symlink-for-shared-libraries/5316 "2022-03-29T13:28:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pol2095](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pol2095](https://discourse.cmake.org/u/pol2095)\
**Post date:** [March 29, 2022, 1:28pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-from-creating-a-symlink-for-shared-libraries/5316/1 "2022-03-29T13:28:04Z")

</div>

Hello,

I make [Tesseract-ocr](https://github.com/tesseract-ocr/tesseract/blob/main/CMakeLists.txt), I obtain on Ubuntu a simlink libtesseract.so and a file libtesseract.so.5.1.0, is-it possible to prevent versioning and obtain only a file libtesseract.so ?  
I tried to add in “CMakeLists.txt” line 869 `NAMELINK_SKIP` but it has no effect.

Thanks

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [March 29, 2022, 1:45pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-from-creating-a-symlink-for-shared-libraries/5316/2 "2022-03-29T13:45:34Z")

</div>

`NAMELINK_SKIP` is only relevant for installation (basically to separate them into different components). Why do you care about the symlink?

---

<div class="post-metadata">

**Author:** ![pol2095](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pol2095](https://discourse.cmake.org/u/pol2095)\
**Post date:** [March 29, 2022, 1:55pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-from-creating-a-symlink-for-shared-libraries/5316/3 "2022-03-29T13:55:16Z")

</div>

I can’t use simlink, simlink is not supported on all platforms.  
When I rename libtesseract.so.5.1.0 to lintesseract.so, it doesn’t work.  
For working I need to rename libtesseract.so.5.1.0 to lintesseract.so and add too libtesseract.5.1.0, I have a duplicate file in my app.

---

<div class="post-metadata">

**Author:** ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)\
**Post date:** [March 29, 2022, 3:22pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-from-creating-a-symlink-for-shared-libraries/5316/4 "2022-03-29T15:22:25Z")

</div>

Don’t specify a version: i.e. ensure properties [VERSION](https://cmake.org/cmake/help/latest/prop_tgt/VERSION.html#prop_tgt:VERSION) and [SOVERSION](https://cmake.org/cmake/help/latest/prop_tgt/SOVERSION.html#prop_tgt:SOVERSION) are not defined for the target producing the library `libtesseract.so`

---

<div class="post-metadata">

**Author:** ![pol2095](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pol2095](https://discourse.cmake.org/u/pol2095)\
**Post date:** [March 29, 2022, 7:47pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-from-creating-a-symlink-for-shared-libraries/5316/5 "2022-03-29T19:47:13Z")

</div>

Thanks
