On 01/17/2011 02:53 PM, Ilja Golshtein wrote:
> Hello, list,
> 
> please, suggest proper way to do some text file modifications while Install.
> 
> Basically I need something similar with RPATH change Cmake does,
> but against a configuration file.
> 
> Currently I create amended version of the config make-time and
> use it install-time. It does not look like an elegant solution.
> 
> Ideas how to do it better?

You might use INSTALL(CODE ...) or INSTALL(SCRIPT ...) to perform last-
minute modifications at installation time, but I'm not sure if one can
reliably force these commands to be run before INSTALL(FILES ...) & Co.

Alternatively, you could provide your own installation target, e.g.:

ADD_CUSTOM_TARGET(myinstall
    COMMAND <modify-config-files>
    COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake
)

or

ADD_CUSTOM_TARGET(myinstall
    COMMAND <modify-config-files>
    COMMAND ${CMAKE_COMMAND}
        --build ${CMAKE_BINARY_DIR} --target install
)

However, a dependency of the built-in "install" target on a custom
"preinstall" target doing the desired modifications would be a really
clean solution, IMO - provided you don't want to heed Michael's advice.
So, you should perhaps consider to vote for 8438 when the question for
the most welcome bug fixes and features for CMake 2.8.5 will be raised.

Regards,

Michael
_______________________________________________
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to