[WIN32K]
[reactos.git] / ros_cd.cmake
1 #reactos.dff
2 add_custom_command(
3 OUTPUT ${REACTOS_BINARY_DIR}/boot/reactos.dff
4 COMMAND ${CMAKE_COMMAND} -E copy ${REACTOS_SOURCE_DIR}/boot/bootdata/packages/reactos.dff.in ${REACTOS_BINARY_DIR}/boot/reactos.dff
5 DEPENDS ${REACTOS_SOURCE_DIR}/boot/bootdata/packages/reactos.dff.in)
6
7 file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt CAB_TARGET_ENTRIES)
8 foreach(ENTRY ${CAB_TARGET_ENTRIES})
9 string(REGEX REPLACE "^(.*)\t.*" "\\1" _targetname ${ENTRY})
10 string(REGEX REPLACE "^.*\t(.)" "\\1" _dir_num ${ENTRY})
11 get_target_property(_FILENAME ${_targetname} LOCATION)
12 add_custom_command(
13 OUTPUT ${REACTOS_BINARY_DIR}/boot/reactos.dff
14 COMMAND ${CMAKE_COMMAND} -E echo ${_FILENAME} ${_dir_num} >> ${REACTOS_BINARY_DIR}/boot/reactos.dff
15 DEPENDS ${_targetname}
16 APPEND)
17 endforeach()
18
19 file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_cab.txt CAB_TARGET_ENTRIES)
20 foreach(ENTRY ${CAB_TARGET_ENTRIES})
21 string(REGEX REPLACE "^(.*)\t.*" "\\1" _FILENAME ${ENTRY})
22 string(REGEX REPLACE "^.*\t(.)" "\\1" _dir_num ${ENTRY})
23 add_custom_command(
24 OUTPUT ${REACTOS_BINARY_DIR}/boot/reactos.dff
25 COMMAND ${CMAKE_COMMAND} -E echo ${_FILENAME} ${_dir_num} >> ${REACTOS_BINARY_DIR}/boot/reactos.dff
26 DEPENDS ${_FILENAME}
27 APPEND)
28 endforeach()
29
30 #reactos.cab
31 add_custom_command(
32 OUTPUT ${REACTOS_BINARY_DIR}/bootcd/reactos/reactos.inf
33 COMMAND native-cabman -C ${REACTOS_BINARY_DIR}/boot/reactos.dff -L ${REACTOS_BINARY_DIR}/boot/bootcd/reactos -I
34 DEPENDS ${REACTOS_BINARY_DIR}/boot/reactos.dff)
35 add_custom_command(
36 OUTPUT ${REACTOS_BINARY_DIR}/bootcd/reactos/reactos.cab
37 COMMAND native-cabman -C ${REACTOS_BINARY_DIR}/boot/reactos.dff -RC ${REACTOS_BINARY_DIR}/boot/bootcd/reactos/reactos.inf -L ${REACTOS_BINARY_DIR}/boot/bootcd/reactos -N
38 DEPENDS ${REACTOS_BINARY_DIR}/bootcd/reactos/reactos.inf)
39 list(APPEND BOOTCD_FILES ${REACTOS_BINARY_DIR}/bootcd/reactos/reactos.cab)
40
41 #bootcd target
42 set(BOOTCD_DIR "${REACTOS_BINARY_DIR}/boot/bootcd")
43
44 file(MAKE_DIRECTORY
45 "${BOOTCD_DIR}"
46 "${BOOTCD_DIR}/loader"
47 "${BOOTCD_DIR}/reactos"
48 "${BOOTCD_DIR}/reactos/system32")
49
50 file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt MINICD_TARGET_ENTRIES)
51 foreach(ENTRY ${MINICD_TARGET_ENTRIES})
52 string(REGEX REPLACE "^(.*)\t.*\t.*" "\\1" _targetname ${ENTRY})
53 string(REGEX REPLACE "^.*\t(.*)\t.*" "\\1" _DIR ${ENTRY})
54 string(REGEX REPLACE "^.*\t.*\t(.*)" "\\1"_NAMEONCD ${ENTRY})
55 get_target_property(_FILENAME ${_targetname} LOCATION)
56 set(filename ${BOOTCD_DIR}/${_DIR}/${_NAMEONCD})
57 list(APPEND BOOTCD_FILES ${filename})
58 add_custom_command(
59 OUTPUT ${filename}
60 COMMAND ${CMAKE_COMMAND} -E copy ${_FILENAME} ${BOOTCD_DIR}/${_DIR}/${_NAMEONCD}
61 DEPENDS ${_targetname})
62 endforeach()
63
64 file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_minicd.txt MINICD_ENTRIES)
65 foreach(ENTRY ${MINICD_ENTRIES})
66 string(REGEX REPLACE "^(.*)\t.*\t.*" "\\1" _FILENAME ${ENTRY})
67 string(REGEX REPLACE "^.*\t(.*)\t.*" "\\1" _DIR ${ENTRY})
68 string(REGEX REPLACE "^.*\t.*\t(.*)" "\\1"_NAMEONCD ${ENTRY})
69 set(filename ${BOOTCD_DIR}/${_DIR}/${_NAMEONCD})
70 list(APPEND BOOTCD_FILES ${filename})
71 add_custom_command(
72 OUTPUT ${filename}
73 COMMAND ${CMAKE_COMMAND} -E copy ${_FILENAME} ${BOOTCD_DIR}/${_DIR}/${_NAMEONCD}
74 DEPENDS ${_FILENAME})
75 endforeach()
76
77 add_custom_target(bootcd
78 COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/boot/freeldr/bootsect/isoboot.bin ${BOOTCD_DIR} REACTOS ${REACTOS_BINARY_DIR}/minicd.iso
79 DEPENDS ${BOOTCD_FILES})
80
81 add_dependencies(bootcd dosmbr ext2 fat32 fat isoboot isobtrt vgafonts)
82
83 set_directory_properties(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${REACTOS_BINARY_DIR}/minicd.iso)
84
85 #livecd target
86 file(MAKE_DIRECTORY
87 "${LIVECD_DIR}"
88 "${LIVECD_DIR}/loader"
89 "${LIVECD_DIR}/Profiles"
90 "${LIVECD_DIR}/Profiles/All Users"
91 "${LIVECD_DIR}/Profiles/All Users/Desktop"
92 "${LIVECD_DIR}/Profiles/Default User"
93 "${LIVECD_DIR}/Profiles/Default User/Desktop"
94 "${LIVECD_DIR}/Profiles/Default User/My Documents"
95 "${LIVECD_DIR}/reactos"
96 "${LIVECD_DIR}/reactos/inf"
97 "${LIVECD_DIR}/reactos/fonts"
98 "${LIVECD_DIR}/reactos/system32"
99 "${LIVECD_DIR}/reactos/system32/config")
100
101 file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt LIVECD_TARGET_ENTRIES)
102 foreach(ENTRY ${LIVECD_TARGET_ENTRIES})
103 string(REGEX REPLACE "^(.*)\t.*\t.*" "\\1" _targetname ${ENTRY})
104 string(REGEX REPLACE "^.*\t(.*)\t.*" "\\1" _DIR ${ENTRY})
105 string(REGEX REPLACE "^.*\t.*\t(.*)" "\\1"_NAMEONCD ${ENTRY})
106 get_target_property(_FILENAME ${_targetname} LOCATION)
107 set(filename ${LIVECD_DIR}/${_DIR}/${_NAMEONCD})
108 list(APPEND LIVECD_FILES ${filename})
109 add_custom_command(
110 OUTPUT ${filename}
111 COMMAND ${CMAKE_COMMAND} -E copy ${_FILENAME} ${LIVECD_DIR}/${_DIR}/${_NAMEONCD}
112 DEPENDS ${_targetname})
113 endforeach()
114 file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt LIVECD_ENTRIES)
115
116 foreach(ENTRY ${LIVECD_ENTRIES})
117 string(REGEX REPLACE "^(.*)\t.*\t.*" "\\1" _FILENAME ${ENTRY})
118 string(REGEX REPLACE "^.*\t(.*)\t.*" "\\1" _DIR ${ENTRY})
119 string(REGEX REPLACE "^.*\t.*\t(.*)" "\\1"_NAMEONCD ${ENTRY})
120 set(filename ${LIVECD_DIR}/${_DIR}/${_NAMEONCD})
121 list(APPEND LIVECD_FILES ${filename})
122 add_custom_command(
123 OUTPUT ${filename}
124 COMMAND ${CMAKE_COMMAND} -E copy ${_FILENAME} ${LIVECD_DIR}/${_DIR}/${_NAMEONCD}
125 DEPENDS ${_FILENAME})
126 endforeach()
127
128 add_custom_target(livecd
129 COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/boot/freeldr/bootsect/isoboot.bin ${LIVECD_DIR} REACTOS ${REACTOS_BINARY_DIR}/livecd.iso
130 DEPENDS ${LIVECD_FILES})
131 add_dependencies(livecd isoboot livecd_hives vgafonts)
132
133 set_directory_properties(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${REACTOS_BINARY_DIR}/livecd.iso)