[USER.EXE]: Add a *stub* user.exe to make the DirectX 9.0 installer happy (it searche...
[reactos.git] / reactos / subsystems / mvdm / asm16.cmake
index 5c08a2a..eb6d05d 100644 (file)
@@ -38,13 +38,14 @@ function(add_asm16_bin _target _binary_file _base_address)
     # many ASM files is by concatenating them into a single one and
     # compile the resulting file.
     concatenate_files(${_concatenated_asm_file} ${_source_file_list})
+    set_source_files_properties(${_concatenated_asm_file} PROPERTIES GENERATED TRUE)
 
     ##
     ## All this part is the same as CreateBootSectorTarget
     ##
     add_custom_command(
         OUTPUT ${_object_file}
-        COMMAND ${CMAKE_ASM_COMPILER} -x assembler-with-cpp -o ${_object_file} -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm ${_directory_includes} ${_source_file_defines} ${_directory_defines} -D__ASM__ -c ${_concatenated_asm_file}
+        COMMAND ${CMAKE_ASM_COMPILER} -x assembler-with-cpp -o ${_object_file} -I${REACTOS_SOURCE_DIR}/sdk/include/asm -I${REACTOS_BINARY_DIR}/sdk/include/asm ${_directory_includes} ${_source_file_defines} ${_directory_defines} -D__ASM__ -c ${_concatenated_asm_file}
         DEPENDS ${_concatenated_asm_file})
 
     add_custom_command(
@@ -53,9 +54,11 @@ function(add_asm16_bin _target _binary_file _base_address)
         # COMMAND objcopy --output-target binary --image-base 0x${_base_address} ${_object_file} ${_binary_file}
         DEPENDS ${_object_file} native-obj2bin)
 
-    set_source_files_properties(${_object_file} ${_binary_file} PROPERTIES GENERATED TRUE)
-
     add_custom_target(${_target} ALL DEPENDS ${_binary_file})
+    # set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${_target} SUFFIX ".bin")
+    set_target_properties(${_target} PROPERTIES LOCATION_${CMAKE_BUILD_TYPE} ${_binary_file}) ## Support of $<TARGET_FILE:xxx> is limited to add_executable() or add_library()
+    set_target_properties(${_target} PROPERTIES LOCATION ${_binary_file})                     ## Support of $<TARGET_FILE:xxx> is limited to add_executable() or add_library()
+    add_clean_target(${_target})
 endfunction()
 
 else()
@@ -93,6 +96,7 @@ function(add_asm16_bin _target _binary_file _base_address)
     # many ASM files is by concatenating them into a single one and
     # compile the resulting file.
     concatenate_files(${_concatenated_asm_file} ${_source_file_list})
+    set_source_files_properties(${_concatenated_asm_file} PROPERTIES GENERATED TRUE)
 
     ##
     ## All this part is the same as CreateBootSectorTarget
@@ -105,7 +109,7 @@ function(add_asm16_bin _target _binary_file _base_address)
 
     add_custom_command(
         OUTPUT ${_preprocessed_asm_file} ${_object_file}
-        COMMAND ${CMAKE_C_COMPILER} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm ${_directory_includes} ${_source_file_defines} ${_directory_defines} /D__ASM__ /D_USE_ML /EP /c ${_concatenated_asm_file} > ${_preprocessed_asm_file} && ${_pp_asm16_compile_command}
+        COMMAND ${CMAKE_C_COMPILER} /nologo /X /I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm ${_directory_includes} ${_source_file_defines} ${_directory_defines} /D__ASM__ /D_USE_ML /EP /c ${_concatenated_asm_file} > ${_preprocessed_asm_file} && ${_pp_asm16_compile_command}
         DEPENDS ${_concatenated_asm_file})
 
     add_custom_command(
@@ -113,9 +117,11 @@ function(add_asm16_bin _target _binary_file _base_address)
         COMMAND native-obj2bin ${_object_file} ${_binary_file} ${_base_address}
         DEPENDS ${_object_file} native-obj2bin)
 
-    set_source_files_properties(${_object_file} ${_preprocessed_asm_file} ${_binary_file} PROPERTIES GENERATED TRUE)
-
     add_custom_target(${_target} ALL DEPENDS ${_binary_file})
+    # set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${_target} SUFFIX ".bin")
+    set_target_properties(${_target} PROPERTIES LOCATION_${CMAKE_BUILD_TYPE} ${_binary_file}) ## Support of $<TARGET_FILE:xxx> is limited to add_executable() or add_library()
+    set_target_properties(${_target} PROPERTIES LOCATION ${_binary_file})                     ## Support of $<TARGET_FILE:xxx> is limited to add_executable() or add_library()
+    add_clean_target(${_target})
 endfunction()
 
 endif()