[CMake] BundleUtilities and super-build

Michael Wild themiwi at gmail.com
Sat Apr 23 13:16:51 EDT 2011


On 04/23/2011 03:04 PM, Michael Jackson wrote:
> BundleUtilities can not seem to find the QtLibraries. Are you passing in the path to the Qt Libraries as part of the arguments to fixup_bundle?

Yes. As mentioned, the strange thing is that it works when I open the
solution of the sub-project in VS and invoke the INSTALL target
directly. Also, a small example project I set up to debug this issue
builds just fine. So far it seems that the way ExternalProject invokes
the INSTALL target causes the fixup_bundle call to fail, but debugging
this is a PITA and I haven't had the time so far...

> I gave up on bundleUtilities for Windows platforms and use the following macro in its place:
> # --------------------------------------------------------------------
> #
> #
> macro (CMP_QT_LIBRARIES_INSTALL_RULES QTLIBLIST destination)
>    # message(STATUS "CMP_COPY_QT4_RUNTIME_LIBRARIES")
>     if (MSVC)
>         if (DEFINED QT_QMAKE_EXECUTABLE)
>             set(TYPE "d")
>             FOREACH(qtlib ${QTLIBLIST})
>                 
>                 GET_FILENAME_COMPONENT(QT_DLL_PATH_tmp ${QT_QMAKE_EXECUTABLE} PATH)
>                 message(STATUS "Generating Install Rule for Qt Debug DLL Library ${QT_DLL_PATH_tmp}/${qtlib}d4.dll")  
>                 INSTALL(FILES ${QT_DLL_PATH_tmp}/${qtlib}${type}d4.dll 
>                     DESTINATION "${destination}"
>                     CONFIGURATIONS Debug
>                     COMPONENT Applications)
>                 message(STATUS "Generating Install Rule for Qt Release DLL Library ${QT_DLL_PATH_tmp}/${qtlib}4.dll")
>                 INSTALL(FILES ${QT_DLL_PATH_tmp}/${qtlib}4.dll 
>                     DESTINATION "${destination}"
>                     CONFIGURATIONS Release
>                     COMPONENT Applications)                        
>             ENDFOREACH(qtlib)
>         endif(DEFINED QT_QMAKE_EXECUTABLE)
>     endif()
> endmacro()
> 
> and I invoke it with CMP_QT_LIBRARIES_INSTALL_RULES("QtCore;QtGui" "."). The downside is that I have to manually manage which Qt Libraries I need installed but it seems to work just fine.

Thanks, I'll take a look at it.

> Probably not the answer you were looking for but an alternative solution for your issue.

At least not the answer I was _hoping_ for ;-)

Enjoy the holidays!

Michael

> 
> 
> 
> On Apr 23, 2011, at 6:46 AM, Michael Wild wrote:
> 
>> Hi all
>>
>> I'm trying to use BundleUtilities with MSVC 9 to install the required
>> Qt4 DLL's of the GUI sub-project into a common prefix in the super-build
>> binary directory. The process fails with the (abbreviated) output at the
>> end of this message.
>>
>> If I open the sub-project's .sln file directly and run the INSTALL
>> target, it works perfectly fine.
>>
>> Anybody got an idea what is going wrong here?
>>
>>
>> [...]
>> 5>1>-- fixup_bundle
>> 5>1>--
>> app='C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck-gui.exe'
>> 5>1>--   libs=''
>> 5>1>--   dirs='C:/Qt/4.7.2/bin;C:/Qt/4.7.2/lib'
>> 5>1>-- fixup_bundle: preparing...
>> 5>Microsoft (R) COFF/PE Dumper Version 9.00.21022.08
>> 5>Copyright (C) Microsoft Corporation.  All rights reserved.
>> 5>Dump of file
>> C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck-gui.exe
>> 5>File Type: EXECUTABLE IMAGE
>> 5>  Image has the following dependencies:
>> 5>    QtGui4.dll
>> 5>    QtXml4.dll
>> 5>    QtCore4.dll
>> 5>    MSVCP90.dll
>> 5>    MSVCR90.dll
>> 5>    KERNEL32.dll
>> 5>  Summary
>> 5>        1000 .data
>> 5>       38000 .rdata
>> 5>        F000 .reloc
>> 5>        7000 .rsrc
>> 5>       85000 .text
>> 5>1>-- fixup_bundle: copying...
>> 5>1>-- 1/4: *NOT* copying
>> 'C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck-gui.exe'
>> 5>1>-- 2/4: *NOT* copying
>> 'C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck.exe'
>> 5>1>-- fixup_bundle: fixing...
>> 5>1>-- 3/4: fix-up not required on this platform
>> 'C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck-gui.exe'
>> 5>1>-- 4/4: fix-up not required on this platform
>> 'C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck.exe'
>> 5>1>-- fixup_bundle: cleaning up...
>> 5>1>-- fixup_bundle: verifying...
>> 5>1>--
>> ===========================================================================
>> 5>1>-- Analyzing
>> app='C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck-gui.exe'
>> 5>1>-- bundle='C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin'
>> 5>1>--
>> executable='C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck-gui.exe'
>> 5>1>-- valid='1'
>> 5>1>-- executable file 1:
>> C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck-gui.exe
>> 5>1>--
>> 5>1>warning: cannot resolve item 'QtGui4.dll'
>> 5>1>  possible problems:
>> 5>1>    need more directories?
>> 5>1>    need to use InstallRequiredSystemLibraries?
>> 5>1>    run in install tree instead of build tree?
>> 5>1>-- warning: gp_resolved_file_type non-absolute file 'QtGui4.dll'
>> returning type 'other' -- possibly incorrect
>> 5>1>--
>> 5>1>warning: cannot resolve item 'QtGui4.dll'
>> 5>1>  possible problems:
>> 5>1>    need more directories?
>> 5>1>    need to use InstallRequiredSystemLibraries?
>> 5>1>    run in install tree instead of build tree?
>> 5>1>--
>> 5>1>warning: cannot resolve item 'QtXml4.dll'
>> 5>1>  possible problems:
>> 5>1>    need more directories?
>> 5>1>    need to use InstallRequiredSystemLibraries?
>> 5>1>    run in install tree instead of build tree?
>> 5>1>-- warning: gp_resolved_file_type non-absolute file 'QtXml4.dll'
>> returning type 'other' -- possibly incorrect
>> 5>1>--
>> 5>1>warning: cannot resolve item 'QtXml4.dll'
>> 5>1>  possible problems:
>> 5>1>    need more directories?
>> 5>1>    need to use InstallRequiredSystemLibraries?
>> 5>1>    run in install tree instead of build tree?
>> 5>1>--
>> 5>1>warning: cannot resolve item 'QtCore4.dll'
>> 5>1>  possible problems:
>> 5>1>    need more directories?
>> 5>1>    need to use InstallRequiredSystemLibraries?
>> 5>1>    run in install tree instead of build tree?
>> 5>1>-- warning: gp_resolved_file_type non-absolute file 'QtCore4.dll'
>> returning type 'other' -- possibly incorrect
>> 5>1>--
>> 5>1>warning: cannot resolve item 'QtCore4.dll'
>> 5>1>  possible problems:
>> 5>1>    need more directories?
>> 5>1>    need to use InstallRequiredSystemLibraries?
>> 5>1>    run in install tree instead of build tree?
>> 5>1>warning: target 'QtGui4.dll' is not absolute...
>> 5>1>warning: target 'QtGui4.dll' does not exist...
>> 5>1>warning: target 'QtXml4.dll' is not absolute...
>> 5>1>warning: target 'QtXml4.dll' does not exist...
>> 5>1>warning: target 'QtCore4.dll' is not absolute...
>> 5>1>warning: target 'QtCore4.dll' does not exist...
>> 5>1>--
>> 5>1>warning: cannot resolve item 'QtCore4.dll'
>> 5>1>  possible problems:
>> 5>1>    need more directories?
>> 5>1>    need to use InstallRequiredSystemLibraries?
>> 5>1>    run in install tree instead of build tree?
>> 5>1>-- warning: gp_resolved_file_type non-absolute file 'QtCore4.dll'
>> returning type 'other' -- possibly incorrect
>> 5>1>--
>> 5>1>warning: cannot resolve item 'QtGui4.dll'
>> 5>1>  possible problems:
>> 5>1>    need more directories?
>> 5>1>    need to use InstallRequiredSystemLibraries?
>> 5>1>    run in install tree instead of build tree?
>> 5>1>-- warning: gp_resolved_file_type non-absolute file 'QtGui4.dll'
>> returning type 'other' -- possibly incorrect
>> 5>1>--
>> 5>1>warning: cannot resolve item 'QtXml4.dll'
>> 5>1>  possible problems:
>> 5>1>    need more directories?
>> 5>1>    need to use InstallRequiredSystemLibraries?
>> 5>1>    run in install tree instead of build tree?
>> 5>1>-- warning: gp_resolved_file_type non-absolute file 'QtXml4.dll'
>> returning type 'other' -- possibly incorrect
>> 5>1>-- executable file 2:
>> C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck.exe
>> 5>1>-- verified='0'
>> 5>1>-- info='external prerequisites found:
>> 5>1>f='C:/cygwin/home/mwild/cppcheck/build/inst/Release/bin/cppcheck-gui.exe'
>> 5>1>external_prereqs='QtCore4.dll;QtGui4.dll;QtXml4.dll'
>> 5>1>'
>> 5>1>--
>> [...]
> 



More information about the CMake mailing list