[CMAKE]
authorSylvain Petreolle <spetreolle@yahoo.fr>
Sat, 25 Sep 2010 15:36:17 +0000 (15:36 +0000)
committerSylvain Petreolle <spetreolle@yahoo.fr>
Sat, 25 Sep 2010 15:36:17 +0000 (15:36 +0000)
Add add_minicd_target and add_minicd macros.

svn path=/branches/cmake-bringup/; revision=48876

CMakeMacros.cmake

index 9a77fba..bc73fee 100644 (file)
@@ -1,4 +1,4 @@
-\r
+
 MACRO(_PCH_GET_COMPILE_FLAGS _target_name _out_compile_flags _header_filename)\r
 \r
     # Add the precompiled header to the build\r
@@ -56,6 +56,7 @@ if (NOT MSVC)
 MACRO(CreateBootSectorTarget _target_name _asm_file _object_file)\r
 \r
     get_filename_component(OBJECT_PATH ${_object_file} PATH)\r
+    get_filename_component(OBJECT_NAME ${_object_file} NAME)\r
     file(MAKE_DIRECTORY ${OBJECT_PATH})\r
     get_directory_property(defines COMPILE_DEFINITIONS)\r
     get_directory_property(includes INCLUDE_DIRECTORIES)\r
@@ -114,3 +115,27 @@ MACRO(ADD_INTERFACE_DEFINITIONS TARGET)
   ENDFOREACH()\r
   ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${OBJECTS})\r
 ENDMACRO()\r
+\r
+MACRO(add_minicd_target _targetname _dir _nameoncd)\r
+    get_target_property(FILENAME ${_targetname} LOCATION)\r
+\r
+    add_custom_command(\r
+        OUTPUT ${REACTOS_BINARY_DIR}/boot/bootcd/${_dir}/${_nameoncd}        \r
+        COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${BOOTCD_DIR}/${_dir}/${_nameoncd})\r
+        \r
+    add_custom_target(${_targetname}_minicd DEPENDS ${BOOTCD_DIR}/${_dir}/${_nameoncd})\r
+\r
+    add_dependencies(${_targetname}_minicd ${_targetname})\r
+    add_dependencies(minicd ${_targetname}_minicd)\r
+ENDMACRO(add_minicd_target _targetname _dir _nameoncd)\r
+\r
+MACRO(add_minicd FILENAME _dir _nameoncd)\r
+    add_custom_command(\r
+        OUTPUT ${BOOTCD_DIR}/${_dir}/${_nameoncd}\r
+        DEPENDS ${FILENAME}\r
+        COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${BOOTCD_DIR}/${_dir}/${_nameoncd})\r
+        \r
+    add_custom_target(${_nameoncd}_minicd DEPENDS ${BOOTCD_DIR}/${_dir}/${_nameoncd})\r
+    \r
+    add_dependencies(minicd ${_nameoncd}_minicd)\r
+ENDMACRO(add_minicd)\r