MantisBT - CMake | ||||||||||
| View Issue Details | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||||
| 0002424 | CMake | CMake | public | 2005-11-01 08:30 | 2016-06-10 14:30 | |||||
| Reporter | Darko Miletic | |||||||||
| Assigned To | Bill Hoffman | |||||||||
| Priority | normal | Severity | major | Reproducibility | always | |||||
| Status | closed | Resolution | moved | |||||||
| Platform | OS | OS Version | ||||||||
| Product Version | ||||||||||
| Target Version | Fixed in Version | |||||||||
| Summary | 0002424: Resource file are being ignored in cmake scripts | |||||||||
| Description | I discovered that implementation of borland makefiel generator is incomplete or incorrect. In version 2.2.1 (beta) rc files are being ignored, that is no command lines are being produced that generate res files. Furthermore these files can not be added to the dll or executable using current settings because bcc32 is not designed to handle res files when passing them to linker. The only way to link resource files to exe or dll is by using borland linker ilink32. This what I did in my script to resolve this issue: PROJECT(Resourcetest) SET (SRC dllmain.cpp ) SET ( RESOURCE_FILES_SRC test.rc ) SET ( RESOURCE_FILES test.res ) ADD_LIBRARY (test SHARED ${SRC}) ADD_CUSTOM_COMMAND ( TARGET test PRE_LINK COMMAND brcc32 ARGS -fo${RESOURCE_FILES} ${RESOURCE_FILES_SRC} ) ADD_CUSTOM_COMMAND ( TARGET test POST_BUILD COMMAND del ARGS "<TARGET>" ) ADD_CUSTOM_COMMAND ( TARGET test POST_BUILD COMMAND del ARGS "<TARGET_BASE>.lib" ) ADD_CUSTOM_COMMAND ( TARGET test POST_BUILD COMMAND ilink32 ARGS ${CMAKE_START_TEMP_FILE}-Gn -Gi -Tpd -aa c0d32.obj <OBJECTS>,<TARGET>,,<LINK_LIBRARIES> cw32mti.lib,,${RESOURCE_FILES}${CMAKE_END_TEMP_FILE} COMMENT "Real build of dll" ) But the real solution for this would be to do following: 1. Add proper handling of rc files - which means to generate separate target that will build res file. 2. Add placeholder <RESOURCE_FILES> that will contain generated res file name(s). 3. Change CMAKE_CXX_CREATE_SHARED_LIBRARY, CMAKE_C_CREATE_SHARED_LIBRARY, CMAKE_C_LINK_EXECUTABLE, CMAKE_CXX_LINK_EXECUTABLE to look like this: CMAKE_CXX_CREATE_SHARED_LIBRARY/CMAKE_C_CREATE_SHARED_LIBRARY - ilink32 ${CMAKE_START_TEMP_FILE}-Gn -Gi -Tpd -aa c0d32.obj <OBJECTS>,<TARGET>,,<LINK_LIBRARIES> cw32mti.lib,,<RESOURCE_FILES>${CMAKE_END_TEMP_FILE} CMAKE_C_LINK_EXECUTABLE/CMAKE_CXX_LINK_EXECUTABLE ilink32 ${CMAKE_START_TEMP_FILE}-Gn -Gi -Tpe -ap c0x32.obj <OBJECTS>,<TARGET>,,<LINK_LIBRARIES> cw32mt.lib,,<RESOURCE_FILES>${CMAKE_END_TEMP_FILE} Of course this is just rough proposal. What needs to be taken into acount is type of RTL we want and is it console or GUI app. Darko | |||||||||
| Steps To Reproduce | ||||||||||
| Additional Information | ||||||||||
| Tags | No tags attached. | |||||||||
| Relationships |
| |||||||||
| Attached Files | ||||||||||
| Issue History | ||||||||||
| Date Modified | Username | Field | Change | |||||||
| 2008-08-21 15:47 | Bill Hoffman | Relationship added | has duplicate 0002738 | |||||||
| 2016-06-10 14:24 | Kitware Robot | Note Added: 0041294 | ||||||||
| 2016-06-10 14:24 | Kitware Robot | Status | assigned => resolved | |||||||
| 2016-06-10 14:24 | Kitware Robot | Resolution | open => moved | |||||||
| 2016-06-10 14:30 | Kitware Robot | Status | resolved => closed | |||||||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||