Am 03/04/2017 um 12:30 schrieb Volker Enderlein:
Hi,


I'm facing problems using the packaging with CPACK.

I try to build three different packages, a MSI (via WIX), an IFW, and a ZIP package.

According to the documentation I set the following variables in my CMakeLists.txt (and a few more which are required):

set(CPACK_WIX_ROOT "C:/Temp/WiX-3.10/binaries")

set(QTIFWDIR "${GLOBAL}/Qt/Tools/QtInstallerFramework/2.0/bin")

set(CPACK_GENERATOR "WIX;IFW;ZIP")

After creating the build dir and running from there

cmake -G "Visual Studio 14 2015 Win64" ..\TestProject

the files CMakeCache.txt, CPackConfig.cmake, CPackSourceConfig.cmake, and CPackProperties.cmake are generated.

When running `cpack -C Release` to build all three installers at once, the first one (WIX) is built, but the second one (QtIFW) fails with the messages

CPack Error: Cannot find QtIFW compiler "binarycreator": likely it is not installed, or not in your PATH
CPack Error: Cannot initialize the generator IFW

I inspected the CMakeCache.txt file but found the following entries properly defined:

//QtIFW binarycreator command line client
CPACK_IFW_BINARYCREATOR_EXECUTABLE:FILEPATH=N:/Global/Qt/Tools/QtInstallerFramework/2.0/bin/binarycreator.exe

//QtIFW devtool command line client
CPACK_IFW_DEVTOOL_EXECUTABLE:FILEPATH=N:/Global/Qt/Tools/QtInstallerFramework/2.0/bin/devtool.exe

//QtIFW installer executable base
CPACK_IFW_INSTALLERBASE_EXECUTABLE:FILEPATH=N:/Global/Qt/Tools/QtInstallerFramework/2.0/bin/installerbase.exe

//QtIFW repogen command line client
CPACK_IFW_REPOGEN_EXECUTABLE:FILEPATH=N:/Global/Qt/Tools/QtInstallerFramework/2.0/bin/repogen.exe

//Enable to build 7-Zip source packages
CPACK_SOURCE_7Z:BOOL=ON

//Enable to build ZIP source packages
CPACK_SOURCE_ZIP:BOOL=ON

//Path to a program.
CPACK_WIX_CANDLE_EXECUTABLE:FILEPATH=C:/Temp/WiX-3.10/binaries/candle.exe

//Path to a program.
CPACK_WIX_LIGHT_EXECUTABLE:FILEPATH=C:/Temp/WiX-3.10/binaries/light.exe

But when I checked the CPack*Config.cmake files none of the entries above are referenced. After running the `cmake -G "Visual Studio 14 2015 Win64" ..\TestProject` a second time everything is fine; the entries are referenced in CPack*Config.cmake files and all three installers can be built.

So I really get stuck at this point.


Any ideas what could be the issue and how to avoid it?


Cheers Volker

A close follow up.

I finally figured out what didn't work.

The setting of the QTIFWDIR variable is not saved to the CPack*Config.cmake files. But the CMAKE_WIX_ROOT variable is. Those variables seem to be evaluated at runtime by CPack. Therefore the WIX build run successfully but the IFW build complained about a the path. Adding the variable with its current setting made everything run as expected.

Cheers Volker

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to