34 #process files .pas -> .c |
34 #process files .pas -> .c |
35 foreach(sourcefile ${engine_sources_pas}) |
35 foreach(sourcefile ${engine_sources_pas}) |
36 get_filename_component(sourcename ${sourcefile} NAME_WE) #drops .pas |
36 get_filename_component(sourcename ${sourcefile} NAME_WE) #drops .pas |
37 list(APPEND engine_sources "${CMAKE_CURRENT_BINARY_DIR}/${sourcename}.c") |
37 list(APPEND engine_sources "${CMAKE_CURRENT_BINARY_DIR}/${sourcename}.c") |
38 |
38 |
|
39 endforeach() |
|
40 |
|
41 |
39 #invoke pas2c on each pas files |
42 #invoke pas2c on each pas files |
40 add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${sourcename}.c" |
43 add_custom_command(OUTPUT ${engine_sources} |
41 COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}" |
44 COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}" |
42 ARGS -n "${sourcename}" |
45 ARGS -n "hwengine" |
43 -i "${CMAKE_SOURCE_DIR}/hedgewars" |
46 -i "${CMAKE_SOURCE_DIR}/hedgewars" |
44 -o "${CMAKE_CURRENT_BINARY_DIR}" |
47 -o "${CMAKE_CURRENT_BINARY_DIR}" |
45 -a "${CMAKE_CURRENT_BINARY_DIR}" |
48 -a "${CMAKE_CURRENT_BINARY_DIR}" |
46 DEPENDS pas2c #converter tool |
49 DEPENDS pas2c #converter tool |
47 ${sourcefile} #original pascal file |
50 ${engine_sources_pas} #original pascal file |
48 ${CMAKE_SOURCE_DIR}/hedgewars/pas2cSystem.pas #special, external functions |
51 ${CMAKE_SOURCE_DIR}/hedgewars/pas2cSystem.pas #special, external functions |
49 ${CMAKE_SOURCE_DIR}/hedgewars/pas2cRedo.pas #special, fpcrtl_ functions |
52 ${CMAKE_SOURCE_DIR}/hedgewars/pas2cRedo.pas #special, fpcrtl_ functions |
50 ) |
53 ) |
51 endforeach() |
|
52 |
54 |
53 #wrap conversion for all source in this command |
55 #wrap conversion for all source in this command |
54 add_custom_target(engine_c DEPENDS ${engine_sources}) |
56 add_custom_target(engine_c DEPENDS ${engine_sources}) |
55 |
57 |
56 |
58 |