[CMake] RE: ADD_TEST for debug/release configurations?

Jan Wurster Jan.Wurster at icido.de
Mon Nov 5 08:25:23 EST 2007


 Dear list, 

> -----Original Message-----
> From: Jan Wurster 
> Sent: Monday, October 22, 2007 10:29 AM
>
>  Is there any way at all for the vs8 generator to 
> enable/disable test cases in RUN_TESTS on the basis of the 
> selected configuration (debug/release)? Kind of like in 
> TARGET_LINK_LIBRARIES? 

 since nobody answered I guess there's no real way to do this. Pity :(

>  Furthermore, I was looking for a way to set the icon 
> resource in a cmake-built executable - does anybody have 
> hints on how to do this?

 When again looking into this this morning, I found a way to do this
that suits our needs and might perhaps be interesting to others.

 It is possible to create a .rc resource file (either from scratch or
using vs8), then set the desired icon resource to whatever you like
(surprisingly enough, even 32 bit alpha channel .ico's are ok - vs
wouldn't import those when using the resource editor). Relative paths
are possible and what I'll be using now.

 You can basically have just a very simple hacked up resource file that
only contains your icon (no language dependencies and such):

//----------------------------------------------------------------------
-----
#include "resource.h"

#ifdef _WIN32

//----------------------------------------------------------------------
-----
// Icon
IDI_ICON1               ICON                    "myLittleIcon.ico"

#endif    
//----------------------------------------------------------------------
-----

 Then just add your new resource file to the executable sources that
need an icon for the win32-platform like so:

 IF(WIN32)
	SET(SOMEBODIES_SRCS 
		${SOMEBODIES_SRCS }
		${SOME_LOCATION}/resources/myLittleIconResource.rc
	)
 ENDIF(WIN32)

 That's it ..

 Best regards,
-.jan.-


More information about the CMake mailing list