Re: [cmake-developers] Generator expressions for output directory/name (and install?)

2015-07-09 Thread Brad King
On 07/09/2015 12:59 PM, Robert Goulet wrote:
> Awesome, thanks Brad.
> 
> I'm guessing it's too late for 3.3?

Yes ;)

-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] Generator expressions for output directory/name (and install?)

2015-07-09 Thread Robert Goulet
Awesome, thanks Brad.

I'm guessing it's too late for 3.3?

-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Thursday, July 9, 2015 12:55 PM
To: Robert Goulet
Cc: cmake-developers@cmake.org
Subject: Re: [cmake-developers] Generator expressions for output directory/name 
(and install?)

On 07/08/2015 04:57 PM, Robert Goulet wrote:
> Ok let's start with the simplest one, OUTPUT_NAME generator 
> expressions support, then we'll do the others.

I made one documentation update:

 Help: Improve OUTPUT_NAME documentation formatting  
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a1ef0dc

Then I rebased your patch on it and revised the docs a bit.
Applied:

 Add generator expression support to OUTPUT_NAME target property
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=809159c9

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] Generator expressions for output directory/name (and install?)

2015-07-09 Thread Brad King
On 07/08/2015 04:57 PM, Robert Goulet wrote:
> Ok let's start with the simplest one, OUTPUT_NAME generator
> expressions support, then we'll do the others.

I made one documentation update:

 Help: Improve OUTPUT_NAME documentation formatting
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a1ef0dc

Then I rebased your patch on it and revised the docs a bit.
Applied:

 Add generator expression support to OUTPUT_NAME target property
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=809159c9

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] Generator expressions for output directory/name (and install?)

2015-07-08 Thread Robert Goulet
Ok let's start with the simplest one, OUTPUT_NAME generator expressions 
support, then we'll do the others.

Patch in attachment.

-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Tuesday, June 16, 2015 10:21 AM
To: Robert Goulet
Cc: cmake-developers@cmake.org
Subject: Re: [cmake-developers] Generator expressions for output directory/name 
(and install?)

On 06/15/2015 03:03 PM, Robert Goulet wrote:
> Updated with improved tests and added docs.

Thanks.  Here are more comments.

Please split the patch to do the OUTPUT_NAME/dir changes first.
Update the Tests/PerConfig test to cover these.  Since the 
RUNTIME_OUTPUT_DIRECTORY properties are learning this, please do it for 
ARCHIVE_OUTPUT_DIRECTORY and LIBRARY_OUTPUT_DIRECTORY too for completeness.

Then do the install DESTINATION changes in a second patch.
That will simplify review.

In this hunk:

>cmInstallTargetGenerator(
> -cmTarget& t, const char* dest, bool implib,
> +cmMakefile* mf, cmTarget& t, const char* dest, bool implib,

The cmTarget has a GetMakefile() method so there should be no need to pass the 
mf separately.

In this hunk:

> @@ -216,6 +216,7 @@ void 
> cmScriptGenerator::GenerateScriptActionsPerConfig(std::ostream& os,
>  i != this->ConfigurationTypes->end(); ++i)
>{
>const char* config = i->c_str();
> +  this->ConfigurationName = config;
>if(this->GeneratesForConfig(config))
>  {
>  // Generate a per-configuration block.

This should not be needed if things are factored correctly.
Everything in that block already passes "config" through as a parameter.

Thanks,
-Brad



output-name-genex.patch
Description: output-name-genex.patch
-- 

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] Generator expressions for output directory/name (and install?)

2015-06-16 Thread Brad King
On 06/15/2015 03:03 PM, Robert Goulet wrote:
> Updated with improved tests and added docs.

Thanks.  Here are more comments.

Please split the patch to do the OUTPUT_NAME/dir changes first.
Update the Tests/PerConfig test to cover these.  Since the
RUNTIME_OUTPUT_DIRECTORY properties are learning this, please
do it for ARCHIVE_OUTPUT_DIRECTORY and LIBRARY_OUTPUT_DIRECTORY
too for completeness.

Then do the install DESTINATION changes in a second patch.
That will simplify review.

In this hunk:

>cmInstallTargetGenerator(
> -cmTarget& t, const char* dest, bool implib,
> +cmMakefile* mf, cmTarget& t, const char* dest, bool implib,

The cmTarget has a GetMakefile() method so there should be no
need to pass the mf separately.

In this hunk:

> @@ -216,6 +216,7 @@ void 
> cmScriptGenerator::GenerateScriptActionsPerConfig(std::ostream& os,
>  i != this->ConfigurationTypes->end(); ++i)
>{
>const char* config = i->c_str();
> +  this->ConfigurationName = config;
>if(this->GeneratesForConfig(config))
>  {
>  // Generate a per-configuration block.

This should not be needed if things are factored correctly.
Everything in that block already passes "config" through
as a parameter.

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] Generator expressions for output directory/name (and install?)

2015-06-15 Thread Robert Goulet
Updated with improved tests and added docs.

-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Monday, June 15, 2015 10:17 AM
To: Robert Goulet
Cc: cmake-developers@cmake.org
Subject: Re: [cmake-developers] Generator expressions for output directory/name 
(and install?)

On 06/12/2015 10:19 AM, Robert Goulet wrote:
> Here's the updated patch file with tests added.

Thanks.  Please also update Tests/ExportImport/Import to verify that the files 
are installed correctly.  The test case needs to fail if it were run without 
the rest of your changes.

Also please extend the Help/*/*.rst documentation to cover where generator 
expressions are now supported.

Thanks,
-Brad



more-generator-expressions.patch
Description: more-generator-expressions.patch
-- 

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] Generator expressions for output directory/name (and install?)

2015-06-15 Thread Brad King
On 06/12/2015 10:19 AM, Robert Goulet wrote:
> Here's the updated patch file with tests added.

Thanks.  Please also update Tests/ExportImport/Import to verify
that the files are installed correctly.  The test case needs to
fail if it were run without the rest of your changes.

Also please extend the Help/*/*.rst documentation to cover where
generator expressions are now supported.

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] Generator expressions for output directory/name (and install?)

2015-06-12 Thread Robert Goulet
Here's the updated patch file with tests added. Let me know if it's good to go.

-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Thursday, June 11, 2015 8:55 AM
To: Robert Goulet
Cc: cmake-developers@cmake.org
Subject: Re: [cmake-developers] Generator expressions for output directory/name 
(and install?)

On 06/10/2015 01:43 PM, Robert Goulet wrote:
> Ok I think I got something nicely integrated now.

Thanks.  Here are some comments:

> +  std::string GetDestination(const char* config=nullptr) const;

Please avoid C++11 constructs.

> +std::string cmInstallGenerator::GetDestination(const char* config) 
> +const {
> +  std::string configName = config ? config : ConfigurationName;

This should be able to use "std::string const&" as the argument type instead.  
Just have the call sites pass ConfigurationName themselves or create an 
argument-less overload that passes it for them.

Also please look at updating the test suite to cover this.  The 
Tests/ExportImport test has Export and Import sub-projects that test 
installation of all kinds of targets.  That may be a good place to add tests 
for DESTINATION.

Thanks,
-Brad



more-generator-expressions.patch
Description: more-generator-expressions.patch
-- 

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] Generator expressions for output directory/name (and install?)

2015-06-11 Thread Brad King
On 06/10/2015 01:43 PM, Robert Goulet wrote:
> Ok I think I got something nicely integrated now.

Thanks.  Here are some comments:

> +  std::string GetDestination(const char* config=nullptr) const;

Please avoid C++11 constructs.

> +std::string cmInstallGenerator::GetDestination(const char* config) const
> +{
> +  std::string configName = config ? config : ConfigurationName;

This should be able to use "std::string const&" as the argument type
instead.  Just have the call sites pass ConfigurationName themselves
or create an argument-less overload that passes it for them.

Also please look at updating the test suite to cover this.  The
Tests/ExportImport test has Export and Import sub-projects that
test installation of all kinds of targets.  That may be a good
place to add tests for DESTINATION.

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] Generator expressions for output directory/name (and install?)

2015-06-10 Thread Robert Goulet
Ok I think I got something nicely integrated now.
 
Patch in attachment.

This enable generator expressions for the target properties OUTPUT_NAME and 
RUNTIME_OUTPUT_DIRECTORY, as well as the DESTINATION property of the install 
command.

Cheers!

-Robert Goulet

-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Wednesday, June 10, 2015 8:47 AM
To: Robert Goulet
Cc: cmake-developers@cmake.org
Subject: Re: [cmake-developers] Generator expressions for output directory/name 
(and install?)

On 06/09/2015 05:00 PM, Robert Goulet wrote:
> install scripts doesn't seem to be per configuration

While there is not a separate script for each configuration the scripts 
themselves do support switching on the configuration selected for installation. 
 For single-configuration generators they only need to have the one 
configuration specified by the CMAKE_BUILD_TYPE.  For multi-configuration 
generators they do get per-config code selected by conditional blocks.  Try 
using one of the Visual Studio or Xcode generators to see how the install 
scripts look.  Also try using a genex in the list of files given to the 
install(FILES) command.

See cmScriptGenerator.cxx for the logic that dispatches based on whether the 
script content is to be single or multi config.

-Brad



more-generator-expressions.patch
Description: more-generator-expressions.patch
-- 

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] Generator expressions for output directory/name (and install?)

2015-06-10 Thread Brad King
On 06/09/2015 05:00 PM, Robert Goulet wrote:
> install scripts doesn't seem to be per configuration

While there is not a separate script for each configuration the
scripts themselves do support switching on the configuration
selected for installation.  For single-configuration generators
they only need to have the one configuration specified by the
CMAKE_BUILD_TYPE.  For multi-configuration generators they do
get per-config code selected by conditional blocks.  Try using
one of the Visual Studio or Xcode generators to see how the
install scripts look.  Also try using a genex in the list of
files given to the install(FILES) command.

See cmScriptGenerator.cxx for the logic that dispatches based
on whether the script content is to be single or multi config.

-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] Generator expressions for output directory/name (and install?)

2015-06-09 Thread Robert Goulet
Hi all,

We like to use generator expressions in our CMake scripts, and one particular 
place we'd like to use them is in the output directory and name of our targets. 
I was able to add generator expressions support to OUTPUT_NAME and 
RUNTIME_OUTPUT_DIRECTORY target properties. So far so good, I will most likely 
send a patch soon. But I was not able to do it for the DESTINATION property of 
the CMake install command. Well, not without changing a lot of code.

In order to close the loop with this feature, the install command should be 
able to copy files to destinations that contains generator expressions. But 
reading the code, it doesn't seems like it was ever intended to work that way; 
install scripts doesn't seem to be per configuration. Looks like a pretty big 
refactoring. But before I start changing too much code, is this something I 
should pursue or not? Does it make sense?

Thanks!

-Robert Goulet

-- 

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