I don't think it's stupid. No judgment here. :-)<br><br>But can it be renamed, or does this logging library require ".res" as the file extension?<br><br><br><div class="gmail_quote">On Fri, Jan 21, 2011 at 11:22 AM, <span dir="ltr"><<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>></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;">Well, you'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's just a<br>
text file that happens to have the *.res extension. It'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>
<div class="im"><br>
---<br>
Aaron Wright<br>
<br>
<br>
<br>
<br>
From:<br>
David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>><br>
To:<br>
<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a><br>
</div><div class="im">Cc:<br>
"<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>" <<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>><br>
Date:<br>
</div>01/21/2011 08:10 AM<br>
<div><div></div><div class="h5">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 "obj" file specific, though,<br>
because we have a special handler in place for files with "obj"<br>
extensions. Perhaps we need similar handling for "res" 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's track it down.<br>
<br>
David<br>
<br>
<br>
On Fri, Jan 21, 2011 at 10:57 AM, <<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>> 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 <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>><br>
To:<br>
"<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>" <<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>><br>
Cc:<br>
"<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>" <<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>><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, <<a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a>> wrote:<br>
> I know I've asked this before, but now I've narrowed it down a bit and I<br>
> have an example. This copies a *.res file to the binary directory where<br>
> presumably the executable can find it. The executable has that file as a<br>
> source file to hook up the dependency, and the copied file has the<br>
> HEADER_FILE_ONLY property set. Yet, somehow VS2010 is still trying to<br>
> compile en.res. I even tried setting the source and destination en.res<br>
> files to HEADER_FILE_ONLY, but that didn't fix it. Removing the<br>
> ADD_CUSTOM_COMMAND that does the copy fixes the problem. Why is this<br>
> broken? FYI, it worked fine in VS2008.<br>
><br>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8)<br>
><br>
> PROJECT(cmake_res_bug)<br>
><br>
> SET(RESOURCE_FILE "${PROJECT_SOURCE_DIR}/resources/en.res")<br>
><br>
> GET_FILENAME_COMPONENT(RESOURCE_FILE_BASENAME "${RESOURCE_FILE}" NAME)<br>
> SET(LOCAL_RESOURCE_FILE<br>
> "${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}")<br>
><br>
> ADD_CUSTOM_COMMAND(<br>
> OUTPUT "${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}"<br>
> COMMAND ${CMAKE_COMMAND} -E make_directory<br>
> "${PROJECT_BINARY_DIR}/resources"<br>
> COMMAND ${CMAKE_COMMAND} -E copy "${RESOURCE_FILE}"<br>
> "${PROJECT_BINARY_DIR}/resources"<br>
> DEPENDS "${RESOURCE_FILE}"<br>
> COMMENT "Localizing ${RESOURCE_FILE_BASENAME}")<br>
><br>
> SET_SOURCE_FILES_PROPERTIES(<br>
> "${LOCAL_RESOURCE_FILE}"<br>
> PROPERTIES HEADER_FILE_ONLY TRUE)<br>
><br>
> INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")<br>
><br>
> ADD_EXECUTABLE(<br>
> ${PROJECT_NAME}<br>
> "${PROJECT_SOURCE_DIR}/src/main.cpp"<br>
> "${LOCAL_RESOURCE_FILE}")<br>
><br>
> ---<br>
> Aaron Wright<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>
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 <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>