<div dir="ltr">Hey,<div><br></div><div>you're working on Windows, right?<br><div><br></div><div>I think you can do that if you create an additional target and call that target. So let's say, you have this 'hello.cpp', and you generate with CMake a solution. This is an example of a CMakeLists.txt</div></div><div><br></div><div><div>> cmake_minimum_required(VERSION 3.4)</div><div>> project(cpack_zip_test)</div><div><br></div><div>> set(SOURCES hello.cpp)</div><div><br></div><div>> add_executable(${PROJECT_NAME} ${SOURCES})</div><div><br></div><div>> set(CPACK_GENERATOR "ZIP")</div><div>> set(CPACK_PACKAGE_EXECUTABLE ${PROJECT_NAME})</div><div>> set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-package)</div><div><br></div><div>> add_custom_target(rename_zip</div><div><span class="" style="white-space:pre">>     </span>COMMAND rename ${CPACK_PACKAGE_FILE_NAME}.zip ${CPACK_PACKAGE_FILE_NAME}.docx</div><div><span class="" style="white-space:pre">>     </span>WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})</div><div><br></div><div>> include(CPack)</div></div><div><br></div><div>When I call now something like this on the command line (Visual Studio 12 2013)</div><div><br></div><div>> devenv cpack_zip_test.sln /Rebuild Debug /project PACKAGE.vcxproj</div><div><br></div><div>and afterwards some like this</div><div><br></div><div>> devenv cpack_zip_test.sln /Rebuild Debug /project rename_zip.vcxproj</div><div><br></div><div>then this is some way of renaming your zip into a docx file. But I do not know, if there is a more automatic way to do this. I tried it with an additional parameter in the 'add_custom_target'-command (see at the DEPENDS part):</div><div><br></div><div><div>> add_custom_target(rename_zip</div><div>>     COMMAND rename ${CPACK_PACKAGE_FILE_NAME}.zip ${CPACK_PACKAGE_FILE_NAME}.docx</div><div><span style="white-space:pre">>     </span>DEPENDS PACKAGE</div><div><span style="white-space:pre">>     </span>WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})</div></div><div><br></div><div>But when I call 'devenv cpack_zip_test.sln /Rebuild Debug /project rename_zip.vcxproj', I would assume, that first the PACKAGE target is called, and afterwards the 'rename_zip' target is called. But that's not the case. Maybe some other person can tell me, if this is a bug or this is intention...</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-24 21:53 GMT+02:00 <a href="mailto:tonka3100@gmail.com">tonka3100@gmail.com</a> <span dir="ltr"><<a href="mailto:tonka3100@gmail.com" target="_blank">tonka3100@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey everybody,<br>
<br>
I try to rename the fileextension of my cpack zip file. So i use cpack -G ZIP to create the package and get my zip file. Now i need to rename these fileextension to another name, like microsoft did it with with docx word format, where the file is a zip file, but has the docx extension.<br>
<br>
Does anybody know how i can do that?<br>
<br>
Greetings<br>
Tonka<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>