diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-08-22 22:33:49 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-08-22 22:33:49 (GMT) |
commit | f05fe5f4146eb6f36b7fac3ba44d77b5e34ffcd1 (patch) | |
tree | 3922c8881984b51343531a32a981143c4fc44cfa | |
parent | b50691bb495319085c187073ea57f800025d3a64 (diff) | |
download | CMake-f05fe5f4146eb6f36b7fac3ba44d77b5e34ffcd1.zip CMake-f05fe5f4146eb6f36b7fac3ba44d77b5e34ffcd1.tar.gz CMake-f05fe5f4146eb6f36b7fac3ba44d77b5e34ffcd1.tar.bz2 |
STYLE: don't use the hack to copy and rename the created executable under
cygwin but instead use the SUFFIX target property (I'll publish a short
article about ecos+cmake RSN)
Alex
-rw-r--r-- | Modules/UseEcos.cmake | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake index a61c484..bd00fe8 100644 --- a/Modules/UseEcos.cmake +++ b/Modules/UseEcos.cmake @@ -150,20 +150,14 @@ MACRO(ECOS_ADD_EXECUTABLE _exe_NAME ) SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_SOURCE_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}") ADD_EXECUTABLE(${_exe_NAME} ${ARGN}) - -#under win32 the ".exe" suffix is appended to the binary name, copy it so that it exists also without the prefix -#otherwise the following custom commands don't work - IF(WIN32) - ADD_CUSTOM_COMMAND(TARGET ${_exe_NAME} POST_BUILD COMMAND cp ARGS ${_exe_NAME}.exe ${_exe_NAME}_ ) - ADD_CUSTOM_COMMAND(TARGET ${_exe_NAME} POST_BUILD COMMAND mv ARGS ${_exe_NAME}_ ${_exe_NAME} ) - ENDIF(WIN32) + SET_TARGET_PROPERTIES(${_exe_NAME} PROPERTIES SUFFIX ".elf") #create a binary file ADD_CUSTOM_COMMAND( TARGET ${_exe_NAME} POST_BUILD COMMAND ${ECOS_ARCH_PREFIX}objcopy - ARGS -O binary ${_exe_NAME} ${_exe_NAME}.bin + ARGS -O binary ${_exe_NAME}.elf ${_exe_NAME}.bin ) #and an srec file @@ -171,11 +165,11 @@ MACRO(ECOS_ADD_EXECUTABLE _exe_NAME ) TARGET ${_exe_NAME} POST_BUILD COMMAND ${ECOS_ARCH_PREFIX}objcopy - ARGS -O srec ${_exe_NAME} ${_exe_NAME}.srec + ARGS -O srec ${_exe_NAME}.elf ${_exe_NAME}.srec ) #add the created files to the make_clean_files - SET(ECOS_ADD_MAKE_CLEAN_FILES ${ECOS_ADD_MAKE_CLEAN_FILES};${_exe_NAME};${_exe_NAME}.bin;${_exe_NAME}.srec;${_exe_NAME}.lst;) + SET(ECOS_ADD_MAKE_CLEAN_FILES ${ECOS_ADD_MAKE_CLEAN_FILES};${_exe_NAME}.bin;${_exe_NAME}.srec;${_exe_NAME}.lst;) SET_DIRECTORY_PROPERTIES( PROPERTIES @@ -192,11 +186,11 @@ MACRO(ECOS_ADD_EXECUTABLE _exe_NAME ) ADD_CUSTOM_TARGET( listing COMMAND echo -e \"\\n--- Symbols sorted by address ---\\n\" > ${_exe_NAME}.lst - COMMAND ${ECOS_ARCH_PREFIX}nm -S -C -n ${_exe_NAME} >> ${_exe_NAME}.lst + COMMAND ${ECOS_ARCH_PREFIX}nm -S -C -n ${_exe_NAME}.elf >> ${_exe_NAME}.lst COMMAND echo -e \"\\n--- Symbols sorted by size ---\\n\" >> ${_exe_NAME}.lst - COMMAND ${ECOS_ARCH_PREFIX}nm -S -C -r --size-sort ${_exe_NAME} >> ${_exe_NAME}.lst + COMMAND ${ECOS_ARCH_PREFIX}nm -S -C -r --size-sort ${_exe_NAME}.elf >> ${_exe_NAME}.lst COMMAND echo -e \"\\n--- Full assembly listing ---\\n\" >> ${_exe_NAME}.lst - COMMAND ${ECOS_ARCH_PREFIX}objdump -S -x -d -C ${_exe_NAME} >> ${_exe_NAME}.lst ) + COMMAND ${ECOS_ARCH_PREFIX}objdump -S -x -d -C ${_exe_NAME}.elf >> ${_exe_NAME}.lst ) ENDMACRO(ECOS_ADD_EXECUTABLE) |