# Modules have different types of libraries in different configurations.

**URL:** https://discourse.cmake.org/t/modules-have-different-types-of-libraries-in-different-configurations/9940
**Category:** Code
**Tags:** os:windows, gen:vs
**Created:** [January 26, 2024, 2:02am UTC](https://discourse.cmake.org/t/modules-have-different-types-of-libraries-in-different-configurations/9940 "2024-01-26T02:02:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aidexie](https://discourse.cmake.org/user_avatar/discourse.cmake.org/aidexie/32/3439_2.png) [@aidexie](https://discourse.cmake.org/u/aidexie)
#### Post date: [January 26, 2024, 2:02am UTC](https://discourse.cmake.org/t/modules-have-different-types-of-libraries-in-different-configurations/9940/1 "2024-01-26T02:02:48Z")

</div>

I have a vs project that was generated using cmake, now I have a requirement that some modules have different types of libraries under different configs. For example, we have 4 types of config:Debug,Release,DebugEditor,ReleaseEditor.Some modules need to be static libraries under Debug,Release and dynamic libraries under DebugEditor,ReleaseEditor.  
I found this setup in CMake:  
add\_library(module\_name SHARED “”)  
set\_target\_properties(module\_name PROPERTIES VS\_CONFIGURATION\_TYPE $\<IF:$\<OR:$CONFIG:Debug,$CONFIG:Release,StaticLibrary, DynamicLibrary\>)  
After using this function, it can fulfill my requirement, but I found a bug, the suffix name of the static library generated under Debug and Release is module.dll, I tried some methods to change this suffix name to module.lib, but all of them failed.  
Does anyone know how to do it?

---

<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: [January 26, 2024, 2:15pm UTC](https://discourse.cmake.org/t/modules-have-different-types-of-libraries-in-different-configurations/9940/2 "2024-01-26T14:15:52Z")

</div>

CMake does not support per-config target types. A target is always a single type (shared, static, executable, etc.).
