[CMake] Question about CMakeLists.txt with regards to installation

Jeremy Strange alaterale at elitemail.org
Wed Oct 13 12:51:41 EDT 2004


Hi,
I figured it out.  I think it was because the install directive was
above the library directive in terms of the real directories.  I fixed
it by having my root CMakeLists.txt contain everything for the project,
including the ADD_LIBRARIES directives.  Now everything installs great,
thanks!

On Tue, 12 Oct 2004 21:26:01 -0400, "Brad King" <brad.king at kitware.com>
said:
> Jeremy Strange wrote:
> > Hi!
> > Thanks for the quick reply on that, both of you, I really appreciate it!
> > :)
> > That helped me a lot, I couldn't figure out how to use INSTALL_FILES
> > from the docs.
> 
> That probably means the docs should be updated.  What did you find 
> confusing about them?  Now that you see how it works, please suggest a 
> change that would have helped you understand it from the docs.  Thanks.

Well, I think something could be added to the current doc for that at
least.  Here is where my confusion lied:

"INSTALL_FILES(<dir> extension file file ...)
Create rules to install the listed files with the given extension into
the given directory. Only files existing in the current source tree or
its corresponding location in the binary tree may be listed. If a file
specified already has an extension, that extension will be removed
first. This is useful for providing lists of source files such as
foo.cxx when you want the corresponding foo.h to be installed. Atypical
extension is '.h'."

The part about "If a file specified already has an extension, that
extension will be removed first" was confusing to me, as I thought it
meant if you were installing header files (mine were extension .hpp)
that it would remove the .hpp or something, when it did not do this at
all, but instead did exactly what I wanted: install the headers to a
directory.

Also, "This is useful for providing lists of source files such as
foo.cxx when you want the corresponding foo.h to be installed. Atypical
extension is '.h'" was confusing for some reason.  I think it would be
better worded as something like "This is useful for installing your
source's header files along with your target" or "A common use of this
directive is to install header files (e.g. .h or .hpp files)"  I don't
know if that makes it any better, as I'm not the greatest at describing
things, but I think it would be useful to have it clearcut that this can
be used for installing headers, and maybe include an example of doing so
like what was suggested to me.

I hope this helps in some way.  Thanks for helping me get my project set
up right :)

~~J
____________

All of us are looking at the sky, but some of us are looking at the stars.



More information about the CMake mailing list