[CMake] Small, complete CPack example?

Chris Wolf cw10025 at gmail.com
Thu Aug 5 18:05:03 EDT 2010



On 8/5/10 5:15 PM, Olaf van der Spek wrote:
> On Thu, Aug 5, 2010 at 11:06 PM, Chris Wolf <cw10025 at gmail.com> wrote:
>> I'm looking all over for an end-to-end basic example of using CPack
>> to create a package with a single shared library target.  It can
>> even be with the TGZ generator.
> 
> cmake_minimum_required(VERSION 2.4)
> set(CMAKE_BUILD_TYPE release)
> include_directories(.)
> add_library(
>         xbt SHARED
>         sql/database.cpp
>         sql/sql_query.cpp
>         sql/sql_result.cpp
> )
> install(DIRECTORY xbt DESTINATION include FILES_MATCHING PATTERN *.h
> PATTERN .svn EXCLUDE)
> install(TARGETS xbt DESTINATION lib)
> 

Ok, that worked (after I added "include(CPack)") - thanks for that.  

Unfortunately, at first, I din't see how your example is different from 
the parts of my CMakeList.txt I sent in my last post.

Then I noticed that your "install(TARGETS..." command had a relative
path for "DESTINATION", whereas mine had an absolute path.  When 
I changed to a relative path, it worked...

Thanks for the help!

P.S. this CMake is a dream (even with my one day experience) compared to autoconf/libtool, etc.



More information about the CMake mailing list