[CMake] Generated .rc files silently ignored

Mueller-Roemer, Johannes Sebastian Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de
Thu Sep 24 05:47:11 EDT 2015


Hej hej,

for some reason your mail was not delivered to me and I only stumbled upon it by chance in the archives (while trying to find out where another one of my mails to the list disappeared to).

In any case, yes, I am adding the .rc file to my add_library command. The issue I have is that if I use mylib.rc in add_library and have an add_custom_command(OUTPUT mylib.rc ...) nothing is created but no error message is produced either (i.e. silently ignored). I have to use ${CMAKE_CURRENT_BINARY_DIR}/mylib.rc explicitly. For most files (such as generated .cpp files) using a relative path just works, because relative paths used in add_custom_command are interpreted relative to ${CMAKE_CURRENT_BINARY_DIR}.

Original text:

Hej,

Some more information about how you setup things would be useful. For instance: you would need to add the filename of the generated .rc file to the executable/library for which it is generated: are you doing that?

In the application I currently work on, we have created a small function to wrap the generation of the .rc file. I just checked that we actually also build a full path. That actually makes sense, because the generated file is put in the ${CMAKE_CURRENT_BINARY_DIR} and *not* in the current source dir. In other words: we could never accomplish this with any type of 'relative' path anyway. Are you maybe also mixing up the *SOURCE_DIR and *BINARY_DIR?

Sincerely,
Jakob

--
Johannes S. Mueller-Roemer, MSc
Wiss. Mitarbeiter - Interactive Engineering Technologies (IET)

Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany
Tel +49 6151 155-606  |  Fax +49 6151 155-139
johannes.mueller-roemer at igd.fraunhofer.de  |  www.igd.fraunhofer.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150924/df037384/attachment-0001.html>


More information about the CMake mailing list