<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 6, 2013 at 10:13 PM, Pau Garcia i Quiles <span dir="ltr"><<a href="mailto:pgquiles@elpauer.org" target="_blank">pgquiles@elpauer.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I am using CMake 2.8.11.2 on Windows to build and package some software. If I do this, it works fine:</div>
<div><br></div><div><div> set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Wt binary build")</div>
<div> set(CPACK_PACKAGE_VENDOR "emweb bvba")</div><div> set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")</div><div> set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")</div>
<div> set(CPACK_PACKAGE_VERSION_MAJOR "3")</div><div> set(CPACK_PACKAGE_VERSION_MINOR "3")</div><div> set(CPACK_PACKAGE_VERSION_PATCH "1")</div><div> set(CPACK_PACKAGE_INSTALL_DIRECTORY "Wt ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")</div>
<div> set(CPACK_GENERATOR "ZIP;NSIS")</div><div> include(CPack)</div><div><br></div><div>But if I add this line before include(CPack):</div><div><br></div><div> set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")<br>
</div><div><br></div><div>then CPACK_PACKAGE_NAME, CPACK_PACKAGE_VERSION and CPACK_SYSTEM_NAME are empty and the file is generated as "---.zip" / "---.exe". Am I doing something wrong? (I want to add a couple more variables in the CPACK_PACKAGE_FILE_NAME variable to specify compiler and compiler version, that's why I'm composing CPACK_PACKAGE_FILE_NAME)</div>
</div></div></blockquote><div><br></div><div>I ran into this myself. IIRC the docs are not that clear on this, but the CPACK_* variables are only set inside the CPackConfig file, i.e. they are empty before your include(CPack). Thats the reason you end up with an empty name.</div>
<div><br></div><div>However the docs on the CPACK_* variables are rather clear on where they get their default value from if they're not set, so you should be able to look that up and replace CPACK_* with whatever they use as default (for example CMAKE_SYSTEM_NAME instead of CPACK_SYSTEM_NAME).</div>
<div><br></div><div>What I ended up to include the bitness is to set CPACK_SYSTEM_NAME myself and let the defaults of the rest be filled in, I'm using CMAKE_SYSTEM_NAME and simply append the 32/64 value with an additional variable. I'd probably do the same if I needed to have 'msvcXY' in the final package name (or something similar).</div>
<div><br></div><div>Andreas<br></div></div></div></div>