44Finds the Capstone library: 
55
66```cmake 
7- find_package(Capstone) 
7+ find_package(Capstone [<version>] [...] ) 
88``` 
99
1010## Imported targets 
@@ -15,10 +15,8 @@ This module defines the following imported targets:
1515
1616## Result variables 
1717
18- * `Capstone_FOUND` - Whether the package has been found. 
19- * `Capstone_INCLUDE_DIRS` - Include directories needed to use this package. 
20- * `Capstone_LIBRARIES` - Libraries needed to link to the package library. 
21- * `Capstone_VERSION` - Package version, if found. 
18+ * `Capstone_FOUND` - Boolean indicating whether the package is found. 
19+ * `Capstone_VERSION` - The version of package found. 
2220
2321## Cache variables 
2422
@@ -128,17 +126,6 @@ if(NOT Capstone_FOUND)
128126  return ()
129127endif ()
130128
131- # Capstone might be included with <capstone.h> instead of the recommended 
132- # <capstone/capstone.h>. Here both include directories are added so the code can 
133- # work with both includes. The "subdir" can be removed and simplified in the 
134- # future. See: https://github.com/capstone-engine/capstone/issues/1982 
135- set (
136-   Capstone_INCLUDE_DIRS
137-   ${Capstone_INCLUDE_DIR} 
138-   ${Capstone_INCLUDE_DIR} /capstone
139- )
140- set (Capstone_LIBRARIES ${Capstone_LIBRARY} )
141- 
142129if (NOT  TARGET  Capstone::Capstone)
143130  if (IS_ABSOLUTE  "${Capstone_LIBRARY} " )
144131    add_library (Capstone::Capstone UNKNOWN IMPORTED )
@@ -157,9 +144,15 @@ if(NOT TARGET Capstone::Capstone)
157144    )
158145  endif ()
159146
160-   set_target_properties (
161-     Capstone::Capstone
162-     PROPERTIES
163-       INTERFACE_INCLUDE_DIRECTORIES  "${Capstone_INCLUDE_DIRS} " 
147+   set_property (
148+     TARGET  Capstone::Capstone
149+     PROPERTY INTERFACE_INCLUDE_DIRECTORIES 
150+       ${Capstone_INCLUDE_DIR} 
151+       # Capstone might be included with <capstone.h> instead of the recommended 
152+       # <capstone/capstone.h>. Here both include directories are added so the 
153+       # code can work with both includes. The following "subdir" can be removed 
154+       # and simplified in the future. 
155+       # See: https://github.com/capstone-engine/capstone/issues/1982 
156+       ${Capstone_INCLUDE_DIR} /capstone
164157  )
165158endif ()
0 commit comments