From 3f1a4576dd2469dd4e372ad1ee781d2984ad1f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Wed, 13 Aug 2014 16:30:52 +0000 Subject: [PATCH] [CMAKE] - Properly serve reactos.cab dependencies - try 2 CORE-8435 #comment this should do it, please retest. Regarding the bot problem, touching boot/bootdata/packages/reactos.dff forces regenerating reactos.inf and reactos.cab svn path=/trunk/; revision=63878 --- reactos/boot/bootdata/packages/CMakeLists.txt | 16 ++++------- reactos/cmake/CMakeMacros.cmake | 28 +++++++++++++------ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/reactos/boot/bootdata/packages/CMakeLists.txt b/reactos/boot/bootdata/packages/CMakeLists.txt index 3344a23d95f..d65a1049cb6 100644 --- a/reactos/boot/bootdata/packages/CMakeLists.txt +++ b/reactos/boot/bootdata/packages/CMakeLists.txt @@ -31,24 +31,18 @@ add_custom_command( DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn ) -# And now we build reactos.cab - -# First we create reactos.inf +# And now we build reactos.inf add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -L ${CMAKE_CURRENT_BINARY_DIR} -I -P ${REACTOS_SOURCE_DIR} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff native-cabman) -# Then we create the actual cab file using a custom target -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab - COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -RC ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf -L ${CMAKE_CURRENT_BINARY_DIR} -N -P ${REACTOS_SOURCE_DIR} - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf native-cabman) - -add_custom_target(reactos_cab DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab) +# reactos.cab generation will be made later (cf. CMakeMacros.cmake - create iso lists) +add_custom_target(reactos_cab_inf DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf) add_cd_file( TARGET reactos_cab - FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf + FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf DESTINATION reactos NO_CAB FOR bootcd regtest) + diff --git a/reactos/cmake/CMakeMacros.cmake b/reactos/cmake/CMakeMacros.cmake index 716ac07c75d..1a722fa0ded 100644 --- a/reactos/cmake/CMakeMacros.cmake +++ b/reactos/cmake/CMakeMacros.cmake @@ -316,15 +316,11 @@ function(add_cd_file) file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.dyn "\"${__relative_file}\" ${_num}\n") unset(__relative_file) if(_CD_TARGET) - #manage dependency - add_dependencies(reactos_cab ${_CD_TARGET}) - # add this so that the combination make target/fast reactos_cab/fast bootcd/fast properly detects that reactos.cab must be rebuilt - if (CMAKE_BUILD_TOOL STREQUAL "make") - add_custom_command(TARGET ${_CD_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E touch ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff) - endif() + #manage dependency - target level + add_dependencies(reactos_cab_inf ${_CD_TARGET}) endif() + # manage dependency - file level + set_property(GLOBAL APPEND PROPERTY REACTOS_CAB_DEPENDS ${_CD_FILE}) endif() endif() #end bootcd @@ -378,6 +374,22 @@ function(add_cd_file) endfunction() function(create_iso_lists) + # generate reactos.cab before anything else + get_property(_filelist GLOBAL PROPERTY REACTOS_CAB_DEPENDS) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab + COMMAND native-cabman -C ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff -RC ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.inf -N -P ${REACTOS_SOURCE_DIR} + DEPENDS ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.inf native-cabman ${_filelist}) + + add_custom_target(reactos_cab DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab) + add_dependencies(reactos_cab reactos_cab_inf) + + add_cd_file( + TARGET reactos_cab + FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab + DESTINATION reactos + NO_CAB FOR bootcd regtest) + get_property(_filelist GLOBAL PROPERTY BOOTCD_FILE_LIST) string(REPLACE ";" "\n" _filelist "${_filelist}") file(APPEND ${REACTOS_BINARY_DIR}/boot/bootcd.lst "${_filelist}")