MantisBT - CMake
View Issue Details
0015516CMakeCPackpublic2015-04-16 04:122015-11-02 09:13
Dorian 
Nils Gladitz 
normalminoralways
closedno change required 
Windows7
CMake 3.2.1 
 
0015516: Wix with CPACK_PROJECT_CONFIG_FILE = wrong file name.
CPACK_PACKAGE_VERSION_* variables set in CPACK_PROJECT_CONFIG_FILE are ignored in output file name. It always gives me installer-name-0.1.1-win32.msi
Add

--- CMakeLists.txt ---

set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CPackOptions.cmake)

--- CMakeLists.txt end ---

--- ${CMAKE_BINARY_DIR}/CPackOptions.cmake (generated by configure_file):

SET(CPACK_PACKAGE_VERSION 1.9.50.65535)
SET(CPACK_PACKAGE_VERSION_MAJOR 1)
SET(CPACK_PACKAGE_VERSION_MINOR 9)
SET(CPACK_PACKAGE_VERSION_PATCH 50)

message("CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}")
message("CPACK_PACKAGE_VERSION_MAJOR ${CPACK_PACKAGE_VERSION_MAJOR}")
message("CPACK_PACKAGE_VERSION_MINOR ${CPACK_PACKAGE_VERSION_MINOR}")
message("CPACK_PACKAGE_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH}")

--- CPackOptions.cmake end

Pack message output:

...
4> CPACK_PACKAGE_VERSION 1.9.50.65535
4> CPACK_PACKAGE_VERSION_MAJOR 1
4> CPACK_PACKAGE_VERSION_MINOR 9
4> CPACK_PACKAGE_VERSION_PATCH 50
...
4> CPack: - package: D:/proj-build/proj-name-0.1.1-win32.msi generated.
Note that version is displayed ok in ControlPanel->Add/Remove Programs, so it seems that only filename is a problem
No tags attached.
Issue History
2015-04-16 04:12DorianNew Issue
2015-04-16 06:36Nils GladitzNote Added: 0038529
2015-04-16 08:10DorianNote Added: 0038530
2015-04-16 08:22Nils GladitzNote Added: 0038531
2015-04-16 08:22Nils GladitzStatusnew => resolved
2015-04-16 08:22Nils GladitzResolutionopen => no change required
2015-04-16 08:22Nils GladitzAssigned To => Nils Gladitz
2015-11-02 09:13Robert MaynardNote Added: 0039774
2015-11-02 09:13Robert MaynardStatusresolved => closed

Notes
(0038529)
Nils Gladitz   
2015-04-16 06:36   
The filename depends on the value of CPACK_PACKAGE_FILE_NAME which is implicitly created (if not already set) by the CPack module at configuration time.

Your currently generated CPackConfig.cmake will contain e.g. SET(CPACK_PACKAGE_FILE_NAME "proj-name-0.1.1-win32") which cpack then bases the output filename on.

To get the desired behaviour your CPackOptions.cmake will have to set CPACK_PACKAGE_FILE_NAME as well.
(0038530)
Dorian   
2015-04-16 08:10   
Yes its true. I didn't know about CPACK_PACKAGE_FILE_NAME.

I was expecting that CPACK_PACKAGE_FILE_NAME is generated implicitly by combining CPACK_PACKAGE_NAME and version variables during CPACK_PROJECT_CONFIG_FILE processing, not in cmake generate step.

Than you Nils for quick and helpful answer.
(0038531)
Nils Gladitz   
2015-04-16 08:22   
Thanks. Resolving with "no change required".
(0039774)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.