Warning, /sdk/elf-dissector/cmake/FindCapstone.cmake is written in an unsupported language. File is not indexed.

0001 find_package(PkgConfig QUIET)
0002 pkg_check_modules(Capstone QUIET IMPORTED_TARGET capstone)
0003 
0004 if (Capstone_FOUND)
0005 # if no include dirs are set, it means we should use the default include dir
0006 if (NOT Capstone_INCLUDE_DIRS)
0007     set(Capstone_INCLUDE_DIRS "/usr/include")
0008 endif()
0009 
0010 # include paths may or may not contain the capstone subdir, make sure we always have it
0011 # that might not be the cleanest way, but it's what newer Capstone versions seem to do, and
0012 # it avoids conflicting with system includes triggering the -isystem bug on older GCC
0013 find_file(_capstone_hdr NAMES "capstone.h" PATHS ${Capstone_INCLUDE_DIRS} NO_DEFAULT_PATH)
0014 if (NOT _capstone_hdr)
0015     set(_capstone_new_include_dirs "")
0016     foreach(_i ${Capstone_INCLUDE_DIRS})
0017         list(APPEND _capstone_new_include_dirs "${_i}/capstone")
0018     endforeach()
0019     set(Capstone_INCLUDE_DIRS ${_capstone_new_include_dirs})
0020     set_target_properties(PkgConfig::Capstone PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${Capstone_INCLUDE_DIRS})
0021 endif()
0022 endif()
0023 
0024 include(FeatureSummary)
0025 set_package_properties(Capstone PROPERTIES
0026     URL "https://www.capstone-engine.org/"
0027     DESCRIPTION "Multi-platform, multi-architecture disassembly framework."
0028 )