Wow. Very ambitious. I like it...<br><br>Your patch is not all that ugly... :-) But it does refer to some things that are not actually in the patch.<br><br>How about adding a feature request to the bug tracker for this and attaching a zip file (or .tar.gz) with the patch and all the new files that it refers to.<br>
<br>If you could also add a test project with 2 or 3 components in it that demonstrates how to use the new variables you've invented, I could see it becoming part of a future CMake release.....<br><br><br>Thanks for getting the ball rolling.<br>
David Cole<br><br><br><div class="gmail_quote">On Thu, Apr 17, 2008 at 12:53 AM, Doug Gregor <<a href="mailto:doug.gregor@gmail.com">doug.gregor@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello all,<br>
<br>
I have a project that consists of several different libraries, each<br>
with its own headers and generated library targets. I use the<br>
COMPONENT option to the install command to put each library's<br>
installed files into a library-specific component.<br>
<br>
Now, what I would like to do is have these components translate into<br>
separate installation options within a single NSIS installer created<br>
by CPack. NSIS has options to include a "Components" page in the<br>
installer, which allows users to select/deselect specific components<br>
to install. Is there any way to do this with CPack?<br>
CPACK_INSTALL_CMAKE_PROJECTS doesn't seem flexible enough.<br>
<br>
In anticipation that the answer to the above is "no", I hacked up a<br>
quick prototype of this functionality based on the CVS trunk. A patch<br>
is atttached. It's a little ugly, but it's working for my test case.<br>
Mostly, I'd like to see if there's interest in this feature or if<br>
anyone else has already done it.<br>
<br>
The basic idea is that for a given project/component pair (as<br>
specified by CPACK_INSTALL_CMAKE_PROJECTS), one can specify a list of<br>
(sub)components that will actually be installed. Each of these<br>
components can be independently selected (or not) by the user. For<br>
example , the command below says that the Boost project's ALL<br>
component has (sub)components names "Core", "Filesystem", and "Graph"<br>
<br>
set(CPACK_COMPONENTS_BOOST_ALL "Core" "Filesystem" "Graph")<br>
<br>
Those names corresponding, of course, to components in an install<br>
command, e.g., the "Core" component installs its files like this:<br>
<br>
install(DIRECTORY boost<br>
DESTINATION ${BOOST_HEADER_DIR}<br>
COMPONENT Core<br>
PATTERN "CVS" EXCLUDE<br>
REGEX ".svn" EXCLUDE)<br>
<br>
Now the installer has a "Components" page with three entries on it:<br>
<br>
+ Core<br>
+ Filesystem<br>
+ Graph<br>
<br>
Users can choose to install any combination of those by<br>
checking/unchecking the boxes. However, we really don't want the<br>
installer to say just "Core", we want it to say "Core Libraries". In<br>
addition, the "Core Libraries" is a required feature, and must always<br>
be installed. So we add a few more variables before including CPack:<br>
<br>
set(CPACK_COMPONENT_BOOST_CORE_REQUIRED ON)<br>
set(CPACK_COMPONENT_BOOST_CORE_DISPLAY_NAME "Core libraries")<br>
<br>
Now the generated installer shows the Core component as "Core<br>
libraries", which is checked but grayed out (and not modifiable).<br>
<br>
There are lots of cool features that *could* be added from here, with<br>
some level of NSIS scripting knowledge:<br>
- Placing components into subgroups (e.g., we could have "headers",<br>
"runtime libraries", and "development libraries" under each component)<br>
- Providing different installation types (runtime, development,<br>
custom) that pre-select sets of components<br>
- Representing dependencies among components, so that selecting a<br>
component selects all of its dependencies (and unselecting a component<br>
unselects all of the components that depend on it)<br>
- Provide add/remove support on a per-component basis.<br>
<br>
Comments? Ideas? Rotten tomatoes?<br>
<font color="#888888"><br>
- Doug<br>
</font><br>_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>