24b6ba2e4f1a47ee8993961dfdd001ed5f86a2e2
[reactos.git] / reactos / boot / bootdata / packages / CMakeLists.txt
1 #reactos.dff
2
3 # reactos.dff is the concatenation of two files :
4 # - reactos.dff.in, which is a static one and can be altered to
5 # add custom modules/files to reactos.cab
6 # - reactos.dff.dyn (dyn as dynamic) which is generated at configure time by our cmake scripts
7 # If you want to slip-stream anything into the bootcd, then you want to alter reactos.dff.in
8
9 # Idea taken from there : http://www.cmake.org/pipermail/cmake/2010-July/038028.html
10 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/concat.cmake "
11 file(READ \${SRC1} S1)
12 file(READ \${SRC2} S2)
13 file(WRITE \${DST} \"\${S1}\${S2}\")
14 ")
15
16 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn "")
17
18 add_custom_command(
19 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff
20 COMMAND ${CMAKE_COMMAND} -D SRC1=${CMAKE_CURRENT_SOURCE_DIR}/reactos.dff.in
21 -D SRC2=${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn
22 -D DST=${CMAKE_CURRENT_BINARY_DIR}/reactos.dff
23 -P ${CMAKE_CURRENT_BINARY_DIR}/concat.cmake
24 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/reactos.dff.in
25 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn
26 )
27
28 # And now we build reactos.cab
29
30 # First we create reactos.inf
31 add_custom_command(
32 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf
33 COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -L ${CMAKE_CURRENT_BINARY_DIR} -I -P ${REACTOS_SOURCE_DIR}
34 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff native-cabman)
35
36 # Then we create the actual cab file using a custom target
37 # Please do not change this into custom command + custom target. This breaks reactos.cab dependencies on modules
38 # and you can't do something like "make gdi32/fast reactos_cab/fast bootcd/fast"
39 add_custom_target(reactos_cab
40 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}
41 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf native-cabman)
42
43 add_cd_file(TARGET reactos_cab FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf DESTINATION reactos NO_CAB FOR bootcd regtest)