[CMake] debug & optimized

Martin Groher groher at in.tum.de
Fri Mar 11 04:39:18 EST 2005


Hi,

I’ve created a library with CMake called 'viewers'. Now, I want to link
against this lib in another CMake project, but, on WIN32, I want to use the
debug lib in DEBUG mode and the optimized lib in RELEASE mode. 

Lib viewers: Since I don't know the path in advance where to find the libs
(and I don't want to add the path to the PATH-variable), I would like to
copy the created libs to a dedicated directory (viewers/lib). Now, in WIN32,
I would like to have two libs there, viewers.lib and viewersD.lib. Then I
could just used the optimized/debug keywords in the other project to link
against these libs. 

I tried to create a post-build command to copy the created viewer libs to
the viewers/lib directory, but here, I cannot tell which lib I'm copying,
debug or optimized. Since the debug/release libs have the same name, I don't
know how to do that since the keywords debug/optimized just hold for the
LINK_LIBRARIES and TARGET_LINK_LIBRARIES commands. 
Is there some way to create different custom commands for debug/optimized
mode? Or any other way to somehow tell CMake how to distinguish created libs
within the same project?

Best,
Martin

---------------------------------------------------------------
Martin Groher
Chair for Computer Aided Medical Procedures (CAMP)
Lehrstuhl für Informatikanwendungen in der Medizin
Institut für Informatik I16
TU München
fon: +49 89 289-17071
mail: groher at in.tum.de




More information about the CMake mailing list