[CMake] CMake and response files
Trevor Kellaway
tkellaway at asl-electronics.co.uk
Sat May 26 18:40:03 EDT 2007
Hi,
[Summary: does anyone know if it is possible to create response files
with GNU make?]
For Windows CMake currently supports Microsoft's and Borland's response
files, from Windows.cmake:
# for borland make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use
IF(CMAKE_GENERATOR MATCHES "Borland")
SET(CMAKE_START_TEMP_FILE "@&&|\n")
SET(CMAKE_END_TEMP_FILE "\n|")
ENDIF(CMAKE_GENERATOR MATCHES "Borland")
# for nmake make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use
IF(CMAKE_GENERATOR MATCHES "NMake")
SET(CMAKE_START_TEMP_FILE "@<<\n")
SET(CMAKE_END_TEMP_FILE "\n<<")
ENDIF(CMAKE_GENERATOR MATCHES "NMake")
I have an embedded linker that requires an automatically built response
file, and would like to be able to use this with MinGW's GNU make, does
anyone know if it is possible to create response files with GNU make?
(I've been through the manual but can't see anything obvious).
Having to generate all the link information in a single line invocation
can be fairly difficult with embedded linkers, an example:
SET (CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <LINK_FLAGS> -B
${CMAKE_START_TEMP_FILE} LINK <TARGET> NAMES <OBJECTS> <LINK_LIBRARIES>
END INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/link.prm
${CMAKE_END_TEMP_FILE}")
In my case the "LINK" and "<OBJECTS> <LINK_LIBRARIES>" have to be in a
response file, not directly on the command line.
- TrevK
More information about the CMake
mailing list