1 2if(CMAKE_HOST_WIN32) 3 set(native_suffix ".exe") 4endif() 5 6string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type) 7 8# List of host tools 9list(APPEND host_tools_list bin2c hpp widl gendib cabman fatten isohybrid mkhive mkisofs obj2bin spec2def geninc mkshelllink utf16le xml2sdb) 10if(NOT MSVC) 11 list(APPEND host_tools_list rsym) 12endif() 13 14foreach(_host_tool ${host_tools_list}) 15 if(MSVC_IDE) 16 get_filename_component(_tool_location "${CMAKE_CURRENT_BINARY_DIR}/host-tools/${CMAKE_BUILD_TYPE}/${_host_tool}${native_suffix}" ABSOLUTE) 17 else() 18 get_filename_component(_tool_location "${CMAKE_CURRENT_BINARY_DIR}/host-tools/${_host_tool}${native_suffix}" ABSOLUTE) 19 endif() 20 list(APPEND tools_binaries ${_tool_location}) 21 add_executable(native-${_host_tool} IMPORTED) 22 set_property(TARGET native-${_host_tool} PROPERTY IMPORTED_LOCATION_${_build_type} ${_tool_location}) 23 add_dependencies(native-${_host_tool} host-tools) 24endforeach() 25 26include(ExternalProject) 27 28ExternalProject_Add(host-tools 29 SOURCE_DIR ${REACTOS_SOURCE_DIR} 30 BINARY_DIR ${REACTOS_BINARY_DIR}/host-tools 31 STAMP_DIR ${REACTOS_BINARY_DIR}/host-tools/stamps 32 BUILD_ALWAYS 1 33 PREFIX host-tools 34 EXCLUDE_FROM_ALL 1 35 CMAKE_ARGS "-DNEW_STYLE_BUILD=1;-DARCH:STRING=${ARCH}" 36 INSTALL_COMMAND "" 37 BUILD_BYPRODUCTS ${tools_binaries}) 38