I wish to set a cmake variable to a certain value for debug configuration, and to another value for release. This works well with CMAKE_BUILD_TYPE conditional and single configuration projects, but I don't know how to do it in a multi configuration one, e.g. Visual Studio. Any ideas?
Asked
Active
Viewed 527 times
2
-
This depends a lot on what you want to achieve with this variable. Can you be more specific? – oLen Jan 15 '17 at 13:10
-
This variable will hold the location of a dependency which is different for both configurations. – krojew Jan 15 '17 at 13:51
-
So in principle a library that you are going to link against? – oLen Jan 15 '17 at 13:54
-
Yes, exactly - the library resides in a well defined location for every configuration. – krojew Jan 15 '17 at 13:59
-
Ok. I saw you ansered it, your solution is what I would have suggested. – oLen Jan 15 '17 at 15:38
1 Answers
0
I found you can get away with using both debug and release versions in a single variable:
set(VARIABLE debug debug.lib optimized release.lib)

krojew
- 1,297
- 15
- 38