[CMake] Workaround for CMP0026

Stephen Kelly steveire at gmail.com
Thu Feb 5 14:01:53 EST 2015


NoRulez wrote:

> Thank you for your help.
> 
> I think that for the replacement there is some missing documentation
> outstanding, because i didn't find the "TYPE" attribute in the "file"
> function for example.

I copied and modifier the content from a generated cmake_install.cmake 
script.

The install(SCRIPT) command doesn't specify what can go into such a script. 
That's a gap in the docs.

> Or examples for the CMP0026 policy like in the CMP0043 documentation.
> 
> Nevertheless, I also need to change the filename from
> "dirInstallScript.cmake" to "dirInstallScript$<CONFIG>.cmake" in the
> "file(GENERATE" statement and use the hard coded filename
> "dirInstallScriptRelease.cmake" in the "install(SCRIPT" statement, because
> if i didn't so, I get several warnings/errors when generating with Visual
> Studio generator.

Yes, I didn't test with that generator, but I see why that was needed. I'm 
sure it's possible to avoid hardcoding 'release' in the script. You can 
generate conditions or anything.

> Is this really the right way?

Nope, this is a workaround for lack of generator expression support in the 
install(DIRECTORY) command, similar to 

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e89c8a5

I don't know if that's not possible for any reason, but it seems to be what 
you want.

Thanks,

Steve.




More information about the CMake mailing list