[CMake] CPack and fixup_bundle

Simon Drouin drouin.simon at gmail.com
Mon Mar 21 16:58:23 EDT 2011


Makes sense once you know. Thanks a lot, I would have searched a long time
for that.

s.

On Fri, Mar 18, 2011 at 2:44 AM, Tyler <tyler at cryptio.net> wrote:

> It's a little obtuse but you need to use \${CMAKE_INSTALL_PREFIX} in that
> first argument to fixup_bundle(). If you don't, ${CMAKE_INSTALL_PREFIX} will
> be evaluated at CMake-time and therefore point to your build-time install
> directory. You want to delay evaluation of that variable until CPack time,
> when it will evaluate to the install directory that CPack uses.
>
> If it makes you feel any better, it took me and another developer quite a
> while to figure this out in our own project :).
>
> Take a look at the ${CMAKE_BINARY_DIR}/cmake_install.cmake generated for
> your project to see what I mean.
>
> hth,
> tyler
>
> On Thu, Mar 17, 2011 at 2:14 PM, Simon Drouin <drouin.simon at gmail.com>wrote:
>
>> I'm trying to use CPack to create a .tar.gz package on linux. I use
>> fixup_bundle from the bundle utility to copy and fix Qt libraries to the
>> bundle.
>>
>> When I use simple 'make install', everything is installed properly in
>> directory specified by CMAKE_INSTALL_PREFIX. When I use CPack, the Qt
>> libraries are still copied to the CMAKE_INSTALL_PREFIX directory and not the
>> package's directory. Here's the code:
>>
>>   # install executable(s)
>>
>> install( TARGETS ${exec_name} DESTINATION . )
>>
>>
>>  # fixup the bundle
>>
>> set( APPS ${CMAKE_INSTALL_PREFIX}/${exec_name} )
>>
>> list( APPEND libSearchDirs ${QT_LIBRARY_DIR})
>>
>> set( additionalLib ${qtsvgiconplugin} )
>>
>> INSTALL(CODE "include(BundleUtilities)
>>
>>     fixup_bundle(\"${APPS}\" \"${additionalLib}\" \"${libSearchDirs}\")" COMPONENT Runtime)
>>
>>
>>  #================================
>>
>> # Packaging
>>
>> #================================
>>
>> set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "My test package")
>>
>> set( CPACK_PACKAGE_NAME ${exec_name} )
>>
>> set( CPACK_PACKAGE_CONTACT "John Smith")
>>
>> set( CPACK_PACKAGE_VENDOR "Company inc.")
>>
>> set( CPACK_PACKAGE_VERSION_MAJOR ${PROG_MAJOR_VERSION})
>>
>> set( CPACK_PACKAGE_VERSION_MINOR ${PROG_MINOR_VERSION})
>>
>> set( CPACK_PACKAGE_VERSION_PATCH ${PROG_PATCH_VERSION})
>>
>> set( CPACK_GENERATOR "TGZ")
>>
>> set( CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CMAKE_SYSTEM_PROCESSOR}")
>>
>> include(CPack)
>>
>>
>> Am I missing something?
>>
>>
>> s.
>>
>>
>> _______________________________________________
>> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110321/91c0e028/attachment.htm>


More information about the CMake mailing list