Re: [cmake-developers] install(EXCLUDE_FROM_ALL) new feature - request for comment

2016-02-04 Thread Nick Lewis
Brad

Thank you for looking at adding this feature to 'next'. I am not familiar
with git format-patch but i hope you can make use of the attached patch for
​​Help/command/install.rst

Best regards
Nick​​

On Wed, Feb 3, 2016 at 9:17 PM, Brad King  wrote:

> On 02/03/2016 02:31 PM, Brad King wrote:
> >  install: Add EXCLUDE_FROM_ALL option (#14921)
> >  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b6c4729
> >
> >  Tests: Add cases for install() command EXCLUDE_FROM_ALL option
> >  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=670fa897
>
> I've had to revert it from 'next' pending some corrections to how
> the test infrastructure checks the installation results to work
> more portably.  I'll respond again once that is fixed and the
> topic draft is restored.  Meanwhile please work on the documentation
> updates.
>
> Thanks,
> -Brad
>
>


-- 
Nick Lewis
nick.le...@amag.com
+44 1684 277137 <+441684277137>
www.amag.com
AMAG Technology, Challenge House, International Drive, Tewkesbury Business
Park, TEWKESBURY, GL20 8UQ, U.K.

-- 



This company is part of the G4S group of companies. This communication 
contains information which may be confidential, personal and/or privileged. 
It is for the exclusive use of the intended recipient(s). If you are not 
the intended recipient(s), please note that any distribution, forwarding, 
copying or use of this communication or the information in it is strictly 
prohibited. Any personal views expressed in this e-mail are those of the 
individual sender and the Company does not endorse or accept responsibility 
for them. Prior to taking any action based upon this e-mail message, you 
should seek appropriate confirmation of its authenticity. This message has 
been checked for viruses on behalf of the Company.
commit dafc81cb0f2334a913631239f7dd3f1538f71c48
Author: Nick Lewis 
Date:   Thu Feb 4 09:01:33 2016 +

Improve EXCLUDE_FROM_ALL documentation in Help/command/install.rst

diff --git a/Help/command/install.rst b/Help/command/install.rst
index 5e98971..bc257bb 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -50,6 +50,10 @@ signatures that specify them.  The common options are:
   created.  The default component name may be controlled with the
   :variable:`CMAKE_INSTALL_DEFAULT_COMPONENT_NAME` variable.
 
+``EXCLUDE_FROM_ALL``
+  Specify that the file is excluded from a full installation and only
+  installed as part of a component-specific installation
+
 ``RENAME``
   Specify a name for an installed file that may be different from the
   original file.  Renaming is allowed only when a single file is
@@ -173,7 +177,7 @@ Installing Files
   [PERMISSIONS permissions...]
   [CONFIGURATIONS [Debug|Release|...]]
   [COMPONENT ]
-  [RENAME ] [OPTIONAL])
+  [RENAME ] [OPTIONAL] [EXCLUDE_FROM_ALL])
 
 The ``FILES`` form specifies rules for installing files for a project.
 File names given as relative paths are interpreted with respect to the
@@ -207,7 +211,8 @@ Installing Directories
   [DIRECTORY_PERMISSIONS permissions...]
   [USE_SOURCE_PERMISSIONS] [OPTIONAL] [MESSAGE_NEVER]
   [CONFIGURATIONS [Debug|Release|...]]
-  [COMPONENT ] [FILES_MATCHING]
+  [COMPONENT ] [EXCLUDE_FROM_ALL]
+  [FILES_MATCHING]
   [[PATTERN  | REGEX ]
[EXCLUDE] [PERMISSIONS permissions...]] [...])
 
@@ -282,7 +287,7 @@ Custom Installation Logic
 ::
 
   install([[SCRIPT ] [CODE ]]
-  [COMPONENT ] [...])
+  [COMPONENT ] [EXCLUDE_FROM_ALL] [...])
 
 The ``SCRIPT`` form will invoke the given CMake script files during
 installation.  If the script file name is a relative path it will be
@@ -307,7 +312,8 @@ Installing Exports
   [PERMISSIONS permissions...]
   [CONFIGURATIONS [Debug|Release|...]]
   [EXPORT_LINK_INTERFACE_LIBRARIES]
-  [COMPONENT ])
+  [COMPONENT ]
+  [EXCLUDE_FROM_ALL])
 
 The ``EXPORT`` form generates and installs a CMake file containing code to
 import targets from the installation tree into another project.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] install(EXCLUDE_FROM_ALL) new feature - request for comment

2016-02-04 Thread Brad King
On 02/04/2016 04:55 AM, Nick Lewis wrote:
> I am not familiar with git format-patch

After committing locally just run

 git format-patch HEAD~1..

to construct the patch file.  The "~1" specifies the number of
commits to go back (via first-parent) and include in the series.

> make use of the attached patch for ​​Help/command/install.rst

Thanks.  I integrated that in to my revised form of the topic.
I've merged it to 'next' for testing again:

 install: Add EXCLUDE_FROM_ALL option (#14921)
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18ce97c4

 Tests: Add cases for install() command EXCLUDE_FROM_ALL option
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d321c196

 Help: Add notes for topic 'install-EXCLUDE_FROM_ALL'
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=586e56d0

Please look at extending the tests added by the second commit
to cover more install() command signatures.

Thanks,
-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] install(EXCLUDE_FROM_ALL) new feature - request for comment

2016-02-03 Thread Brad King
On 02/03/2016 02:31 PM, Brad King wrote:
>  install: Add EXCLUDE_FROM_ALL option (#14921)
>  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b6c4729
> 
>  Tests: Add cases for install() command EXCLUDE_FROM_ALL option
>  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=670fa897

I've had to revert it from 'next' pending some corrections to how
the test infrastructure checks the installation results to work
more portably.  I'll respond again once that is fixed and the
topic draft is restored.  Meanwhile please work on the documentation
updates.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] install(EXCLUDE_FROM_ALL) new feature - request for comment

2016-02-03 Thread Brad King
On 02/01/2016 05:01 AM, Nick Lewis wrote:
> https://cmake.org/Bug/view.php?id=14921

Thanks.  Actually my request in the issue tracker to post here was meant
to have the actual patch file attached so people can see it without
digging through the messages and attachments there.  Patch revisions
or new patches can be attached in responses within the thread.

Anyway, I've applied the "correction2" patch from the issue tracker,
applied it, and followed up with some test cases.  I merged the topic
to 'next' for testing:

 install: Add EXCLUDE_FROM_ALL option (#14921)
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b6c4729

 Tests: Add cases for install() command EXCLUDE_FROM_ALL option
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=670fa897

 Help: Add notes for topic 'install-EXCLUDE_FROM_ALL'
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cee30e16

but it is not ready for 'master' yet.

Please look at extending the Tests/RunCMake/install test with
cases for more install command signatures.  Please also update
the Help/command/install.rst file documentation to mention the
option in all signatures where it is supported and add a list
entry for it among the main options at the top.

Since I've already applied the original patch, please provide
these updates as new patches that I can apply on top.  Commit
locally in Git and use `git format-patch ...` to produce patch
files to attach here.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] install(EXCLUDE_FROM_ALL) new feature - request for comment

2016-02-01 Thread Nick Lewis
There is currently no way to exclude a component install() from a full
installation. Current workarounds using OPTIONAL do not work reliably
because they depend on previous builds and on the order of the execution of
the
build and install commands for the components and the default target

Let us take an example of a project that has some tests in a component that
need to be installed into a dedicated test package. The user expectation is
that the result could be achieved by typing the following:

 make
 make tests
 make install
 DESTDIR=/testpkgs make install-tests

However this results in test components in the default installation as well
as the testpkg

Judging by questions on the mail list, users typically try to overcome this
problem by adding the EXCLUDE_FROM_ALL keyword to the install() command but
this is currently unsupported. The patch uploaded to the issue tracker
provides support for it.

Brad has further suggested that the install(EXCLUDE_FROM_ALL) should be
implicitly set when installing components built with
add_executable/library(EXCLUDE_FROM_ALL)

I welcome your views on these ideas

https://cmake.org/Bug/view.php?id=14921

Best Regards
Nick

-- 
Nick Lewis
nick.le...@amag.com
+44 1684 277137 <+441684277137>
www.amag.com
AMAG Technology, Challenge House, International Drive, Tewkesbury Business
Park, TEWKESBURY, GL20 8UQ, U.K.

-- 



This company is part of the G4S group of companies. This communication 
contains information which may be confidential, personal and/or privileged. 
It is for the exclusive use of the intended recipient(s). If you are not 
the intended recipient(s), please note that any distribution, forwarding, 
copying or use of this communication or the information in it is strictly 
prohibited. Any personal views expressed in this e-mail are those of the 
individual sender and the Company does not endorse or accept responsibility 
for them. Prior to taking any action based upon this e-mail message, you 
should seek appropriate confirmation of its authenticity. This message has 
been checked for viruses on behalf of the Company.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] install(EXCLUDE_FROM_ALL) new feature - request for comment

2015-07-21 Thread Brad King
On 07/18/2015 02:03 PM, Stephen Kelly wrote:
 I find the title interesting but I didn't attempt to read the email. 
 
 Please make a proposal instead of just dumping a tree of text

For reference, the text is from the issue tracker entry:

 No way to exclude a component install() from a full installation
 http://www.cmake.org/Bug/view.php?id=14921

It proposes a patch attached to that entry which I've also attached
here.  The idea is to define install() rules which are *not* part of
the default installation when no component is specified.  IIUC then
one would need to request the specific component explicitly during
installation in order to get it.

-Brad

diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 3c76bd6..23943c3 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -31,7 +31,8 @@ static cmInstallTargetGenerator* CreateInstallTargetGenerator(cmTarget target,
 impLib, args.GetPermissions().c_str(),
 args.GetConfigurations(), args.GetComponent().c_str(),
 message,
-args.GetOptional() || forceOpt);
+args.GetExcludeFromAll(),
+args.GetOptional() || forceOpt);
 }
 
 static cmInstallFilesGenerator* CreateInstallFilesGenerator(
@@ -46,7 +47,8 @@ static cmInstallFilesGenerator* CreateInstallFilesGenerator(
 programs, args.GetPermissions().c_str(),
 args.GetConfigurations(), args.GetComponent().c_str(),
 message,
-args.GetRename().c_str(), args.GetOptional());
+args.GetExcludeFromAll(), args.GetRename().c_str(),
+args.GetOptional());
 }
 
 
@@ -116,6 +118,7 @@ bool cmInstallCommand::HandleScriptMode(std::vectorstd::string const args)
   int componentCount = 0;
   bool doing_script = false;
   bool doing_code = false;
+  bool exclude_from_all = false;
 
   // Scan the args once for COMPONENT. Only allow one.
   //
@@ -127,6 +130,10 @@ bool cmInstallCommand::HandleScriptMode(std::vectorstd::string const args)
 ++i;
 component = args[i];
 }
+if(args[i] == EXCLUDE_FROM_ALL)
+{
+exclude_from_all = true;
+}
 }
 
   if(componentCount1)
@@ -174,7 +181,7 @@ bool cmInstallCommand::HandleScriptMode(std::vectorstd::string const args)
 }
   this-Makefile-AddInstallGenerator(
 new cmInstallScriptGenerator(script.c_str(), false,
- component.c_str()));
+ component.c_str(), exclude_from_all));
   }
 else if(doing_code)
   {
@@ -182,7 +199,7 @@ bool cmInstallCommand::HandleScriptMode(std::vectorstd::string const args)
   std::string code = args[i];
   this-Makefile-AddInstallGenerator(
 new cmInstallScriptGenerator(code.c_str(), true,
- component.c_str()));
+ component.c_str(), exclude_from_all));
   }
 }
 
@@ -906,6 +913,7 @@ cmInstallCommand::HandleDirectoryMode(std::vectorstd::string const args)
   Doing doing = DoingDirs;
   bool in_match_mode = false;
   bool optional = false;
+  bool exclude_from_all = false;
   bool message_never = false;
   std::vectorstd::string dirs;
   const char* destination = 0;
@@ -1087,6 +1095,19 @@ cmInstallCommand::HandleDirectoryMode(std::vectorstd::string const args)
   // Switch to setting the component property.
   doing = DoingComponent;
   }
+else if(args[i] == EXCLUDE_FROM_ALL)
+  {
+  if(in_match_mode)
+{
+std::ostringstream e;
+e  args[0]   does not allow \
+   args[i]  \ after PATTERN or REGEX.;
+this-SetError(e.str().c_str());
+return false;
+}
+  exclude_from_all = true;
+  doing = DoingNone;
+  }
 else if(doing == DoingDirs)
   {
   // Convert this directory to a full path.
@@ -1230,6 +1251,7 @@ cmInstallCommand::HandleDirectoryMode(std::vectorstd::string const args)
 configurations,
 component.c_str(),
 message,
+exclude_from_all,
 literal_args.c_str(),
 optional));
 
@@ -1357,7 +1379,8 @@ bool cmInstallCommand::HandleExportMode(std::vectorstd::string const args)
   exportSet,
   ica.GetDestination().c_str(),
   ica.GetPermissions().c_str(), ica.GetConfigurations(),
-  ica.GetComponent().c_str(), message, fname.c_str(),
+  ica.GetComponent().c_str(), message,
+  ica.GetExcludeFromAll(), fname.c_str(),
   name_space.GetCString(), exportOld.IsEnabled(), this-Makefile);
   this-Makefile-AddInstallGenerator(exportGenerator);
 
diff --git 

Re: [cmake-developers] install(EXCLUDE_FROM_ALL) new feature - request for comment

2015-07-18 Thread Stephen Kelly
Nick Lewis wrote:

 Thanks for working on this.  I think it will be better discussed on the
 cmake-developers mailing list

I find the title interesting but I didn't attempt to read the email. 

Please make a proposal instead of just dumping a tree of text which can not 
be followed:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/13700

Thanks,

Steve.


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] install(EXCLUDE_FROM_ALL) new feature - request for comment

2015-07-17 Thread Nick Lewis
There is currently no way to exclude a component install() from a full
installation. Current workarounds using OPTIONAL do not work reliably
because
they depend on previous builds and on the order execution of the build
and
install commands for the components and the default target

Steps to Reproduce:
make
make tests
make install
DESTDIR=/testpkgs make install-tests

This results in test components in the default installation as well as
the
testpkg

Judging by questions on the mail list, users typically try to overcome
this
problem by adding the unsupported EXCLUDE_FROM_ALL keyword to the install
command

  http://www.cmake.org/Bug/view.php?id=14921

Interesting proposal.  I think a change along these lines could also
improve a
case mentioned in the install() command documentation:

 http://www.cmake.org/cmake/help/v3.0/command/install.html
 Installing a target with the EXCLUDE_FROM_ALL target property set to
TRUE has
undefined behavior.

That refers to the use case when a target build is EXCLUDE_FROM_ALL and
so is
not created by make and may then be missing when make install is
issued.
This looks intended to support the same use case by making the install
rule
excluded from the default installation too.  Perhaps install(TARGETS)
should
activate ExcludeFromAll when the corresponding property is set on the
target.


Rebased patch on 3.2.2. Still no automatic setting of
install(EXCLUDE_FROM_ALL)
based on the setting of add_executable(EXCLUDE_FROM_ALL) though

Thanks for working on this.  I think it will be better discussed on the
cmake-developers mailing list:

 http://www.cmake.org/mailman/listinfo/cmake-developers

That allows for design discussion with a broader audience than the issue

-- 



This company is part of the G4S group of companies. This communication 
contains information which may be confidential, personal and/or privileged. 
It is for the exclusive use of the intended recipient(s). If you are not 
the intended recipient(s), please note that any distribution, forwarding, 
copying or use of this communication or the information in it is strictly 
prohibited. Any personal views expressed in this e-mail are those of the 
individual sender and the Company does not endorse or accept responsibility 
for them. Prior to taking any action based upon this e-mail message, you 
should seek appropriate confirmation of its authenticity. This message has 
been checked for viruses on behalf of the Company.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers