Re: [cmake-developers] How to get install locations?

2017-03-23 Thread Robert Maynard
> One cmInstallTargetGenerator seems to install one file only and there
> seems to be one per cmGeneratorTarget. Is that correct? How does the
> installation of targets with multiple artifacts work?

Just to clarify/muddy the waters. Once
https://gitlab.kitware.com/cmake/cmake/merge_requests/574 has been
merged in cmInstallTargetGenerator will support OBJECT targets which
have multiple artifacts to install.

On Thu, Mar 23, 2017 at 1:10 PM, Brad King  wrote:
> On 03/23/2017 11:37 AM, Tobias Hunger wrote:
>> cmInstallTargetGenerator has std::string GetDestination(std::string
>> const& config) const, too, which might have what I need. Unfortunately
>> that is not static, so I need to figure out how to get the right
>> instance of cmInstallTargetGenerator.
>>
>> I tried to get the cmMakefile from the localGenerator and then iterate
>> over the list of cmInstallGenerator* I got from the cmMakefile's
>> GetInstallGenerators() method. But that in empty after I am done with
>> configure. Is that expected?
>>
>> Am I on the right track with this?
>
> Yes, but there is a separate list in each cmMakefile for each source
> directory.  You'd have to traverse the entire structure to find all
> of them.
>
>> One cmInstallTargetGenerator seems to install one file only and there
>> seems to be one per cmGeneratorTarget. Is that correct? How does the
>> installation of targets with multiple artifacts work?
>
> They are created by install() command invocations.  See the impl in
> `Source/cmInstallCommand.cxx`.  For each target the artifacts are
> each given an install generator.  Then there is a block that adds
> all of them:
>
> ```
> this->Makefile->AddInstallGenerator(archiveGenerator);
> this->Makefile->AddInstallGenerator(libraryGenerator);
> this->Makefile->AddInstallGenerator(runtimeGenerator);
> ...
> ```
>
> The code model reported by your protocol needs to cover the possibility
> of more than one install(TARGETS) command for a given target.  Each
> target may be installed to zero or more destinations.  You could either
> try to put this in a list inside each target, or separately model our
> concept of installation lists that reference targets instead.
>
> -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
-- 

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] How to get install locations?

2017-03-23 Thread Brad King
On 03/23/2017 11:37 AM, Tobias Hunger wrote:
> cmInstallTargetGenerator has std::string GetDestination(std::string
> const& config) const, too, which might have what I need. Unfortunately
> that is not static, so I need to figure out how to get the right
> instance of cmInstallTargetGenerator.
> 
> I tried to get the cmMakefile from the localGenerator and then iterate
> over the list of cmInstallGenerator* I got from the cmMakefile's
> GetInstallGenerators() method. But that in empty after I am done with
> configure. Is that expected?
> 
> Am I on the right track with this?

Yes, but there is a separate list in each cmMakefile for each source
directory.  You'd have to traverse the entire structure to find all
of them.

> One cmInstallTargetGenerator seems to install one file only and there
> seems to be one per cmGeneratorTarget. Is that correct? How does the
> installation of targets with multiple artifacts work?

They are created by install() command invocations.  See the impl in
`Source/cmInstallCommand.cxx`.  For each target the artifacts are
each given an install generator.  Then there is a block that adds
all of them:

```
this->Makefile->AddInstallGenerator(archiveGenerator);
this->Makefile->AddInstallGenerator(libraryGenerator);
this->Makefile->AddInstallGenerator(runtimeGenerator);
...
```

The code model reported by your protocol needs to cover the possibility
of more than one install(TARGETS) command for a given target.  Each
target may be installed to zero or more destinations.  You could either
try to put this in a list inside each target, or separately model our
concept of installation lists that reference targets instead.

-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] enable_language behavior change

2017-03-23 Thread Brad King
On 03/23/2017 12:08 PM, Robert Dailey wrote:
> Crystax NDK (on master branch) has a toolchain.cmake which invokes
> enable_language()

That is not something we expected to be done or intended to support.
A toolchain file should configure information about the toolchain,
not inject functionality into project CMake code.

> https://github.com/taka-no-me/android-cmake

Toolchain files were never meant to have that level of complexity.
That was only necessary due to lack of upstream CMake support
for Android, and that has now been resolved.

-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] enable_language behavior change

2017-03-23 Thread Robert Dailey
On Thu, Mar 23, 2017 at 10:50 AM, Brad King  wrote:
> On 03/23/2017 11:35 AM, Robert Dailey wrote:
>> Thanks Brad. For future reference, are these changes documented
>> anywhere? I searched for "enable_language" in the 3.6 release notes,
>> and there is no 3.6 entry for policy changes.
>
> The release notes are for new features, deprecations, and major
> user-facing changes.  We do not cloud them with every bug fix.
>
> This enable_language change was a bug fix that prevented a crash
> in some cases.  I was not aware that there were valid projects
> that trigger the error.
>
> -Brad
>

Crystax NDK (on master branch) has a toolchain.cmake which invokes
enable_language() but it fails. I guess they didn't test with 3.6 or
greater. Basically any of the android.toolchain.cmake scripts floating
around have this problem, since they're all modifications of the same
base change by takanome:

https://github.com/taka-no-me/android-cmake

I've introduced a PR on the Crystax project to fix the problem,
although I do not know if I'm actually addressing the root cause. My
assumption is that the C language is already enabled, but they invoke
enable_language(C) anyway for some reason.

https://github.com/crystax/android-platform-ndk/pull/16
-- 

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] enable_language behavior change

2017-03-23 Thread Brad King
On 03/23/2017 11:35 AM, Robert Dailey wrote:
> Thanks Brad. For future reference, are these changes documented
> anywhere? I searched for "enable_language" in the 3.6 release notes,
> and there is no 3.6 entry for policy changes.

The release notes are for new features, deprecations, and major
user-facing changes.  We do not cloud them with every bug fix.

This enable_language change was a bug fix that prevented a crash
in some cases.  I was not aware that there were valid projects
that trigger the error.

-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] enable_language behavior change

2017-03-23 Thread Robert Dailey
On Thu, Mar 23, 2017 at 10:33 AM, Brad King  wrote:
> On 03/23/2017 11:16 AM, Robert Dailey wrote:
>> I remember around cmake v3.6, the behavior of enable_language()
>> changed so that if you did it too many times, you'd get the error:
>>
>> Language 'C' is currently being enabled.  Recursive call not allowed.
>>
>> I need to implement some backward compatibility code to check of CMake
>> version less than 3.6 (or appropriate version), then still call
>> enable_language(), otherwise do not call it.
>>
>> Is 3.6 the correct version in which this behavior was introduced?
>
> Yes.  It was commit v3.6.0-rc1~293^2.

Thanks Brad. For future reference, are these changes documented
anywhere? I searched for "enable_language" in the 3.6 release notes,
and there is no 3.6 entry for policy changes.
-- 

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] enable_language behavior change

2017-03-23 Thread Brad King
On 03/23/2017 11:16 AM, Robert Dailey wrote:
> I remember around cmake v3.6, the behavior of enable_language()
> changed so that if you did it too many times, you'd get the error:
> 
> Language 'C' is currently being enabled.  Recursive call not allowed.
> 
> I need to implement some backward compatibility code to check of CMake
> version less than 3.6 (or appropriate version), then still call
> enable_language(), otherwise do not call it.
> 
> Is 3.6 the correct version in which this behavior was introduced?

Yes.  It was commit v3.6.0-rc1~293^2.

-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] VS Project Settings User Defines

2017-03-23 Thread Brad King
On 03/23/2017 11:15 AM, Wesley Smith wrote:
> the solution here is to add something like the VS_GLOBAL_
> prefix or somehow attach custom flags to a target config
> e.g. attach a flag to the Debug|x64 config of target X.

Once could either try to add a property prefix like that
or add dedicated VS_... properties to activate specific
features.  We have some of the latter already IIRC.

-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] enable_language behavior change

2017-03-23 Thread Robert Dailey
I remember around cmake v3.6, the behavior of enable_language()
changed so that if you did it too many times, you'd get the error:

Language 'C' is currently being enabled.  Recursive call not allowed.

I need to implement some backward compatibility code to check of CMake
version less than 3.6 (or appropriate version), then still call
enable_language(), otherwise do not call it.

Is 3.6 the correct version in which this behavior was introduced?
-- 

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] VS Project Settings User Defines

2017-03-23 Thread Wesley Smith
The only reference I've been able to find to this property is via the
VisualStudio SDK https://msdn.microsoft.com/en-us/library/hh710870.aspx .
It doesn't seem to be part of any compiler configuration.  The conclusion
here being that none of the flags in the VS tables map to this XML tag.  I
wonder if the solution here is to add something like the VS_GLOBAL_ prefix
or somehow attach custom flags to a target config e.g. attach a flag to the
Debug|x64 config of target X.


  CustomValue


On Thu, Mar 23, 2017 at 7:51 AM, Brad King  wrote:

> On 03/23/2017 10:41 AM, Wesley Smith wrote:
> > Specifically, I'm trying to add these tags:
> >
> > ..\..\add-in.ruleset
> > true
> >
> > per-config tags are added via Flag arguments,
>
> What are the corresponding command-line flags that these add?
> If they appear in `Source/cmVS*CLFlagTable.h` then adding the
> flags in `CMAKE_C_FLAGS` or other places we support flags will
> reverse-map into the vcxproj file settings.
>
> -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] VS Project Settings User Defines

2017-03-23 Thread Brad King
On 03/23/2017 10:41 AM, Wesley Smith wrote:
> Specifically, I'm trying to add these tags:
> 
> ..\..\add-in.ruleset
> true
> 
> per-config tags are added via Flag arguments,

What are the corresponding command-line flags that these add?
If they appear in `Source/cmVS*CLFlagTable.h` then adding the
flags in `CMAKE_C_FLAGS` or other places we support flags will
reverse-map into the vcxproj file settings.

-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] VS Project Settings User Defines

2017-03-23 Thread Wesley Smith
Hi,
I'm trying to figure out if it's possible to add user defined XML entries
to the project config section of a visual studio file.  From what I can see
it's not, but maybe someone here know of a code path I haven't come across.

Specifically, I'm trying to add these tags:

..\..\add-in.ruleset
true

These are added on a per-config basis.  From what I can see, per-config
tags are added via Flag arguments, which are hard coded into the source.
Basically, I need to get some data into the FlagMap written by

void cmVisualStudioGeneratorOptions::OutputFlagMap(std::ostream& fout,
   const char* indent)

The tags written in its calling function
(cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged)
are also hard coded, so I believe this is the only place possible for
dynamically generating tags.


Any ideas?

thanks!
wes
-- 

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