MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0014522 | CMake | CPack | public | 2013-10-29 12:05 | 2016-06-10 14:31 |
Reporter | Mark Stijnman | ||||
Assigned To | Kitware Robot | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | OS | OS Version | |||
Product Version | CMake 2.8.12 | ||||
Target Version | Fixed in Version | ||||
Summary | 0014522: CPACK_NSIS_DEFINES doesn't work in component-based installer | ||||
Description | I need to add some options to my NSIS installer, and noticed in the NSIS.template.in there is a variable CPACK_NSIS_DEFINES that looked suitable. Even though it doesn't appear to be documented, I've found mentions online of users who have used this variable for similar purposes (for example http://www.cmake.org/pipermail/cmake/2009-April/028592.html [^] and http://public.kitware.com/Bug/view.php?id=5939 [^]), so apparently this used to work. However, it doesn't use for my project. When I tried to create a minimal example, it worked again. Turns out that the problem only shows up when you use a component-based installer. In that case, the contents of the CPACK_NSIS_DEFINES variable don't make it into the project.nsi file at all. If I check the source code in cmCPackNSISGenerator.cxx, I see that its value is overwritten in function PackageFiles when components are present. | ||||
Steps To Reproduce | Use the following as a CMakeLists.txt file: --- CMakeLists.txt begin cmake_minimum_required(VERSION 2.8) project(cpack_nsis_defines_test) set(test_file "${CMAKE_CURRENT_BINARY_DIR}/test.txt") file(WRITE ${test_file} "test") install(FILES ${test_file} DESTINATION . COMPONENT test) set(CPACK_COMPONENTS_ALL test) set(CPACK_NSIS_DEFINES " !define MUI_WELCOMEPAGE_TITLE_3LINES") include(CPack) --- CMakeLists.txt end If you build the PACKAGE target, and run the installer, you will notice that the MUI_WELCOMEPAGE_TITLE_3LINES didn't have any effect. If you check the project.nsi file that is generated, you see that the MUI_WELCOMEPAGE_TITLE_3LINES option is not there. If you comment out the "CPACK_COMPONENTS_ALL" line, it will work as expected. | ||||
Additional Information | The issue can be fixed by modifying the PackageFile function such that any old value of CPACK_NSIS_DEFINES is stored in the "defines" variable first, before new values are appended to it. A patch is attached. | ||||
Tags | patch | ||||
Relationships | |||||
Attached Files | cpack_nsis_defines_fix.patch (938) 2013-10-29 12:05 https://public.kitware.com/Bug/file/4929/cpack_nsis_defines_fix.patch | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-10-29 12:05 | Mark Stijnman | New Issue | |||
2013-10-29 12:05 | Mark Stijnman | File Added: cpack_nsis_defines_fix.patch | |||
2013-10-31 05:13 | Mark Stijnman | Tag Attached: patch | |||
2014-11-01 02:59 | Kai Pastor | Note Added: 0037126 | |||
2016-06-10 14:29 | Kitware Robot | Note Added: 0042406 | |||
2016-06-10 14:29 | Kitware Robot | Status | new => resolved | ||
2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|