[CMake] Project with .NET Formular (Header with resx)

Simon Adler cmake at cg-effects.de
Sat Jul 2 07:01:02 EDT 2011


Hello Mailing List

i am quite new to CMake. I have a project i originally build with
visual studio 2008.
I try to create a cmake Projekt so i can use cmake in the future.
I am using .NET Forms which are Headers with associated resx files. In
Visual-Studio the only
difference between Headers and Forms are that the FileType differs (In
the propierties)

How can I change this for a header via cmake?

# find header in current folder
file (GLOB  fhead "*.h")
foreach ( filename ${fhead} )
	GET_FILENAME_COMPONENT( filepath ${filename} PATH )
	GET_FILENAME_COMPONENT( filebase ${filename} NAME_WE )
	SET(Source "${filepath}/${filebase}.cpp")
	SET(Res    "${filepath}/${filebase}.resx")
	if (EXISTS ${Res}) # a resx exists, so it IS a form
		SET(FormHeader ${FormHeader} ${filename})
	        if (EXISTS ${Source}) # there is an additional implementation file
		     SET(FormSource ${FormSource} ${Source})
	        endif (EXISTS ${Source})
	endif (EXISTS ${Res})
endforeach ( filename )

With this code i got the forms how i expect it, but every header is
just a Header and not
konwn as formular to visual studio

Hope some may give me a hint.

Thank you very much

Simon


More information about the CMake mailing list