[CMake] CMake/CPack: empty packages

Ryan Pavlik rpavlik at iastate.edu
Mon Feb 15 09:55:19 EST 2010


Don't pass a full path to install(TARGETS - a relative path is needed to 
install in the specified prefix.
Use this instead:
install(TARGETS cmakehello01
            RUNTIME DESTINATION bin)

On 02/15/2010 07:25 AM, Dmitry wrote:
> Hello!
> I've started using CMake not long ago, I'm not very familiar with it 
> yet. I need to generate a package with CMake, but when I try to do it, 
> I get empty packages. This is my CMakeLists.txt file (just a simple 
> "hello, world" application of a single .cpp file):
>
> ==============================
> cmake_minimum_required( VERSION 2.6 )
> project( cmakehello01 )
>
> set( hello_SRCS hello.cpp )
> add_executable( cmakehello01 ${hello_SRCS} )
>
> install(TARGETS cmakehello01 DESTINATION /usr/share/bin)
>
> INCLUDE(CPack)
> ==============================
>
> I run:
> mkdir build
> cd build
> cmake ..
> make
> sudo make install
> sudo make package
>
> and after that I always get three empty packages (.sh, .tar.gz and 
> .Z). What am I doing wrong? I've spent a couple of hours to figure it 
> out, and still have no idea. I've tried to set various CPACK_xxx 
> variables (http://www.cmake.org/Wiki/CMake:Packaging_With_CPack, 
> http://www.cmake.org/Wiki/CMake:CPackConfiguration): it seems they 
> have no effect at all. But, afaik, it's not necessary, since CPack 
> script generates reasonable default values for them. I feel like I've 
> missed something obvious...
>
> I'm working on Fedora 11,
> $ cmake --version
> cmake version 2.6-patch 4
>
> Thanks.
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpavlik at iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100215/10351b0a/attachment-0001.htm>


More information about the CMake mailing list