Hi,

I've a problem converting one important feature of our old make-build-process 
to the new cmake-build-process.

The problem:
In our old build process, each object file was binary different from one build 
run to another.
This problem was caused by gcc using randomly generated symbol names.

The solution with make:
We use gcc's option "-frandom-seed=<value>", which uses a given value as a 
starting point for it's random number generator.
As every file shall have a unique random seed, we calculate the MD5 checksum of 
each source file "on the fly".
This checksum is then used as a value for the option "-frandom-seed".

Here's how the current compile rule in the old Makefile looks like:
  $(CC) -frandom-seed=$(shell md5sum $< | sed 's/\(.*\) .*/\1/') $(CCFLAGS) -c 
$< -o $@

I tried to do this in cmake, but I only have this command:
ADD_DEFINITIONS( 
  "-frandom-seed=$(shell md5sum $< | sed 's/\(.*\) .*/\1/')"
)

But how can I determine the current filename and replace "$<" by the filename?
How can this be made using cmake?

Best Regards,
Joerg
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to