[CMake] CMAKE_CXX_COMPILE_OBJECT for compiler with no -o support

Trevor Kellaway tkellaway at asl-electronics.co.uk
Tue Feb 13 15:36:16 EST 2007


Hi,

I'm trying to modify CMAKE to use a cross platform compiler (TI DSP) and I'm using the "useecos.cmake" as a template.

By default CMAKE expects the built object to be a subdirectory of the form:

	try\CMakeFiles\Try.dir\

And <OBJECT> is setup to represent this (e.g. "try\CMakeFiles\Try.dir\my.obj")

Normally you'd just use the compiler's "-o" to redirect the object:

	SET (CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILER} <SOURCE> -o <OBJECT> <FLAGS>")

However, my compiler doesn't support the '-o' option, it only allows you to specify the output *directory*, not the filename.

So, what I want to do is take <OBJECT> and return just the PATH. How can I do this? I haven't found a way of embedding a MACRO invocation in the SET command line.

The alternative is if there was a variable available ("<OBJECT_DIR>" that had a pre-striped version of this), but I've seen another post that says this doesn't seem to exist.

As a workaround I've having to invoke a batch file and get this to muck around doing this (easy in a shell script, difficult under DOS cmd).

Any help appreciated.


More information about the CMake mailing list