[CMake] Cpack not packaging anything

Thomas Nilsson thomas.nilsson at responsive.se
Mon Nov 26 14:05:00 EST 2012


Eric Noulard skrev 2012-11-26 19:43:

<snip>

>> But my real problem is then that I can't get CPack to work without
>> CPACK_SET_DESTDIR.
>>
>> My (inherited) CMakeList.txt:s does specify
>>
>>      set(CMAKE_INSTALL_PREFIX /usr/local)
>>
>> but also things like
>>
>>      install(... DESTINATION ${BIN_INSTALL_DIR} ...)
>>      set(BIN_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/bin)
>>      set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
>>
>> I am starting to suspect that the expansion of this binds all install
>> targets to the absolute path in CMAKE_INSTALL_PREFIX. And that it instead
>> should be something like
>>
>>      install(... DESTINATION ${BIN_INSTALL_DIR} ...)
>>      set(BIN_INSTALL_DIR bin)
> Precisely!!
> But I doubt the order of definition of your vars is the good one:
>
> set(BIN_INSTALL_DIR bin)
> install(... DESTINATION ${BIN_INSTALL_DIR} ...)
>
> should be the good one.

It actually is, so I'm good there ;-)

> The baseline is
> "Do not use absolute prefix to install(...  DESTINATION ...)
>   unless you really want to put something in absolute place"
>
>   (like  /etc/what/ever.conf)
>
>
And I've fixed that, so now it actually packages the correct files.

But, next question ;-)

Now that I am using a relative (to CMAKE_INSTALL_PREFIX) installation 
scheme, I'd also like to have my TGZ/TZ/ZIP package to work that way. 
But the files in the .tgz have names starting with my application name 
(package name) and then the default install path:

$ tar ztvf cgreen-1.0.0-beta3.tar.gz
-rwxr-xr-x Thomas/None   91772 2012-11-25 21:13 
cgreen-1.0.0-beta3/usr/local/bin/cgreen-runner.exe
-rwxr-xr-x Thomas/None  187260 2012-11-25 21:13 
cgreen-1.0.0-beta3/usr/local/bin/cygcgreen-1.dll
-rw-r--r-- Thomas/None    4552 2012-10-02 16:52 
cgreen-1.0.0-beta3/usr/local/include/cgreen/assertions.h
-rw-r--r-- Thomas/None     659 2012-08-31 00:00 
cgreen-1.0.0-beta3/usr/local/include/cgreen/breadcrumb.h
-rw-r--r-- Thomas/None     463 2012-08-15 19:20 
cgreen-1.0.0-beta3/usr/local/include/cgreen/cdash_reporter.h

So I'd like to lose the "cgreen-1.0.0-beta3/usr/local/" bit. I've hunted 
and experimented with CPACK_INSTALL_PREFIX, 
CPACK_PACKAGE_INSTALL_DIRECTORY, CPACK_PACKAGING_INSTALL_PREFIX, etc. 
etc. most of which are very poorly documented. I even found 
CPACK_TOPLEVEL_TAG which from the docs ("Directory for the installed 
files") looked like it could have something to do with this.

Any assistance would be greatly appreciated!

/Thomas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121126/f21174d3/attachment.htm>


More information about the CMake mailing list