MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0011289 | CMake | Modules | public | 2010-10-05 09:03 | 2011-06-06 18:25 |
Reporter | Steffen Hansen | ||||
Assigned To | David Cole | ||||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | OS | OS Version | |||
Product Version | CMake-2-8 | ||||
Target Version | Fixed in Version | CMake 2.8.4 | |||
Summary | 0011289: Add functionality to GetPrerequisites to extract DLL names from stub .LIB files on Windows | ||||
Description | I needed to include some DLLs in my projects installer that were not explicitly linked to by any executable (ie, runtime loaded instead). The output of FindLibrary() is just the name/location of the .LIB stub file and not the DLL itself, so I needed a way to get to the DLL name/path. The tool to use is dumpbin.exe, which is nicely discovered by GetPrerequisites, and since I think my code might be useful in general, maybe it could be included in GetPrerequisites in one form or another. Code snippet below: MACRO(DLL_NAMES_FROM_LIB_CMAKE libname paths output) EXECUTE_PROCESS(COMMAND ${gp_cmd} /HEADERS "${libname}" OUTPUT_VARIABLE _dumpbin_out RESULT_VARIABLE _result ERROR_VARIABLE _error_out ) IF(NOT ${RESULT_VARIABLE} EQUAL 0) MESSAGE(WARNING "${gp_cmd} did not work: ${_error_out}") SET(${output} "NOT-FOUND") ELSE() STRING(REGEX MATCHALL "DLL name *: ([^\\\n]+)\\\n" _dlls "${_dumpbin_out}") STRING(REGEX REPLACE "DLL name *: ([^\\\n]+)\\\n" "\\1" _dlls "${_dlls}") LIST(REMOVE_DUPLICATES _dlls) SET(${output} "") FOREACH( _dll ${_dlls}) FIND_FILE(_dllpath ${_dll} PATHS ${paths}) SET(${output} ${${outout}} ${_dllpath}) ENDFOREACH() ENDIF() ENDMACRO() | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2010-10-05 09:03 | Steffen Hansen | New Issue | |||
2010-10-05 09:20 | Steffen Hansen | Note Added: 0022409 | |||
2010-10-05 17:45 | Bill Hoffman | Status | new => assigned | ||
2010-10-05 17:45 | Bill Hoffman | Assigned To | => David Cole | ||
2011-02-03 17:19 | David Cole | Note Added: 0025255 | |||
2011-02-03 17:19 | David Cole | Status | assigned => resolved | ||
2011-02-03 17:19 | David Cole | Fixed in Version | => CMake 2.8.4 | ||
2011-02-03 17:19 | David Cole | Resolution | open => no change required | ||
2011-06-06 18:25 | David Cole | Status | resolved => closed | ||
2011-06-06 18:25 | David Cole | Note Added: 0026683 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|