[CMake] target name tweak

Magnus Therning magnus at therning.org
Sun Aug 15 17:19:39 EDT 2010


On 15/08/10 22:11, SK wrote:
> When using the D language compiler 'dmd' on windows, I'm stuck with a
> linker that gets confused with object file names like foo.c.obj.  The
> linker can only handle a single dot in the object file name, as in
> foo.o
> 
> How can I set target names to just be the base name without the source
> extension?  I need to do this in the language support module, e.g.
> Modules\Platform\Windows-dmd.cmake, so that users don't need to hack
> this in their own CMakeLists.txt files.

Instead of adding '.obj' to the full filename, first extract the
filename-extension (see get_filename_component()) and then add '.o' to that.

/M

-- 
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org           Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100815/34e3d62a/attachment.pgp>


More information about the CMake mailing list