[CMake] INSTALL project disabled by default in visual studio 8 configuration manager

Tyler Roscoe tyler at cryptio.net
Tue May 5 11:24:42 EDT 2009


On Tue, May 05, 2009 at 10:38:23AM -0400, John Drescher wrote:
> On Tue, May 5, 2009 at 10:09 AM, David Larsson <laserallan at gmail.com> wrote:
> > I've noticed that the INSTALL project generated in visual studio projects
> > when using "install" commands in CMakeLists.txt is disabled by default in
> > the configuration manager.
> > Is it possible to make it enabled by default so I don't have to install it
> > explicitly after each build?
> > The background for the problem is that I want to copy some headers,
> > libraries and dll's to a directory after each build.
> > If installation is something that's generally considered too heavy to be
> > done after each build, is there a good way of expressing file copying in a
> > platform independent way so I can work around it manually?
> 
> Can't you just build the install project instead of a target? That is what I do.

VS users often don't think this way.

On my todo list is figuring out if there's a way to add a dependency on
the psuedo-target "install", much as someone (Andreas?) posted a
solution for adding a dependency on the psuedo-target "test" with a
custom "check" target.

(I think there was a more recent thread but
http://www.mail-archive.com/cmake@cmake.org/msg02495.html is related.)

In the meantime, I do a post-build copy, like this:

        add_custom_command (
            TARGET ${target}
            POST_BUILD
            COMMAND ${CMAKE_COMMAND} -E copy_if_different "${file}" "${dest_dir}/${subdir}"
            VERBATIM
        )


tyler


More information about the CMake mailing list