--- boomerang-0.5.2/cmake-scripts/FindCapstone.cmake +++ boomerang-0.5.2/cmake-scripts/FindCapstone.cmake @@ -60,7 +60,7 @@ find_program(Capstone_CSTOOL ) -if (Capstone_CSTOOL) +if (Capstone_CSTOOL AND NOT CMAKE_CROSSCOMPILING) execute_process(COMMAND ${Capstone_CSTOOL} -v OUTPUT_VARIABLE CSTOOL_OUTPUT ) @@ -71,7 +71,14 @@ if (Capstone_CSTOOL) set(Capstone_VERSION_MINOR "${CMAKE_MATCH_2}") set(Capstone_VERSION_PATCH "${CMAKE_MATCH_3}") endif () -endif (Capstone_CSTOOL) +else () + # the target cstool can not run when cross compiling + find_package(PkgConfig QUIET) + if (PKG_CONFIG_FOUND) + pkg_check_modules(PC_Capstone QUIET capstone) + set(Capstone_VERSION "${PC_Capstone_VERSION}") + endif () +endif () if (WIN32)