[Cmake] multiple compile of an object

Ken Weinert Ken . Weinert at ihs . com
Fri, 16 May 2003 09:47:17 -0600


--oC1+HKm2/end4ao3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

OK, I thought I had this one solved, but it turns out that it isn't
quite right.

My situation is this:=20

	I frequently write a little test program into my class
definitions. That is, at the end of the file where all the methods
have been defined you'll find something like this:=20

	#if defined(<CLASSNAME>_MAIN_NEEDED)
	int main()
	{
		// test code goes here
	}
	#endif

	And then I'll compile a small standalone test program and also
compile the .o to be included in the main program.

	Is there a way to automate this in CMake? If so, a pointer to
where it might be documented (or an idea of how to do it) would be
appreciated.=20

	Thank you.

--=20
/~\ The ASCII        Ken Weinert   Ken . Weinert at ihs . com=20
\ / Ribbon Campaign  303-858-6956 (V) 303-705-4258 (F)
 X  Against HTML     GnuPG: 9274F1CE  GnuPG available at http://www . gnupg . o=
rg/
/ \ Email!           1D87 3720 BB77 4489 A928  79D6 F8EC DD76 9274 F1CE
Giving up on assembly language was the apple in our Garden of Eden:
Languages whose use squanders machine cycles are sinful. The LISP
machine now permits LISP programmers to abandon bra and fig-leaf. --
Alan J. Perlis


--oC1+HKm2/end4ao3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+xQgF+OzddpJ08c4RArF+AJ49vtVRQokI3jJtCznQmVfrj6D12gCgggdl
JudOlHF4YkoXUURY9moii6o=
=6359
-----END PGP SIGNATURE-----

--oC1+HKm2/end4ao3--