project_files/hwc/CMakeLists.txt
branchwebgl
changeset 9976 a9c8f3f11c71
parent 9267 dbd18257be8f
child 9978 6199f64d3f8a
--- a/project_files/hwc/CMakeLists.txt	Wed Jan 08 13:04:50 2014 +0400
+++ b/project_files/hwc/CMakeLists.txt	Wed Jan 08 16:43:49 2014 +0100
@@ -36,19 +36,21 @@
     get_filename_component(sourcename ${sourcefile} NAME_WE) #drops .pas
     list(APPEND engine_sources "${CMAKE_CURRENT_BINARY_DIR}/${sourcename}.c")
 
+endforeach()
+
+
     #invoke pas2c on each pas files
-    add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${sourcename}.c"
+    add_custom_command(OUTPUT ${engine_sources}
                        COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}"
-                       ARGS -n "${sourcename}"
+                       ARGS -n "hwengine"
                             -i "${CMAKE_SOURCE_DIR}/hedgewars"
                             -o "${CMAKE_CURRENT_BINARY_DIR}"
                             -a "${CMAKE_CURRENT_BINARY_DIR}"
                        DEPENDS pas2c                                            #converter tool
-                               ${sourcefile}                                    #original pascal file
+                               ${engine_sources_pas}                                    #original pascal file
                                ${CMAKE_SOURCE_DIR}/hedgewars/pas2cSystem.pas    #special, external functions
                                ${CMAKE_SOURCE_DIR}/hedgewars/pas2cRedo.pas      #special, fpcrtl_ functions
                       )
-endforeach()
 
 #wrap conversion for all source in this command
 add_custom_target(engine_c DEPENDS ${engine_sources})