View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0012063 | CMake | CPack | public | 2011-04-09 03:53 | 2012-03-06 08:37 | ||||
Reporter | Eric NOULARD | ||||||||
Assigned To | Eric NOULARD | ||||||||
Priority | normal | Severity | feature | Reproducibility | have not tried | ||||
Status | closed | Resolution | fixed | ||||||
Platform | Linux | OS | RPM based distros | OS Version | |||||
Product Version | CMake 2.8.4 | ||||||||
Target Version | CMake 2.8.6 | Fixed in Version | CMake 2.8.6 | ||||||
Summary | 0012063: CPackRPM: cannot specify per-component install scripts | ||||||||
Description | CPACK_RPM_PRE_INSTALL_SCRIPT_FILE CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE CPACK_RPM_POST_INSTALL_SCRIPT_FILE CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE cannot be specified on a per-component basis. Initially reported on the ML: http://www.cmake.org/pipermail/cmake/2011-March/043393.html [^] | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | CPackRPM.cmake [^] (32,784 bytes) 2011-07-26 14:13 rpmcomponenttest2.tar.bz2 [^] (1,304 bytes) 2011-07-28 07:33 CPackRPM.cmake.patch [^] (9,838 bytes) 2011-09-20 10:31 [Show Content] | ||||||||
Relationships | |||||||||||
|
Relationships |
Notes | |
(0027073) winfriedd (reporter) 2011-07-26 14:13 edited on: 2011-07-26 14:25 |
I made some modifications agains the CPackRPM.cmake of cmake 2.8.5 to implement this issue. If component installation is turned the CPACK_RPM_PRE_INSTALL_SCRIPT_FILE and friends variables can be overridden with: CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE If they are not specified the CPACK_RPM_PRE_INSTALL_SCRIPT_FILE etc. variables are used (for backwards compatibility). I will attach the modified module and a simple test project with 2 components. Hopefully this can be accepted for 2.8.6 regards, Winfried ps: what I don't understand and don't like is that in the attached test project I have to set the CPACK_RPM_COMPONENT1_POST_INSTALL_SCRIPT_FILE etc variables in the CMakeLists.txt of the root directory. If I set them in the CMakeLists.txt of one of the subdirectories they are not set in CPackRPM.cmake... |
(0027075) Eric NOULARD (developer) 2011-07-26 16:23 |
Thank you winfried, I'll review your patch. But probably not before a week or two. Concerning the location of "where" you can set(CPACK_xxx) in order to get them defined in CPackRPM.cmake this is a "SCOPE" issue. CPackRPM.cmake is loaded "at CPack-time" and CMakeLists.txt are loaded at "CMake-time". CPackRPM.cmake inherits from the vars defined in CPackConfig.cmake (in your build tree). CPackConfig.cmake gets created by the include(CPack.cmake) probably done in your main CMakeLists.txt. This inclusion gets all CPACK_<whatever> vars defined before the inclusion and put them in the generated CPackConfig.cmake. CPACK_xx variable defined in subdirs are out of the scope of the main CMakeLists.txt (unless you use PARENT_SCOPE or CACHE) thus the problem. The solution should be either put the var in global SCOPE or define those in a separate CPACK_PROJECT_CONFIG_FILE: http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overall_usage_.28common_to_all_generators.29 [^] this file gets loaded at CPack-time. |
(0027094) winfriedd (reporter) 2011-07-28 04:22 |
Thanks for the clarification. If the patch needs any changes let me know, or edit yourself as you see fit. |
(0027095) winfriedd (reporter) 2011-07-28 07:35 |
Please use file rpmcomponenttest2.tar.bz2 for testing, that one is for cmake 2.8.5. The first uploaded tar ball (for cmake 2.8.4) can be deleted, but I don't seem to be able to delete it myself. |
(0027455) Chip Christian (reporter) 2011-09-19 15:32 |
This patch works well for me, but I see a problem for non-component installs: CPACK_RPM_POST_INSTALL_READ_FILE, etc. are only set iff CPACK_RPM_PACKAGE_COMPONENT is set |
(0027458) Chip Christian (reporter) 2011-09-20 10:32 |
Try the patch I just uploaded. Should work correctly now with or without a COMPONENT install. Also fixed up the else/endifs. |
(0027459) Eric NOULARD (developer) 2011-09-20 10:37 |
I'll do that may be tonight or in a day or two. Thank you for you contribution. |
(0027460) Eric NOULARD (developer) 2011-09-20 14:24 |
Just merged to next with small editing. Merge topic 'CPackRPM-per-component-script' into next cc26a06 CPackRPM authorize per-component pre/post-[un]install scripts (0012063) |
(0028825) David Cole (manager) 2012-03-06 08:37 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2011-04-09 03:53 | Eric NOULARD | New Issue | |
2011-04-09 03:54 | Eric NOULARD | Relationship added | related to 0012062 |
2011-07-26 14:13 | winfriedd | Note Added: 0027073 | |
2011-07-26 14:13 | winfriedd | File Added: CPackRPM.cmake | |
2011-07-26 14:14 | winfriedd | File Added: rpmcomponenttest.tar.bz2 | |
2011-07-26 14:15 | winfriedd | Note Edited: 0027073 | |
2011-07-26 14:25 | winfriedd | Note Edited: 0027073 | |
2011-07-26 16:12 | Eric NOULARD | Assigned To | => Eric NOULARD |
2011-07-26 16:12 | Eric NOULARD | Status | new => assigned |
2011-07-26 16:23 | Eric NOULARD | Note Added: 0027075 | |
2011-07-28 04:22 | winfriedd | Note Added: 0027094 | |
2011-07-28 07:33 | winfriedd | File Added: rpmcomponenttest2.tar.bz2 | |
2011-07-28 07:35 | winfriedd | Note Added: 0027095 | |
2011-07-28 08:10 | Eric NOULARD | File Deleted: rpmcomponenttest.tar.bz2 | |
2011-09-19 14:37 | Eric NOULARD | Relationship added | has duplicate 0012469 |
2011-09-19 15:32 | Chip Christian | Note Added: 0027455 | |
2011-09-20 10:31 | Chip Christian | File Added: CPackRPM.cmake.patch | |
2011-09-20 10:32 | Chip Christian | Note Added: 0027458 | |
2011-09-20 10:37 | Eric NOULARD | Note Added: 0027459 | |
2011-09-20 14:24 | Eric NOULARD | Fixed in Version | => CMake 2.8.6 |
2011-09-20 14:24 | Eric NOULARD | Target Version | => CMake 2.8.6 |
2011-09-20 14:24 | Eric NOULARD | Note Added: 0027460 | |
2011-09-20 14:24 | Eric NOULARD | Status | assigned => resolved |
2011-09-20 14:24 | Eric NOULARD | Resolution | open => fixed |
2012-03-06 08:37 | David Cole | Note Added: 0028825 | |
2012-03-06 08:37 | David Cole | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |