MantisBT - CMake
View Issue Details
0011142CMakeCMakepublic2010-08-18 07:022012-11-10 09:47
Mike McQuaid 
Eric NOULARD 
normalfeaturealways
closedfixed 
CMake-2-8 
 
0011142: INSTALL() should have a "make-package-only" option
If you're using CMake for your packaging as well as building and installing (for example using CPack) then I find myself often wanting to install files into the package but not on "make install" or into the build directory.

Currently, to do this I have to do the following:
INSTALL( CODE "
IF( \${CMAKE_INSTALL_PREFIX} MATCHES .*/_CPack_Packages/.* )
....
ENDIF( \${CMAKE_INSTALL_PREFIX} MATCHES .*/_CPack_Packages/.* )
" )

This syntax is pretty unpleasant and it would be nice if I could just, for instance, pass a PACKAGE argument to an install command to have it only do this for generating packages.

Would this be accepted? Is this the wrong approach? If you guide me to creating an acceptable one, I can create a patch for this.

Thanks!
No tags attached.
related to 0010531closed Kitware Robot Install-rules for individual components 
Issue History
2010-08-18 07:02Mike McQuaidNew Issue
2010-12-13 07:06Mike McQuaidNote Added: 0023913
2010-12-15 11:27David ColeAssigned To => David Cole
2010-12-15 11:27David ColeStatusnew => assigned
2010-12-15 11:29David ColeNote Added: 0024162
2011-10-25 22:25David ColeStatusassigned => backlog
2011-10-25 22:26David ColeAssigned ToDavid Cole =>
2012-11-10 06:35Mike McQuaidNote Added: 0031518
2012-11-10 09:45Eric NOULARDNote Added: 0031520
2012-11-10 09:45Eric NOULARDStatusbacklog => closed
2012-11-10 09:45Eric NOULARDAssigned To => Eric NOULARD
2012-11-10 09:45Eric NOULARDResolutionopen => fixed
2012-11-10 09:47Eric NOULARDRelationship addedrelated to 0010531

Notes
(0023913)
Mike McQuaid   
2010-12-13 07:06   
4 months later ping. If I shouldn't be bugs on the bug tracker can you suggest the best way of getting these looked at?

Thanks!
(0024162)
David Cole   
2010-12-15 11:29   
There are only a very few number of people who even pay attention to the CMake bug tracker. Most of us are very busy with other stuff.

The best way to approach these things is to ask on the CMake mailing list first, and then, after discussion there leads to "hey, put that in the bug tracker" then put it here.

There are thousands of people reading the CMake mailing list regularly, many of whom chime in with their opinions on various things. Much more likely to get a timely mailing list reply than a bug tracker response. Plain statistics and sheer numbers.
(0031518)
Mike McQuaid   
2012-11-10 06:35   
This can be closed.
(0031520)
Eric NOULARD   
2012-11-10 09:45   
Closed per reporter request.

May be some possible way to achieve what is wanted with existing CPack/CMake features.

If you put you install bits in COMPONENT (see COMPONENT option of INSTALL command)
you may well install a different set of component when doing
make install
or
make package.

e.g
CPACK_COMPONENTS_ALL tells CPacks which component should be install
CPACK_INSTALL_CMAKE_PROJECTS another to control what is installed at CPack time
  (see cpack --help-variable CPACK_INSTALL_CMAKE_PROJECTS)
CPACK_PROJECT_CONFIG_FILE control CPack behavior at CPack time, in particular
it enables you to modify/set CPACK_xxx variables on a per-generator basis.

regarding make install,
this one is basically doing a

cmake -P cmake_install.cmake at the root of the project
so you may select which component you want to install
by launching

cmake -DCOMPONENT=myComp -P cmake_install.cmake

there is another bug report related to this (I'll check and add a link)