Author: hbelusca
Date: Sun Mar 29 01:53:10 2015
New Revision: 66946
URL:
http://svn.reactos.org/svn/reactos?rev=66946&view=rev
Log:
[CMAKE]
Improve the concatenate_files macro introduced by Timo in r52179 + r52182 and hackfixed in
r53914 . Notice that now it can take an arbitrary number of files to be concatenated.
Hence you need to specify first the output file, and all the rest is the different files.
[FREELDR]
Use the improved concatenate_files macro.
Modified:
trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt
trunk/reactos/cmake/CMakeMacros.cmake
Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/CMake…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Sun Mar 29 01:53:10
2015
@@ -226,10 +226,13 @@
add_dependencies(freeldr_pe asm)
add_dependencies(freeldr_pe_dbg asm)
+# Retrieve the full path to the generated file of the 'freeldr_pe' target
+get_target_property(_freeldr_pe_output_file freeldr_pe LOCATION)
+
concatenate_files(
+ ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
- freeldr_pe
- ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys)
+ ${_freeldr_pe_output_file})
add_custom_target(freeldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys)
@@ -238,9 +241,9 @@
add_cd_file(TARGET freeldr FILE ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys DESTINATION
loader NO_CAB NOT_IN_HYBRIDCD FOR livecd hybridcd NAME_ON_CD setupldr.sys)
concatenate_files(
+ ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
- freeldr_pe
- ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys)
+ ${_freeldr_pe_output_file})
add_custom_target(setupldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys)
add_cd_file(TARGET setupldr FILE ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys DESTINATION
loader NO_CAB FOR bootcd regtest)
Modified: trunk/reactos/cmake/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?re…
==============================================================================
--- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Sun Mar 29 01:53:10 2015
@@ -504,33 +504,12 @@
endfunction()
endif()
-if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
- macro(to_win_path _cmake_path _native_path)
- string(REPLACE "/" "\\" ${_native_path}
"${_cmake_path}")
- endmacro()
-
- # yeah the parameter mess sucks, but thats what works...
- function(concatenate_files _file1 _target2 _output)
- get_target_property(_file2 ${_target2} LOCATION)
- to_win_path("${_file1}" _real_file1)
- to_win_path("${_file2}" _real_file2)
- to_win_path("${_output}" _real_output)
- add_custom_command(
- OUTPUT ${_output}
- COMMAND cmd.exe /C "copy /Y /B ${_real_file1} + ${_real_file2}
${_real_output} > nul"
- DEPENDS ${_file1}
- DEPENDS ${_target2})
- endfunction()
-else()
- macro(concatenate_files _file1 _target2 _output)
- get_target_property(_file2 ${_target2} LOCATION)
- add_custom_command(
- OUTPUT ${_output}
- COMMAND cat ${_file1} ${_file2} > ${_output}
- DEPENDS ${_file1}
- DEPENDS ${_target2})
- endmacro()
-endif()
+macro(concatenate_files _output)
+ add_custom_command(
+ OUTPUT ${_output}
+ COMMAND native-cat ${ARGN} > ${_output}
+ DEPENDS ${ARGN} native-cat)
+endmacro()
function(add_importlibs _module)
add_dependency_node(${_module})