[CMake] Workaround for CMP0026
NoRulez
norulez at me.com
Thu Feb 5 04:22:43 EST 2015
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.
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.
Is this really the right way?
Best Regards
> Am 04.02.2015 um 20:24 schrieb Stephen Kelly <steveire at gmail.com>:
>
> NoRulez wrote:
>
>> Hello,
>>
>> currently I'm updating my CMake scripts to use newer features and/or to
>> solve some old workarounds.
>
> I think you're looking for
>
>
> file(GENERATE
> OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dirInstallScript.cmake"
> CONTENT "
> if (CMAKE_INSTALL_CONFIG_NAME STREQUAL RELEASE)
> file(INSTALL DESTINATION
> \"\${CMAKE_INSTALL_PREFIX}/share/myproj\" TYPE DIRECTORY
> FILES \"$<TARGET_FILE_DIR:mn>/MyDir\")
> endif()")
>
> install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/dirInstallScript.cmake")
>
>
> 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
More information about the CMake
mailing list