[CMake] Install files at absolute position?

Andy Cedilnik andy.cedilnik at kitware.com
Wed Jan 18 09:40:52 EST 2006


Hi Zach,

There is a way to do installing using custom install script. What you do 
is to create a cmake script that does whatever you want and then set on 
some target a pre and/or post install script:

SET_TARGET_PROPERTIES(myLib PROPERTIES PRE_INSTALL_SCRIPT 
"${CMAKE_CURRENT_BINARY_DIR}/some_pre_install.cmake"
  POST_INSTALL_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/some_post_install.cmake")


Then you can put in that file:
FILE(INSTALL DESTINATION "/etc" TYPE FILE FILES 
"/home/andy/MyProject/myetc.file")

Andy


Zachary Pincus wrote:

> Hello again,
>
> I'm wondering if there is any good way to have CMake install a  
> particular file at an absolute position in the filesystem (not  
> prefixed by CMAKE_INSTALL_PREFIX) during 'make install'.
>
> It's clearly possible to send a file to any given location during the  
> configure or build step, but it's more appropriate to do this during  
> install, in my case.
>
> Any thoughts? (and yes, the files do need to be at specific  
> positions; for example in a python site-packages directory).
>
> Thanks,
>
> Zach
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake



-- 
Andy Cedilnik
Kitware Inc.



More information about the CMake mailing list