diff --git a/reactos/boot/freeldr/freeldr/CMakeLists.txt b/reactos/boot/freeldr/freeldr/CMakeLists.txt index 33ade8c016e..450a58af6be 100644 --- a/reactos/boot/freeldr/freeldr/CMakeLists.txt +++ b/reactos/boot/freeldr/freeldr/CMakeLists.txt @@ -226,10 +226,13 @@ endif() 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 DESTINAT 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) diff --git a/reactos/cmake/CMakeMacros.cmake b/reactos/cmake/CMakeMacros.cmake index 4b9291540f2..8a0bb4bc352 100644 --- a/reactos/cmake/CMakeMacros.cmake +++ b/reactos/cmake/CMakeMacros.cmake @@ -504,33 +504,12 @@ elseif(USE_FOLDER_STRUCTURE) 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})