CMake: generic: ZynqMP R5: udpate to use libxil, libmetal
[processor-sdk/open-amp.git] / apps / linux_firmware_remoteproc_slave / CMakeLists.txt
2 file (GLOB _c_srcs *.c)
3 file (GLOB _asm_srcs *.S *.s)
5 set (_fw_dir "${APPS_SHARE_DIR}")
7 collector_list (_list PROJECT_INC_DIRS)
8 include_directories (${_list} ${CMAKE_CURRENT_SOURCE_DIR})
10 collector_list (_list PROJECT_LIB_DIRS)
11 link_directories (${_list})
12 include_directories (${CMAKE_CURRENT_SOURCE_DIR})
14 add_executable (firmware-lnx ${_c_srcs} ${_asm_srcs})
15 set_target_properties (firmware-lnx
16   PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
18 set (_cflags "${CMAKE_C_FLAGS}")
19 set_source_files_properties(${_asm_srcs} PROPERTIES COMPILE_FLAGS "${_cflags}")
21 target_link_libraries(firmware-lnx -nostartfiles -T\"${CMAKE_CURRENT_SOURCE_DIR}/link_remote.ld\" -Wl,--start-group -lc -lm -lstdc++ -lzlib -lfdt -Wl,--end-group)
23 add_dependencies (firmware-lnx image.ub)
25 add_custom_command (OUTPUT image.ub
26   COMMAND cp ${OPENAMP_ROOT_DIR}/obsolete/system/${PROJECT_SYSTEM}/machine/${PROJECT_MACHINE}/image.ub image.ub)
28 add_custom_command (OUTPUT ${_fw_dir}
29   COMMAND mkdir -p ${_fw_dir})
31 add_custom_target (lnx-fw-bin-gen ALL
32   DEPENDS firmware-lnx ${_fw_dir}/firmware1.o ${_fw_dir}/firmware2.o)
34 add_custom_target (firmware1.o ALL cp firmware-lnx firmware1
35   COMMAND ${CROSS_PREFIX}objcopy -I binary -O elf32-littlearm -B arm firmware1 ${_fw_dir}/firmware1.o
36   DEPENDS firmware-lnx ${_fw_dir})
38 add_custom_target (firmware2.o ALL cp firmware-lnx firmware2
39   COMMAND ${CROSS_PREFIX}objcopy -I binary -O elf32-littlearm -B arm firmware2 ${_fw_dir}/firmware2.o
40   DEPENDS firmware-lnx ${_fw_dir})