<br><br><div class="gmail_quote">On Tue, Apr 12, 2011 at 2:13 PM, James Bigler <span dir="ltr"><<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.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;">
<div><div></div><div class="h5">On Mon, Jan 17, 2011 at 11:27 AM, Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div><br>
On Jan 17, 2011, at 1:23 PM, Eric Noulard wrote:<br>
<br>
> 2011/1/17 Michael Jackson <<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>>:<br>
>> I have the following code:<br>
>><br>
>> if ( "${CMAKE_SIZEOF_VOID_P}" EQUAL "8" )<br>
>> set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-Win64")<br>
>> elseif( "${CMAKE_SIZEOF_VOID_P}" EQUAL "4" )<br>
>> set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-Win32")<br>
>> else()<br>
>> set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-Unknown")<br>
>> endif()<br>
>><br>
>> I properly generate VS 2008 Win64 projects. Everything builds fine. When I build the "PACKAGE" project I get a zip file with "-Unknown" in the name. This will usually configure OK the first time or so, ie, I get a Zip file name with "-Win64" but after a few more configs this seems to revert back to "Unknown". Searching the "CMakeCache.txt" file for "CMAKE_SIZEOF_VOID_P" comes up empty. Is this some sort of temporary variable?<br>
><br>
> Shouldn't be "temporary" just "not in cache".<br>
><br>
>> Do I need to store it in my own cache variable somewhere?<br>
><br>
> I don't think you should.<br>
> Looks like a bug to me, how come CMAKE_SIZEOF_VOID_P<br>
> would it be defined "sometimes" but not **always**...<br>
><br>
> need to dive into the source of this definition, may be it is not always<br>
> defined because it is "indirectly" defined in the chain of CMake processing due<br>
> to CMake cache.<br>
><br>
> By the way shouldn't you use<br>
><br>
> if (CMAKE_SIZEOF_VOID_P EQUAL 8)<br>
><br>
> instead of<br>
><br>
> if ( "${CMAKE_SIZEOF_VOID_P}" EQUAL "8" )<br>
><br>
> from the doc I think EQUAL is for values whereas STREQUAL is for string.<br>
><br>
><br>
> --<br>
> Erk<br>
> Membre de l'April - « promouvoir et défendre le logiciel libre » -<br>
> <a href="http://www.april.org" target="_blank">http://www.april.org</a><br>
<br>
</div></div>It seems like if I start with a clean build directory then CMAKE_SIZEOF_VOID_P will be the proper value for the environment I am running in. But then after a while (many runs of CMake) the value seems to get "lost" or otherwise is NOT in the cache any longer. Kind of odd really.<br>
<br>
You are probably right about the improper use of the "if" command. I never really know which one to use and when something does not work when I _think_ it really *should* work then I start trying all sorts of stuff.<br>
<br>
Maybe someone else has some ideas as to why CMAKE_SIZEOF_VOID_P might not be defined.<br>
<div>___________________________________________________________<br>
Mike Jackson <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
<br>
<br>
</div><div><div></div><div>_______________________________________________<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></div></div>I've also seen this, and I would appreciate if anyone else who experiences this could chime in, so that we might be able to start profiling situations where this comes up. I don't remember how I fixed the problem last time, though.<br>
<font color="#888888">
<br>James<br>
</font><br></blockquote><div><br><br>Maybe you can base the package name by testing the generator name. As for the pointer size, I use:<br>IF (${CMAKE_SIZEOF_VOID_P} MATCHES 4)<br><br>Regards,<br><br>Juan<br></div></div>
<br>