[CMake] cpack and install locations

Dominique Fober fober at grame.fr
Wed Jan 19 10:03:34 EST 2011


Hi, 

I have a strange and non consistent behavior using cmake and cpack. Here is my 'install' config:
install ( TARGETS ${target}
    	LIBRARY DESTINATION lib
    	ARCHIVE DESTINATION lib
    	PUBLIC_HEADER DESTINATION include/myFolder
)
the target is a shared library with associated public headers that I want to put in a specific folder.

When I run 'sudo make install' on my Ubuntu 10.10 (Maverick 64 bits), everything is ok and my stuff is installed in '/usr/local/lib' and '/usr/local/include/myFolder'. Note that 'myFolder' is created by the 'install' target.

Now I build a .deb package with 'sudo cpack -G DEB'. Again, everything is ok and I get a .deb file that looks nice but with a change in the files destinations that are now '/usr/lib' and '/usr/include/myFolder'.
That's my first question: why is there a difference in the install locations?

The next problem is that installation of the package fails when the specific include folder ('myFolder') doesn't exists. That's also a difference with 'make install'. How can I put my stuff in a folder that doesn't exists and that needs to be created by the installer?

Sorry if the questions have been already answered: I've looked in the list archives but without finding a solution.
--
Dom

ps: I'm using cmake and cpack version 2.8.2 on Ubuntu 10.10 (Maverick 64 bits)
If necessary, I can post my CPackConfig.cmake file.



More information about the CMake mailing list