I&#39;ll take a look at the code you sent in your original post and try to see exactly why it&#39;s not working. I might not get to it until the end of the day, though.<br><br>If it worked in VS2008, but not now in VS2010, then we&#39;re clearly doing something different in the generators. I&#39;ll find out if it&#39;s an important something or not and get back to you.<br>
<br><br>Thanks,<br>David<br><br><br><div class="gmail_quote">On Fri, Jan 21, 2011 at 11:49 AM,  <span dir="ltr">&lt;<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Ah, I new that would come up. Yeah, they could be renamed. There are only<br>
a dozen or so of them.<br>
<br>
I was just trying to migrate the build system to VS2010 in between<br>
projects here at work, and this is the only thing holding me back from a<br>
smooth transition. Changing the extension is certainly an option, but it<br>
wasn&#39;t my first. Sense this is working good in VS2008, I was hoping it was<br>
just a simple bug, or maybe something I was doing wrong with the<br>
ADD_CUSTOM_COMMAND.<br>
<br>
Do you think this is the way its supposed to work with VS2010? Should I<br>
make the extension change or work with CMake more?<br>
<div class="im"><br>
---<br>
Aaron Wright<br>
<br>
<br>
<br>
<br>
From:<br>
David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;<br>
To:<br>
<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a><br>
Cc:<br>
&quot;<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>&quot; &lt;<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>&gt;<br>
Date:<br>
</div>01/21/2011 08:36 AM<br>
<div class="im">Subject:<br>
Re: [CMake] VS2010 tries to compile a file with *.res extension when its<br>
copied<br>
</div><div><div></div><div class="h5">Sent by:<br>
<a href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a><br>
<br>
<br>
<br>
I don&#39;t think it&#39;s stupid. No judgment here. :-)<br>
<br>
But can it be renamed, or does this logging library require &quot;.res&quot; as the<br>
file extension?<br>
<br>
<br>
On Fri, Jan 21, 2011 at 11:22 AM, &lt;<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>&gt; wrote:<br>
Well, you&#39;re probably going to think this is stupid, but the *.res file is<br>
not actually a resource file in the Microsoft sense of it. It&#39;s just a<br>
text file that happens to have the *.res extension. It&#39;s a string<br>
localization text file that our logging library knows how to read. It<br>
think it is just happen stance that the logging library expects the files<br>
to end in *.res.<br>
<br>
---<br>
Aaron Wright<br>
<br>
<br>
<br>
<br>
From:<br>
David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;<br>
To:<br>
<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a><br>
Cc:<br>
&quot;<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>&quot; &lt;<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>&gt;<br>
Date:<br>
01/21/2011 08:10 AM<br>
Subject:<br>
Re: [CMake] VS2010 tries to compile a file with *.res extension when its<br>
copied<br>
<br>
<br>
<br>
This is similar in nature to<br>
<a href="http://public.kitware.com/Bug/view.php?id=11147" target="_blank">http://public.kitware.com/Bug/view.php?id=11147</a> and friends...<br>
<br>
The fix for that issue is ending up being &quot;obj&quot; file specific, though,<br>
because we have a special handler in place for files with &quot;obj&quot;<br>
extensions. Perhaps we need similar handling for &quot;res&quot; files. (They are<br>
really just obj files from the rc compiler...)<br>
<br>
Do you not have the rc file? Or are you compiling it as a custom command<br>
to avoid some other issue with rc files?<br>
<br>
This sounds like we need to add a test similar to our existing ExternalOBJ<br>
test, but with a pre-built res file.<br>
<br>
<br>
Thanks for the discussion -- seems like something needs to be fixed here.<br>
Let&#39;s track it down.<br>
<br>
David<br>
<br>
<br>
On Fri, Jan 21, 2011 at 10:57 AM, &lt;<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>&gt; wrote:<br>
This is with both 2.8.3 and 2.8.4-rc1.<br>
<br>
On a side note, VS2010 is not trying to compile the *.res file as part of<br>
the executable, because it is marked HEADER_FILE_ONLY, and in addition I<br>
can remove it entirely from the project. Instead, even when the *.res file<br>
appears no where in the solution explorer in VS2010 (except as a<br>
*.res.rule file), VS2010 is still trying to compile it. If I remove the<br>
*.res.rule file it stops trying to compile it. So basically its just<br>
something to do with the ADD_CUSTOM_COMMAND that copies the file.<br>
<br>
---<br>
Aaron Wright<br>
<br>
<br>
<br>
<br>
From:<br>
David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;<br>
To:<br>
&quot;<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>&quot; &lt;<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>&gt;<br>
Cc:<br>
&quot;<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>&quot; &lt;<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>&gt;<br>
Date:<br>
01/20/2011 07:57 PM<br>
Subject:<br>
Re: [CMake] VS2010 tries to compile a file with *.res extension when its<br>
copied<br>
Sent by:<br>
<a href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a><br>
<br>
<br>
<br>
Is tha with 2.8.3 or 2.8.4-rc1?<br>
<br>
On Thursday, January 20, 2011,  &lt;<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>&gt; wrote:<br>
&gt; I know I&#39;ve asked this before, but now I&#39;ve narrowed it down a bit and I<br>
&gt; have an example. This copies a *.res file to the binary directory where<br>
&gt; presumably the executable can find it. The executable has that file as a<br>
&gt; source file to hook up the dependency, and the copied file has the<br>
&gt; HEADER_FILE_ONLY property set. Yet, somehow VS2010 is still trying to<br>
&gt; compile en.res. I even tried setting the source and destination en.res<br>
&gt; files to HEADER_FILE_ONLY, but that didn&#39;t fix it. Removing the<br>
&gt; ADD_CUSTOM_COMMAND that does the copy fixes the problem. Why is this<br>
&gt; broken? FYI, it worked fine in VS2008.<br>
&gt;<br>
&gt; CMAKE_MINIMUM_REQUIRED(VERSION 2.8)<br>
&gt;<br>
&gt; PROJECT(cmake_res_bug)<br>
&gt;<br>
&gt; SET(RESOURCE_FILE &quot;${PROJECT_SOURCE_DIR}/resources/en.res&quot;)<br>
&gt;<br>
&gt; GET_FILENAME_COMPONENT(RESOURCE_FILE_BASENAME &quot;${RESOURCE_FILE}&quot; NAME)<br>
&gt; SET(LOCAL_RESOURCE_FILE<br>
&gt; &quot;${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}&quot;)<br>
&gt;<br>
&gt; ADD_CUSTOM_COMMAND(<br>
&gt;    OUTPUT &quot;${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}&quot;<br>
&gt;    COMMAND ${CMAKE_COMMAND} -E make_directory<br>
&gt; &quot;${PROJECT_BINARY_DIR}/resources&quot;<br>
&gt;    COMMAND ${CMAKE_COMMAND} -E copy &quot;${RESOURCE_FILE}&quot;<br>
&gt; &quot;${PROJECT_BINARY_DIR}/resources&quot;<br>
&gt;    DEPENDS &quot;${RESOURCE_FILE}&quot;<br>
&gt;    COMMENT &quot;Localizing ${RESOURCE_FILE_BASENAME}&quot;)<br>
&gt;<br>
&gt; SET_SOURCE_FILES_PROPERTIES(<br>
&gt;    &quot;${LOCAL_RESOURCE_FILE}&quot;<br>
&gt;    PROPERTIES HEADER_FILE_ONLY TRUE)<br>
&gt;<br>
&gt; INCLUDE_DIRECTORIES(&quot;${PROJECT_BINARY_DIR}&quot;)<br>
&gt;<br>
&gt; ADD_EXECUTABLE(<br>
&gt;    ${PROJECT_NAME}<br>
&gt;    &quot;${PROJECT_SOURCE_DIR}/src/main.cpp&quot;<br>
&gt;    &quot;${LOCAL_RESOURCE_FILE}&quot;)<br>
&gt;<br>
&gt; ---<br>
&gt; Aaron Wright<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
<a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at:<br>
<a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at:<br>
<a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at:<br>
<a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at:<br>
<a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br>