r/cmake•
xdao

Is it able to change object name/localtion of a source file?

I am creating a script to add precompile feature. Instead of collecting all compile flags/options/include directories of the target, I set LANGUAGE property of the precompile header file to "CXX", and add the file to SOURCES of the target, so cmake will compile the header with correct compile options.

However, the output name is always 'preinclude.h.o' and cmake always link the output object, which will cause a link error since it isn't a object file.

Is it able to change the output name and tell cmake not to link the object?

Posted Jul 21, 2018, 10:03 AM UTC

13
Loading comments…