blob: 97c3cb6ddbd7984b3fd034ea4f88b133a34cb01b [file] [log] [blame]
daniel96ecc332014-05-18 02:03:15 -07001cmake_minimum_required(VERSION 2.6)
2project(capstone)
3
Nguyen Anh Quynhc0f69e12015-01-30 11:26:26 +08004set(VERSION_MAJOR 4)
5set(VERSION_MINOR 0)
Nguyen Anh Quynhde8c6892014-05-31 10:45:15 +08006set(VERSION_PATCH 0)
Nguyen Anh Quynh56e4efd2014-05-28 16:27:53 +08007
Nguyen Anh Quynh758fcbe2014-05-31 10:44:27 +08008# to configure the options specify them in in the command line or change them in the cmake UI.
9# Don't edit the makefile!
Nguyen Anh Quynh70453c82015-02-03 18:25:12 +080010option(CAPSTONE_BUILD_STATIC_RUNTIME "Embed static runtime" OFF)
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020011option(CAPSTONE_BUILD_STATIC "Build static library" ON)
12option(CAPSTONE_BUILD_SHARED "Build shared library" ON)
13option(CAPSTONE_BUILD_DIET "Build diet library" OFF)
14option(CAPSTONE_BUILD_TESTS "Build tests" ON)
15option(CAPSTONE_USE_DEFAULT_ALLOC "Use default memory allocation functions" ON)
Nguyen Anh Quynha71a27b2014-05-28 21:20:30 +080016
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020017option(CAPSTONE_ARM_SUPPORT "ARM support" ON)
18option(CAPSTONE_ARM64_SUPPORT "ARM64 support" ON)
19option(CAPSTONE_MIPS_SUPPORT "MIPS support" ON)
20option(CAPSTONE_PPC_SUPPORT "PowerPC support" ON)
Yegor Derevenetsebc4ced2014-09-21 19:52:57 +020021option(CAPSTONE_SPARC_SUPPORT "Sparc support" ON)
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020022option(CAPSTONE_SYSZ_SUPPORT "SystemZ support" ON)
23option(CAPSTONE_XCORE_SUPPORT "XCore support" ON)
24option(CAPSTONE_X86_SUPPORT "x86 support" ON)
25option(CAPSTONE_X86_REDUCE "x86 with reduce instruction sets to minimize library" OFF)
Nguyen Anh Quynha8fd71f2014-10-14 07:55:30 +080026option(CAPSTONE_X86_ATT_DISABLE "Disable x86 AT&T syntax" OFF)
reverser160e1982015-04-09 18:28:19 +010027option(CAPSTONE_OSXKERNEL_SUPPORT "Support to embed Capstone into OS X Kernel extensions" OFF)
Nguyen Anh Quynha71a27b2014-05-28 21:20:30 +080028
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020029if (CAPSTONE_BUILD_DIET)
Nguyen Anh Quynh758fcbe2014-05-31 10:44:27 +080030 add_definitions(-DCAPSTONE_DIET)
31endif ()
daniel96ecc332014-05-18 02:03:15 -070032
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020033if (CAPSTONE_USE_DEFAULT_ALLOC)
Nguyen Anh Quynhd765ab22014-06-03 17:38:29 +080034 add_definitions(-DCAPSTONE_USE_SYS_DYN_MEM)
Nguyen Anh Quynh758fcbe2014-05-31 10:44:27 +080035endif ()
36
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020037if (CAPSTONE_X86_REDUCE)
Nguyen Anh Quynh758fcbe2014-05-31 10:44:27 +080038 add_definitions(-DCAPSTONE_X86_REDUCE)
daniel96ecc332014-05-18 02:03:15 -070039endif ()
40
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020041if (CAPSTONE_X86_ATT_DISABLE)
baguette86e84502014-08-17 20:59:05 +020042 add_definitions(-DCAPSTONE_X86_ATT_DISABLE)
43endif ()
44
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +000045## sources
learn_moreb68d6a92015-04-22 19:35:47 +020046set(SOURCES_ENGINE
daniel96ecc332014-05-18 02:03:15 -070047 cs.c
48 MCInst.c
49 MCInstrDesc.c
50 MCRegisterInfo.c
51 SStream.c
52 utils.c
learn_moreb68d6a92015-04-22 19:35:47 +020053)
54set(HEADERS_ENGINE
55 cs_priv.h
56 LEB128.h
57 MathExtras.h
58 MCDisassembler.h
59 MCFixedLenDisassembler.h
60 MCInst.h
61 MCInstrDesc.h
62 MCRegisterInfo.h
63 myinttypes.h
64 osxkernel_inttypes.h
65 SStream.h
66 utils.h
daniel96ecc332014-05-18 02:03:15 -070067 )
Nguyen Anh Quynhf6af5092014-05-28 14:29:20 +080068
learn_more3ff5dc52015-04-22 21:03:47 +020069set(HEADERS_COMMON
70 include/capstone/arm64.h
71 include/capstone/arm.h
72 include/capstone/capstone.h
73 include/capstone/mips.h
74 include/capstone/ppc.h
75 include/capstone/x86.h
76 include/capstone/sparc.h
77 include/capstone/systemz.h
78 include/capstone/xcore.h
79 include/capstone/platform.h
80 )
81
82
Nguyen Anh Quynh0b965452015-04-26 22:54:41 +080083set(TEST_SOURCES test.c test_detail.c test_skipdata.c test_iter.c test_customized_mnem.c)
Nguyen Anh Quynhf6af5092014-05-28 14:29:20 +080084
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +000085## architecture support
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020086if (CAPSTONE_ARM_SUPPORT)
daniel96ecc332014-05-18 02:03:15 -070087 add_definitions(-DCAPSTONE_HAS_ARM)
learn_moreb68d6a92015-04-22 19:35:47 +020088 set(SOURCES_ARM
daniel96ecc332014-05-18 02:03:15 -070089 arch/ARM/ARMDisassembler.c
90 arch/ARM/ARMInstPrinter.c
91 arch/ARM/ARMMapping.c
92 arch/ARM/ARMModule.c
learn_moreb68d6a92015-04-22 19:35:47 +020093 )
94 set(HEADERS_ARM
95 arch/ARM/ARMAddressingModes.h
96 arch/ARM/ARMBaseInfo.h
97 arch/ARM/ARMDisassembler.h
98 arch/ARM/ARMGenAsmWriter.inc
99 arch/ARM/ARMGenDisassemblerTables.inc
100 arch/ARM/ARMGenInstrInfo.inc
101 arch/ARM/ARMGenRegisterInfo.inc
102 arch/ARM/ARMGenSubtargetInfo.inc
103 arch/ARM/ARMInstPrinter.h
104 arch/ARM/ARMMapping.h
105 arch/ARM/ARMMappingInsn.inc
106 arch/ARM/ARMMappingInsnOp.inc
daniel96ecc332014-05-18 02:03:15 -0700107 )
108 set(TEST_SOURCES ${TEST_SOURCES} test_arm.c)
109endif ()
Nguyen Anh Quynhf6af5092014-05-28 14:29:20 +0800110
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200111if (CAPSTONE_ARM64_SUPPORT)
daniel96ecc332014-05-18 02:03:15 -0700112 add_definitions(-DCAPSTONE_HAS_ARM64)
learn_moreb68d6a92015-04-22 19:35:47 +0200113 set(SOURCES_ARM64
daniel96ecc332014-05-18 02:03:15 -0700114 arch/AArch64/AArch64BaseInfo.c
115 arch/AArch64/AArch64Disassembler.c
116 arch/AArch64/AArch64InstPrinter.c
117 arch/AArch64/AArch64Mapping.c
118 arch/AArch64/AArch64Module.c
learn_moreb68d6a92015-04-22 19:35:47 +0200119 )
120 set(HEADERS_ARM64
121 arch/AArch64/AArch64AddressingModes.h
122 arch/AArch64/AArch64BaseInfo.h
123 arch/AArch64/AArch64Disassembler.h
124 arch/AArch64/AArch64GenAsmWriter.inc
125 arch/AArch64/AArch64GenDisassemblerTables.inc
126 arch/AArch64/AArch64GenInstrInfo.inc
127 arch/AArch64/AArch64GenRegisterInfo.inc
128 arch/AArch64/AArch64GenSubtargetInfo.inc
129 arch/AArch64/AArch64InstPrinter.h
130 arch/AArch64/AArch64Mapping.h
131 arch/AArch64/AArch64MappingInsn.inc
daniel96ecc332014-05-18 02:03:15 -0700132 )
133 set(TEST_SOURCES ${TEST_SOURCES} test_arm64.c)
134endif ()
135
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200136if (CAPSTONE_MIPS_SUPPORT)
daniel96ecc332014-05-18 02:03:15 -0700137 add_definitions(-DCAPSTONE_HAS_MIPS)
learn_moreb68d6a92015-04-22 19:35:47 +0200138 set(SOURCES_MIPS
daniel96ecc332014-05-18 02:03:15 -0700139 arch/Mips/MipsDisassembler.c
Nguyen Anh Quynhf6af5092014-05-28 14:29:20 +0800140 arch/Mips/MipsInstPrinter.c
daniel96ecc332014-05-18 02:03:15 -0700141 arch/Mips/MipsMapping.c
142 arch/Mips/MipsModule.c
learn_moreb68d6a92015-04-22 19:35:47 +0200143 )
144 set(HEADERS_MIPS
145 arch/Mips/MipsDisassembler.h
146 arch/Mips/MipsGenAsmWriter.inc
147 arch/Mips/MipsGenDisassemblerTables.inc
148 arch/Mips/MipsGenInstrInfo.inc
149 arch/Mips/MipsGenRegisterInfo.inc
150 arch/Mips/MipsGenSubtargetInfo.inc
151 arch/Mips/MipsInstPrinter.h
152 arch/Mips/MipsMapping.h
153 arch/Mips/MipsMappingInsn.inc
daniel96ecc332014-05-18 02:03:15 -0700154 )
155 set(TEST_SOURCES ${TEST_SOURCES} test_mips.c)
156endif ()
157
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200158if (CAPSTONE_PPC_SUPPORT)
daniel96ecc332014-05-18 02:03:15 -0700159 add_definitions(-DCAPSTONE_HAS_POWERPC)
learn_moreb68d6a92015-04-22 19:35:47 +0200160 set(SOURCES_PPC
daniel96ecc332014-05-18 02:03:15 -0700161 arch/PowerPC/PPCDisassembler.c
162 arch/PowerPC/PPCInstPrinter.c
163 arch/PowerPC/PPCMapping.c
164 arch/PowerPC/PPCModule.c
learn_moreb68d6a92015-04-22 19:35:47 +0200165 )
166 set(HEADERS_PPC
167 arch/PowerPC/PPCDisassembler.h
168 arch/PowerPC/PPCGenAsmWriter.inc
169 arch/PowerPC/PPCGenDisassemblerTables.inc
170 arch/PowerPC/PPCGenInstrInfo.inc
171 arch/PowerPC/PPCGenRegisterInfo.inc
172 arch/PowerPC/PPCGenSubtargetInfo.inc
173 arch/PowerPC/PPCInstPrinter.h
174 arch/PowerPC/PPCMapping.h
175 arch/PowerPC/PPCMappingInsn.inc
176 arch/PowerPC/PPCPredicates.h
daniel96ecc332014-05-18 02:03:15 -0700177 )
178 set(TEST_SOURCES ${TEST_SOURCES} test_ppc.c)
179endif ()
180
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200181if (CAPSTONE_X86_SUPPORT)
daniel96ecc332014-05-18 02:03:15 -0700182 add_definitions(-DCAPSTONE_HAS_X86)
learn_moreb68d6a92015-04-22 19:35:47 +0200183 set(SOURCES_X86
Nguyen Anh Quynha71a27b2014-05-28 21:20:30 +0800184 arch/X86/X86Disassembler.c
185 arch/X86/X86DisassemblerDecoder.c
186 arch/X86/X86IntelInstPrinter.c
187 arch/X86/X86Mapping.c
188 arch/X86/X86Module.c
learn_moreb68d6a92015-04-22 19:35:47 +0200189 )
190 set(HEADERS_X86
191 arch/X86/X86BaseInfo.h
192 arch/X86/X86Disassembler.h
193 arch/X86/X86DisassemblerDecoder.h
194 arch/X86/X86DisassemblerDecoderCommon.h
195 arch/X86/X86GenAsmWriter.inc
196 arch/X86/X86GenAsmWriter1.inc
197 arch/X86/X86GenAsmWriter1_reduce.inc
198 arch/X86/X86GenAsmWriter_reduce.inc
199 arch/X86/X86GenDisassemblerTables.inc
200 arch/X86/X86GenDisassemblerTables_reduce.inc
201 arch/X86/X86GenInstrInfo.inc
202 arch/X86/X86GenInstrInfo_reduce.inc
203 arch/X86/X86GenRegisterInfo.inc
204 arch/X86/X86InstPrinter.h
205 arch/X86/X86Mapping.h
206 arch/X86/X86MappingInsn.inc
207 arch/X86/X86MappingInsnOp.inc
208 arch/X86/X86MappingInsnOp_reduce.inc
209 arch/X86/X86MappingInsn_reduce.inc
Nguyen Anh Quynha71a27b2014-05-28 21:20:30 +0800210 )
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200211 if (NOT CAPSTONE_BUILD_DIET)
learn_moreb68d6a92015-04-22 19:35:47 +0200212 set(SOURCES_X86 ${SOURCES_X86} arch/X86/X86ATTInstPrinter.c)
Nguyen Anh Quynh758fcbe2014-05-31 10:44:27 +0800213 endif ()
daniel96ecc332014-05-18 02:03:15 -0700214 set(TEST_SOURCES ${TEST_SOURCES} test_x86.c)
215endif ()
Nguyen Anh Quynhf6af5092014-05-28 14:29:20 +0800216
Yegor Derevenetsebc4ced2014-09-21 19:52:57 +0200217if (CAPSTONE_SPARC_SUPPORT)
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800218 add_definitions(-DCAPSTONE_HAS_SPARC)
learn_moreb68d6a92015-04-22 19:35:47 +0200219 set(SOURCES_SPARC
220 arch/Sparc/SparcDisassembler.c
221 arch/Sparc/SparcInstPrinter.c
222 arch/Sparc/SparcMapping.c
223 arch/Sparc/SparcModule.c
224 )
225 set(HEADERS_SPARC
226 arch/Sparc/Sparc.h
227 arch/Sparc/SparcDisassembler.h
228 arch/Sparc/SparcGenAsmWriter.inc
229 arch/Sparc/SparcGenDisassemblerTables.inc
230 arch/Sparc/SparcGenInstrInfo.inc
231 arch/Sparc/SparcGenRegisterInfo.inc
232 arch/Sparc/SparcGenSubtargetInfo.inc
233 arch/Sparc/SparcInstPrinter.h
234 arch/Sparc/SparcMapping.h
235 arch/Sparc/SparcMappingInsn.inc
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800236 )
237 set(TEST_SOURCES ${TEST_SOURCES} test_sparc.c)
238endif ()
239
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200240if (CAPSTONE_SYSZ_SUPPORT)
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800241 add_definitions(-DCAPSTONE_HAS_SYSZ)
learn_moreb68d6a92015-04-22 19:35:47 +0200242 set(SOURCES_SYSZ
243 arch/SystemZ/SystemZDisassembler.c
244 arch/SystemZ/SystemZInstPrinter.c
245 arch/SystemZ/SystemZMapping.c
246 arch/SystemZ/SystemZMCTargetDesc.c
247 arch/SystemZ/SystemZModule.c
248 )
249 set(HEADERS_SYSZ
250 arch/SystemZ/SystemZDisassembler.h
251 arch/SystemZ/SystemZGenAsmWriter.inc
252 arch/SystemZ/SystemZGenDisassemblerTables.inc
253 arch/SystemZ/SystemZGenInstrInfo.inc
254 arch/SystemZ/SystemZGenRegisterInfo.inc
255 arch/SystemZ/SystemZGenSubtargetInfo.inc
256 arch/SystemZ/SystemZInstPrinter.h
257 arch/SystemZ/SystemZMapping.h
258 arch/SystemZ/SystemZMappingInsn.inc
259 arch/SystemZ/SystemZMCTargetDesc.h
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800260 )
261 set(TEST_SOURCES ${TEST_SOURCES} test_systemz.c)
262endif ()
263
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200264if (CAPSTONE_XCORE_SUPPORT)
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800265 add_definitions(-DCAPSTONE_HAS_XCORE)
learn_moreb68d6a92015-04-22 19:35:47 +0200266 set(SOURCES_XCORE
267 arch/XCore/XCoreDisassembler.c
268 arch/XCore/XCoreInstPrinter.c
269 arch/XCore/XCoreMapping.c
270 arch/XCore/XCoreModule.c
271 )
272 set(HEADERS_XCORE
273 arch/XCore/XCoreDisassembler.h
274 arch/XCore/XCoreGenAsmWriter.inc
275 arch/XCore/XCoreGenDisassemblerTables.inc
276 arch/XCore/XCoreGenInstrInfo.inc
277 arch/XCore/XCoreGenRegisterInfo.inc
278 arch/XCore/XCoreInstPrinter.h
279 arch/XCore/XCoreMapping.h
280 arch/XCore/XCoreMappingInsn.inc
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800281 )
282 set(TEST_SOURCES ${TEST_SOURCES} test_xcore.c)
283endif ()
284
reverser160e1982015-04-09 18:28:19 +0100285if (CAPSTONE_OSXKERNEL_SUPPORT)
286 add_definitions(-DCAPSTONE_HAS_OSXKERNEL)
287endif ()
288
learn_moreb68d6a92015-04-22 19:35:47 +0200289set(ALL_SOURCES
290 ${SOURCES_ENGINE}
291 ${SOURCES_ARM}
292 ${SOURCES_ARM64}
293 ${SOURCES_MIPS}
294 ${SOURCES_PPC}
295 ${SOURCES_X86}
296 ${SOURCES_SPARC}
297 ${SOURCES_SYSZ}
298 ${SOURCES_XCORE}
299 )
300
301set(ALL_HEADERS
learn_more3ff5dc52015-04-22 21:03:47 +0200302 ${HEADERS_COMMON}
learn_moreb68d6a92015-04-22 19:35:47 +0200303 ${HEADERS_ENGINE}
304 ${HEADERS_ARM}
305 ${HEADERS_ARM64}
306 ${HEADERS_MIPS}
307 ${HEADERS_PPC}
308 ${HEADERS_X86}
309 ${HEADERS_SPARC}
310 ${HEADERS_SYSZ}
311 ${HEADERS_XCORE}
312 )
313
daniel96ecc332014-05-18 02:03:15 -0700314include_directories("${PROJECT_SOURCE_DIR}/include")
315
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000316## properties
317# version info
318set_property(GLOBAL PROPERTY VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
319set_property(GLOBAL PROPERTY SOVERSION SOVERSION ${VERSION_MAJOR})
320
321## targets
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200322if (CAPSTONE_BUILD_STATIC)
learn_moreb68d6a92015-04-22 19:35:47 +0200323 add_library(capstone-static STATIC ${ALL_SOURCES} ${ALL_HEADERS})
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000324 set_property(TARGET capstone-static PROPERTY OUTPUT_NAME capstone)
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000325 set(default-target capstone-static)
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800326endif ()
327
Nguyen Anh Quynh70453c82015-02-03 18:25:12 +0800328# Force static runtime libraries
329if (CAPSTONE_BUILD_STATIC_RUNTIME)
330 FOREACH(flag
331 CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
332 CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT
333 CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO
334 CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT)
335 STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}")
336 SET("${flag}" "${${flag}} /EHsc")
337 ENDFOREACH()
338endif ()
339
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200340if (CAPSTONE_BUILD_SHARED)
learn_moreb68d6a92015-04-22 19:35:47 +0200341 add_library(capstone-shared SHARED ${ALL_SOURCES} ${ALL_HEADERS})
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000342 set_property(TARGET capstone-shared PROPERTY OUTPUT_NAME capstone)
343 set_property(TARGET capstone-shared PROPERTY COMPILE_FLAGS -DCAPSTONE_SHARED)
344
learn_more21a26952015-04-14 17:00:57 +0200345 if (MSVC)
learn_more147d95b2015-04-14 15:39:07 +0200346 set_target_properties(capstone-shared PROPERTIES IMPORT_SUFFIX _dll.lib)
learn_more21a26952015-04-14 17:00:57 +0200347 endif ()
learn_more147d95b2015-04-14 15:39:07 +0200348
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000349 if(NOT DEFINED default-target) # honor `capstone-static` for tests first.
350 set(default-target capstone-shared)
351 add_definitions(-DCAPSTONE_SHARED)
352 endif ()
353endif ()
daniel96ecc332014-05-18 02:03:15 -0700354
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200355if (CAPSTONE_BUILD_TESTS)
daniel96ecc332014-05-18 02:03:15 -0700356 foreach (TSRC ${TEST_SOURCES})
flyingsymbolsd91f9642014-10-22 03:21:43 -0400357 STRING(REGEX REPLACE ".c$" "" TBIN ${TSRC})
358 add_executable(${TBIN} "tests/${TSRC}")
359 target_link_libraries(${TBIN} ${default-target})
daniel96ecc332014-05-18 02:03:15 -0700360 endforeach ()
flyingsymbolsd91f9642014-10-22 03:21:43 -0400361 if (CAPSTONE_ARM_SUPPORT)
362 set(ARM_REGRESS_TEST test_arm_regression.c)
363 STRING(REGEX REPLACE ".c$" "" ARM_REGRESS_BIN ${ARM_REGRESS_TEST})
364 add_executable(${ARM_REGRESS_BIN} "suite/arm/${ARM_REGRESS_TEST}")
365 target_link_libraries(${ARM_REGRESS_BIN} ${default-target})
366 endif()
daniel96ecc332014-05-18 02:03:15 -0700367endif ()
368
learn_moreb68d6a92015-04-22 19:35:47 +0200369source_group("Source\\Engine" FILES ${SOURCES_ENGINE})
370source_group("Source\\ARM" FILES ${SOURCES_ARM})
371source_group("Source\\ARM64" FILES ${SOURCES_ARM64})
372source_group("Source\\Mips" FILES ${SOURCES_MIPS})
373source_group("Source\\PowerPC" FILES ${SOURCES_PPC})
374source_group("Source\\Sparc" FILES ${SOURCES_SPARC})
375source_group("Source\\SystemZ" FILES ${SOURCES_SYSZ})
376source_group("Source\\X86" FILES ${SOURCES_X86})
377source_group("Source\\XCore" FILES ${SOURCES_XCORE})
378
learn_more3ff5dc52015-04-22 21:03:47 +0200379source_group("Include\\Common" FILES ${HEADERS_COMMON})
learn_moreb68d6a92015-04-22 19:35:47 +0200380source_group("Include\\Engine" FILES ${HEADERS_ENGINE})
381source_group("Include\\ARM" FILES ${HEADERS_ARM})
382source_group("Include\\ARM64" FILES ${HEADERS_ARM64})
383source_group("Include\\Mips" FILES ${HEADERS_MIPS})
384source_group("Include\\PowerPC" FILES ${HEADERS_PPC})
385source_group("Include\\Sparc" FILES ${HEADERS_SPARC})
386source_group("Include\\SystemZ" FILES ${HEADERS_SYSZ})
387source_group("Include\\X86" FILES ${HEADERS_X86})
388source_group("Include\\XCore" FILES ${HEADERS_XCORE})
389
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000390## installation
learn_more3ff5dc52015-04-22 21:03:47 +0200391install(FILES ${HEADERS_COMMON} DESTINATION include/capstone)
Nguyen Anh Quynh73438482014-05-28 21:55:37 +0800392
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200393if (CAPSTONE_BUILD_STATIC)
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000394 install(TARGETS capstone-static
395 RUNTIME DESTINATION bin
396 LIBRARY DESTINATION lib
397 ARCHIVE DESTINATION lib)
398endif ()
399
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200400if (CAPSTONE_BUILD_SHARED)
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000401 install(TARGETS capstone-shared
402 RUNTIME DESTINATION bin
403 LIBRARY DESTINATION lib
404 ARCHIVE DESTINATION lib)
405endif ()