View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002424CMakeCMakepublic2005-11-01 08:302016-06-10 14:30
ReporterDarko Miletic 
Assigned ToBill Hoffman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002424: Resource file are being ignored in cmake scripts
DescriptionI 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
TagsNo tags attached.
Attached Files

 Relationships
has duplicate 0002738closedBill Hoffman RC file support for bcc32 

  Notes
(0004091)
Brad King (manager)
2006-05-16 13:34

For #1 look in the files "CMake/Modules/*RC*" for the "resource compiler" language. You'll have to update CMake/Modules/Platforms/Windows-bcc32.cmake to modify the rules to use the Borland resource compiler.

For 0000002 look at CMake/Source/cmLocalGenerator.h for the RuleVariables struct, and at the corresponding .cxx file for the ExpandRuleVariable method that does the replacements. Look for places that create instances of the RuleVariables struct to find where you need to construct the list to pass for substitution into RESOURCE_FILES.

For 0000003 look in CMake/Modules/Platforms/Windows-bcc32.cmake for a place to setup the target creation rules for that platform. Settings in this file will override the default rules.
(0041294)
Kitware Robot (administrator)
2016-06-10 14:24

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 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


Copyright © 2000 - 2018 MantisBT Team