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

Brad King brad.king at kitware.com
Tue Oct 12 21:26:01 EDT 2004


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.

 > I got my headers installing fine now, right where I want
> them.  The only other problem I'm having is that my library is not being
> installed.  Here's the relevant section of CMakeLists.txt (root):
> <<
> INSTALL_TARGETS(/lib/${PNAME} LibGraphics2D LibUtility)
> 
> where PNAME has been defined as my library name.
> Here's the CMakeLists.txt file in the build dir I have where my
> libraries are compiled:
> <<
> ## Graphics2D
> ADD_LIBRARY(LibGraphics2D Graphics2D.cpp)
> 
> ## Utility
> ADD_LIBRARY(LibUtility Utility.cpp)
> 
> Am I doing something wrong here?  The libraries get compiled, I see
> their .a files, but nothing is getting placed in /usr/local/lib/${PNAME}

Strange.  Is the INSTALL_TARGETS command after the ADD_LIBRARY command 
and in an equal or lower level CMakeLists.txt file?

> Do I have to specify the .a extension?

No, just the target name should be enough.

-Brad


More information about the CMake mailing list