[CMake] Questions about generated install target
Filipe Sousa
filipe at ipb.pt
Tue Feb 7 19:02:46 EST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jon Trauntvein wrote:
> I am starting to experiment with the INSTALL_XXX commands so that I can
> do a reasonable source distribution for my software. Part of what my
> software needs is to have the binaries placed in a given directory
> (/opt/package). I also need to write one or more files to /etc/opt.
> The documentation states that both INSTALL_PROGRAMS and INSTALL_FILES
> will prefix the value of CMAKE_INSTALL_PREFIX to the argument I
> provide. This means that, in order to get the results that I want, I am
> forced to set CMAKE_INSTALL_PREFIX to "/". This seems to be much more
> difficult than it should be and gives me the feeling that I am violating
> some sort of cmake expectation. Any enlightenment would be welcome.
>
> I would also like to be able to insert custom commands into the install
> target that would allow me to do things like creating a directory in
> /var/opt/package but not copying any files. I'm not sure how to
> approach this.
SET_TARGET_PROPERTIES is what you are looking for
SET_TARGET_PROPERTIES(my_target PROPERTIES POST_INSTALL_SCRIPT
${CMAKE_CURRENT_SOURCE_DIR}/my_post_install.cmake)
Use FILE(MAKE_DIRECTORY ...) or MAKE_DIRECTORY(...) in
my_post_install.cmake to create the directory
> Thanks,
>
> Jon Trauntvein
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
>
- --
Filipe Sousa
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFD6TUmbQdNYqwwwCwRAo9EAJ9Zj9I/OvibByaYY5lSv6oJVWqPZgCggFor
NMXG8zD6HYI/UJIUAkhToM0=
=6nw6
-----END PGP SIGNATURE-----
More information about the CMake
mailing list