blob: aa83e4dea26e1ad408fd78d6ef281d1c74fd1d22 [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 Derevenets2c073462015-05-30 21:03:49 +020029enable_testing()
30
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020031if (CAPSTONE_BUILD_DIET)
Nguyen Anh Quynh758fcbe2014-05-31 10:44:27 +080032 add_definitions(-DCAPSTONE_DIET)
33endif ()
daniel96ecc332014-05-18 02:03:15 -070034
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020035if (CAPSTONE_USE_DEFAULT_ALLOC)
Nguyen Anh Quynhd765ab22014-06-03 17:38:29 +080036 add_definitions(-DCAPSTONE_USE_SYS_DYN_MEM)
Nguyen Anh Quynh758fcbe2014-05-31 10:44:27 +080037endif ()
38
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020039if (CAPSTONE_X86_REDUCE)
Nguyen Anh Quynh758fcbe2014-05-31 10:44:27 +080040 add_definitions(-DCAPSTONE_X86_REDUCE)
daniel96ecc332014-05-18 02:03:15 -070041endif ()
42
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020043if (CAPSTONE_X86_ATT_DISABLE)
baguette86e84502014-08-17 20:59:05 +020044 add_definitions(-DCAPSTONE_X86_ATT_DISABLE)
45endif ()
46
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +000047## sources
learn_moreb68d6a92015-04-22 19:35:47 +020048set(SOURCES_ENGINE
daniel96ecc332014-05-18 02:03:15 -070049 cs.c
50 MCInst.c
51 MCInstrDesc.c
52 MCRegisterInfo.c
53 SStream.c
54 utils.c
learn_moreb68d6a92015-04-22 19:35:47 +020055)
56set(HEADERS_ENGINE
57 cs_priv.h
58 LEB128.h
59 MathExtras.h
60 MCDisassembler.h
61 MCFixedLenDisassembler.h
62 MCInst.h
63 MCInstrDesc.h
64 MCRegisterInfo.h
65 myinttypes.h
66 osxkernel_inttypes.h
67 SStream.h
68 utils.h
daniel96ecc332014-05-18 02:03:15 -070069 )
Nguyen Anh Quynhf6af5092014-05-28 14:29:20 +080070
learn_more3ff5dc52015-04-22 21:03:47 +020071set(HEADERS_COMMON
72 include/capstone/arm64.h
73 include/capstone/arm.h
74 include/capstone/capstone.h
75 include/capstone/mips.h
76 include/capstone/ppc.h
77 include/capstone/x86.h
78 include/capstone/sparc.h
79 include/capstone/systemz.h
80 include/capstone/xcore.h
81 include/capstone/platform.h
82 )
83
84
Yegor Derevenets2c073462015-05-30 21:03:49 +020085set(TEST_SOURCES test_basic.c test_detail.c test_skipdata.c test_iter.c test_customized_mnem.c)
Nguyen Anh Quynhf6af5092014-05-28 14:29:20 +080086
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +000087## architecture support
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +020088if (CAPSTONE_ARM_SUPPORT)
daniel96ecc332014-05-18 02:03:15 -070089 add_definitions(-DCAPSTONE_HAS_ARM)
learn_moreb68d6a92015-04-22 19:35:47 +020090 set(SOURCES_ARM
daniel96ecc332014-05-18 02:03:15 -070091 arch/ARM/ARMDisassembler.c
92 arch/ARM/ARMInstPrinter.c
93 arch/ARM/ARMMapping.c
94 arch/ARM/ARMModule.c
learn_moreb68d6a92015-04-22 19:35:47 +020095 )
96 set(HEADERS_ARM
97 arch/ARM/ARMAddressingModes.h
98 arch/ARM/ARMBaseInfo.h
99 arch/ARM/ARMDisassembler.h
100 arch/ARM/ARMGenAsmWriter.inc
101 arch/ARM/ARMGenDisassemblerTables.inc
102 arch/ARM/ARMGenInstrInfo.inc
103 arch/ARM/ARMGenRegisterInfo.inc
104 arch/ARM/ARMGenSubtargetInfo.inc
105 arch/ARM/ARMInstPrinter.h
106 arch/ARM/ARMMapping.h
107 arch/ARM/ARMMappingInsn.inc
108 arch/ARM/ARMMappingInsnOp.inc
daniel96ecc332014-05-18 02:03:15 -0700109 )
110 set(TEST_SOURCES ${TEST_SOURCES} test_arm.c)
111endif ()
Nguyen Anh Quynhf6af5092014-05-28 14:29:20 +0800112
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200113if (CAPSTONE_ARM64_SUPPORT)
daniel96ecc332014-05-18 02:03:15 -0700114 add_definitions(-DCAPSTONE_HAS_ARM64)
learn_moreb68d6a92015-04-22 19:35:47 +0200115 set(SOURCES_ARM64
daniel96ecc332014-05-18 02:03:15 -0700116 arch/AArch64/AArch64BaseInfo.c
117 arch/AArch64/AArch64Disassembler.c
118 arch/AArch64/AArch64InstPrinter.c
119 arch/AArch64/AArch64Mapping.c
120 arch/AArch64/AArch64Module.c
learn_moreb68d6a92015-04-22 19:35:47 +0200121 )
122 set(HEADERS_ARM64
123 arch/AArch64/AArch64AddressingModes.h
124 arch/AArch64/AArch64BaseInfo.h
125 arch/AArch64/AArch64Disassembler.h
126 arch/AArch64/AArch64GenAsmWriter.inc
127 arch/AArch64/AArch64GenDisassemblerTables.inc
128 arch/AArch64/AArch64GenInstrInfo.inc
129 arch/AArch64/AArch64GenRegisterInfo.inc
130 arch/AArch64/AArch64GenSubtargetInfo.inc
131 arch/AArch64/AArch64InstPrinter.h
132 arch/AArch64/AArch64Mapping.h
133 arch/AArch64/AArch64MappingInsn.inc
daniel96ecc332014-05-18 02:03:15 -0700134 )
135 set(TEST_SOURCES ${TEST_SOURCES} test_arm64.c)
136endif ()
137
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200138if (CAPSTONE_MIPS_SUPPORT)
daniel96ecc332014-05-18 02:03:15 -0700139 add_definitions(-DCAPSTONE_HAS_MIPS)
learn_moreb68d6a92015-04-22 19:35:47 +0200140 set(SOURCES_MIPS
daniel96ecc332014-05-18 02:03:15 -0700141 arch/Mips/MipsDisassembler.c
Nguyen Anh Quynhf6af5092014-05-28 14:29:20 +0800142 arch/Mips/MipsInstPrinter.c
daniel96ecc332014-05-18 02:03:15 -0700143 arch/Mips/MipsMapping.c
144 arch/Mips/MipsModule.c
learn_moreb68d6a92015-04-22 19:35:47 +0200145 )
146 set(HEADERS_MIPS
147 arch/Mips/MipsDisassembler.h
148 arch/Mips/MipsGenAsmWriter.inc
149 arch/Mips/MipsGenDisassemblerTables.inc
150 arch/Mips/MipsGenInstrInfo.inc
151 arch/Mips/MipsGenRegisterInfo.inc
152 arch/Mips/MipsGenSubtargetInfo.inc
153 arch/Mips/MipsInstPrinter.h
154 arch/Mips/MipsMapping.h
155 arch/Mips/MipsMappingInsn.inc
daniel96ecc332014-05-18 02:03:15 -0700156 )
157 set(TEST_SOURCES ${TEST_SOURCES} test_mips.c)
158endif ()
159
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200160if (CAPSTONE_PPC_SUPPORT)
daniel96ecc332014-05-18 02:03:15 -0700161 add_definitions(-DCAPSTONE_HAS_POWERPC)
learn_moreb68d6a92015-04-22 19:35:47 +0200162 set(SOURCES_PPC
daniel96ecc332014-05-18 02:03:15 -0700163 arch/PowerPC/PPCDisassembler.c
164 arch/PowerPC/PPCInstPrinter.c
165 arch/PowerPC/PPCMapping.c
166 arch/PowerPC/PPCModule.c
learn_moreb68d6a92015-04-22 19:35:47 +0200167 )
168 set(HEADERS_PPC
169 arch/PowerPC/PPCDisassembler.h
170 arch/PowerPC/PPCGenAsmWriter.inc
171 arch/PowerPC/PPCGenDisassemblerTables.inc
172 arch/PowerPC/PPCGenInstrInfo.inc
173 arch/PowerPC/PPCGenRegisterInfo.inc
174 arch/PowerPC/PPCGenSubtargetInfo.inc
175 arch/PowerPC/PPCInstPrinter.h
176 arch/PowerPC/PPCMapping.h
177 arch/PowerPC/PPCMappingInsn.inc
178 arch/PowerPC/PPCPredicates.h
daniel96ecc332014-05-18 02:03:15 -0700179 )
180 set(TEST_SOURCES ${TEST_SOURCES} test_ppc.c)
181endif ()
182
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200183if (CAPSTONE_X86_SUPPORT)
daniel96ecc332014-05-18 02:03:15 -0700184 add_definitions(-DCAPSTONE_HAS_X86)
learn_moreb68d6a92015-04-22 19:35:47 +0200185 set(SOURCES_X86
Nguyen Anh Quynha71a27b2014-05-28 21:20:30 +0800186 arch/X86/X86Disassembler.c
187 arch/X86/X86DisassemblerDecoder.c
188 arch/X86/X86IntelInstPrinter.c
189 arch/X86/X86Mapping.c
190 arch/X86/X86Module.c
learn_moreb68d6a92015-04-22 19:35:47 +0200191 )
192 set(HEADERS_X86
193 arch/X86/X86BaseInfo.h
194 arch/X86/X86Disassembler.h
195 arch/X86/X86DisassemblerDecoder.h
196 arch/X86/X86DisassemblerDecoderCommon.h
197 arch/X86/X86GenAsmWriter.inc
198 arch/X86/X86GenAsmWriter1.inc
199 arch/X86/X86GenAsmWriter1_reduce.inc
200 arch/X86/X86GenAsmWriter_reduce.inc
201 arch/X86/X86GenDisassemblerTables.inc
202 arch/X86/X86GenDisassemblerTables_reduce.inc
203 arch/X86/X86GenInstrInfo.inc
204 arch/X86/X86GenInstrInfo_reduce.inc
205 arch/X86/X86GenRegisterInfo.inc
206 arch/X86/X86InstPrinter.h
207 arch/X86/X86Mapping.h
208 arch/X86/X86MappingInsn.inc
209 arch/X86/X86MappingInsnOp.inc
210 arch/X86/X86MappingInsnOp_reduce.inc
211 arch/X86/X86MappingInsn_reduce.inc
Nguyen Anh Quynha71a27b2014-05-28 21:20:30 +0800212 )
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200213 if (NOT CAPSTONE_BUILD_DIET)
learn_moreb68d6a92015-04-22 19:35:47 +0200214 set(SOURCES_X86 ${SOURCES_X86} arch/X86/X86ATTInstPrinter.c)
Nguyen Anh Quynh758fcbe2014-05-31 10:44:27 +0800215 endif ()
daniel96ecc332014-05-18 02:03:15 -0700216 set(TEST_SOURCES ${TEST_SOURCES} test_x86.c)
217endif ()
Nguyen Anh Quynhf6af5092014-05-28 14:29:20 +0800218
Yegor Derevenetsebc4ced2014-09-21 19:52:57 +0200219if (CAPSTONE_SPARC_SUPPORT)
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800220 add_definitions(-DCAPSTONE_HAS_SPARC)
learn_moreb68d6a92015-04-22 19:35:47 +0200221 set(SOURCES_SPARC
222 arch/Sparc/SparcDisassembler.c
223 arch/Sparc/SparcInstPrinter.c
224 arch/Sparc/SparcMapping.c
225 arch/Sparc/SparcModule.c
226 )
227 set(HEADERS_SPARC
228 arch/Sparc/Sparc.h
229 arch/Sparc/SparcDisassembler.h
230 arch/Sparc/SparcGenAsmWriter.inc
231 arch/Sparc/SparcGenDisassemblerTables.inc
232 arch/Sparc/SparcGenInstrInfo.inc
233 arch/Sparc/SparcGenRegisterInfo.inc
234 arch/Sparc/SparcGenSubtargetInfo.inc
235 arch/Sparc/SparcInstPrinter.h
236 arch/Sparc/SparcMapping.h
237 arch/Sparc/SparcMappingInsn.inc
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800238 )
239 set(TEST_SOURCES ${TEST_SOURCES} test_sparc.c)
240endif ()
241
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200242if (CAPSTONE_SYSZ_SUPPORT)
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800243 add_definitions(-DCAPSTONE_HAS_SYSZ)
learn_moreb68d6a92015-04-22 19:35:47 +0200244 set(SOURCES_SYSZ
245 arch/SystemZ/SystemZDisassembler.c
246 arch/SystemZ/SystemZInstPrinter.c
247 arch/SystemZ/SystemZMapping.c
248 arch/SystemZ/SystemZMCTargetDesc.c
249 arch/SystemZ/SystemZModule.c
250 )
251 set(HEADERS_SYSZ
252 arch/SystemZ/SystemZDisassembler.h
253 arch/SystemZ/SystemZGenAsmWriter.inc
254 arch/SystemZ/SystemZGenDisassemblerTables.inc
255 arch/SystemZ/SystemZGenInstrInfo.inc
256 arch/SystemZ/SystemZGenRegisterInfo.inc
257 arch/SystemZ/SystemZGenSubtargetInfo.inc
258 arch/SystemZ/SystemZInstPrinter.h
259 arch/SystemZ/SystemZMapping.h
260 arch/SystemZ/SystemZMappingInsn.inc
261 arch/SystemZ/SystemZMCTargetDesc.h
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800262 )
263 set(TEST_SOURCES ${TEST_SOURCES} test_systemz.c)
264endif ()
265
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200266if (CAPSTONE_XCORE_SUPPORT)
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800267 add_definitions(-DCAPSTONE_HAS_XCORE)
learn_moreb68d6a92015-04-22 19:35:47 +0200268 set(SOURCES_XCORE
269 arch/XCore/XCoreDisassembler.c
270 arch/XCore/XCoreInstPrinter.c
271 arch/XCore/XCoreMapping.c
272 arch/XCore/XCoreModule.c
273 )
274 set(HEADERS_XCORE
275 arch/XCore/XCoreDisassembler.h
276 arch/XCore/XCoreGenAsmWriter.inc
277 arch/XCore/XCoreGenDisassemblerTables.inc
278 arch/XCore/XCoreGenInstrInfo.inc
279 arch/XCore/XCoreGenRegisterInfo.inc
280 arch/XCore/XCoreInstPrinter.h
281 arch/XCore/XCoreMapping.h
282 arch/XCore/XCoreMappingInsn.inc
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800283 )
284 set(TEST_SOURCES ${TEST_SOURCES} test_xcore.c)
285endif ()
286
reverser160e1982015-04-09 18:28:19 +0100287if (CAPSTONE_OSXKERNEL_SUPPORT)
288 add_definitions(-DCAPSTONE_HAS_OSXKERNEL)
289endif ()
290
learn_moreb68d6a92015-04-22 19:35:47 +0200291set(ALL_SOURCES
292 ${SOURCES_ENGINE}
293 ${SOURCES_ARM}
294 ${SOURCES_ARM64}
295 ${SOURCES_MIPS}
296 ${SOURCES_PPC}
297 ${SOURCES_X86}
298 ${SOURCES_SPARC}
299 ${SOURCES_SYSZ}
300 ${SOURCES_XCORE}
301 )
302
303set(ALL_HEADERS
learn_more3ff5dc52015-04-22 21:03:47 +0200304 ${HEADERS_COMMON}
learn_moreb68d6a92015-04-22 19:35:47 +0200305 ${HEADERS_ENGINE}
306 ${HEADERS_ARM}
307 ${HEADERS_ARM64}
308 ${HEADERS_MIPS}
309 ${HEADERS_PPC}
310 ${HEADERS_X86}
311 ${HEADERS_SPARC}
312 ${HEADERS_SYSZ}
313 ${HEADERS_XCORE}
314 )
315
daniel96ecc332014-05-18 02:03:15 -0700316include_directories("${PROJECT_SOURCE_DIR}/include")
317
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000318## properties
319# version info
320set_property(GLOBAL PROPERTY VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
321set_property(GLOBAL PROPERTY SOVERSION SOVERSION ${VERSION_MAJOR})
322
323## targets
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200324if (CAPSTONE_BUILD_STATIC)
learn_moreb68d6a92015-04-22 19:35:47 +0200325 add_library(capstone-static STATIC ${ALL_SOURCES} ${ALL_HEADERS})
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000326 set_property(TARGET capstone-static PROPERTY OUTPUT_NAME capstone)
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000327 set(default-target capstone-static)
Nguyen Anh Quynhd0023192014-05-28 15:15:00 +0800328endif ()
329
Nguyen Anh Quynh70453c82015-02-03 18:25:12 +0800330# Force static runtime libraries
331if (CAPSTONE_BUILD_STATIC_RUNTIME)
332 FOREACH(flag
333 CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
334 CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT
335 CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO
336 CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT)
337 STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}")
338 SET("${flag}" "${${flag}} /EHsc")
339 ENDFOREACH()
340endif ()
341
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200342if (CAPSTONE_BUILD_SHARED)
learn_moreb68d6a92015-04-22 19:35:47 +0200343 add_library(capstone-shared SHARED ${ALL_SOURCES} ${ALL_HEADERS})
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000344 set_property(TARGET capstone-shared PROPERTY OUTPUT_NAME capstone)
345 set_property(TARGET capstone-shared PROPERTY COMPILE_FLAGS -DCAPSTONE_SHARED)
346
learn_more21a26952015-04-14 17:00:57 +0200347 if (MSVC)
learn_more147d95b2015-04-14 15:39:07 +0200348 set_target_properties(capstone-shared PROPERTIES IMPORT_SUFFIX _dll.lib)
learn_more21a26952015-04-14 17:00:57 +0200349 endif ()
learn_more147d95b2015-04-14 15:39:07 +0200350
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000351 if(NOT DEFINED default-target) # honor `capstone-static` for tests first.
352 set(default-target capstone-shared)
353 add_definitions(-DCAPSTONE_SHARED)
354 endif ()
355endif ()
daniel96ecc332014-05-18 02:03:15 -0700356
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200357if (CAPSTONE_BUILD_TESTS)
daniel96ecc332014-05-18 02:03:15 -0700358 foreach (TSRC ${TEST_SOURCES})
flyingsymbolsd91f9642014-10-22 03:21:43 -0400359 STRING(REGEX REPLACE ".c$" "" TBIN ${TSRC})
360 add_executable(${TBIN} "tests/${TSRC}")
361 target_link_libraries(${TBIN} ${default-target})
Yegor Derevenets2c073462015-05-30 21:03:49 +0200362 add_test(NAME "capstone_${TBIN}" COMMAND ${TBIN})
daniel96ecc332014-05-18 02:03:15 -0700363 endforeach ()
flyingsymbolsd91f9642014-10-22 03:21:43 -0400364 if (CAPSTONE_ARM_SUPPORT)
365 set(ARM_REGRESS_TEST test_arm_regression.c)
366 STRING(REGEX REPLACE ".c$" "" ARM_REGRESS_BIN ${ARM_REGRESS_TEST})
367 add_executable(${ARM_REGRESS_BIN} "suite/arm/${ARM_REGRESS_TEST}")
368 target_link_libraries(${ARM_REGRESS_BIN} ${default-target})
Yegor Derevenets2c073462015-05-30 21:03:49 +0200369 add_test(NAME "capstone_${ARM_REGRESS_BIN}" COMMAND ${ARM_REGRESS_BIN})
flyingsymbolsd91f9642014-10-22 03:21:43 -0400370 endif()
daniel96ecc332014-05-18 02:03:15 -0700371endif ()
372
learn_moreb68d6a92015-04-22 19:35:47 +0200373source_group("Source\\Engine" FILES ${SOURCES_ENGINE})
374source_group("Source\\ARM" FILES ${SOURCES_ARM})
375source_group("Source\\ARM64" FILES ${SOURCES_ARM64})
376source_group("Source\\Mips" FILES ${SOURCES_MIPS})
377source_group("Source\\PowerPC" FILES ${SOURCES_PPC})
378source_group("Source\\Sparc" FILES ${SOURCES_SPARC})
379source_group("Source\\SystemZ" FILES ${SOURCES_SYSZ})
380source_group("Source\\X86" FILES ${SOURCES_X86})
381source_group("Source\\XCore" FILES ${SOURCES_XCORE})
382
learn_more3ff5dc52015-04-22 21:03:47 +0200383source_group("Include\\Common" FILES ${HEADERS_COMMON})
learn_moreb68d6a92015-04-22 19:35:47 +0200384source_group("Include\\Engine" FILES ${HEADERS_ENGINE})
385source_group("Include\\ARM" FILES ${HEADERS_ARM})
386source_group("Include\\ARM64" FILES ${HEADERS_ARM64})
387source_group("Include\\Mips" FILES ${HEADERS_MIPS})
388source_group("Include\\PowerPC" FILES ${HEADERS_PPC})
389source_group("Include\\Sparc" FILES ${HEADERS_SPARC})
390source_group("Include\\SystemZ" FILES ${HEADERS_SYSZ})
391source_group("Include\\X86" FILES ${HEADERS_X86})
392source_group("Include\\XCore" FILES ${HEADERS_XCORE})
393
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000394## installation
learn_more3ff5dc52015-04-22 21:03:47 +0200395install(FILES ${HEADERS_COMMON} DESTINATION include/capstone)
Nguyen Anh Quynh73438482014-05-28 21:55:37 +0800396
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200397if (CAPSTONE_BUILD_STATIC)
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000398 install(TARGETS capstone-static
399 RUNTIME DESTINATION bin
400 LIBRARY DESTINATION lib
401 ARCHIVE DESTINATION lib)
402endif ()
403
Yegor Derevenetsb4d78d92014-09-19 18:39:22 +0200404if (CAPSTONE_BUILD_SHARED)
Ali Rizvi-Santiago10053ba2014-06-03 21:04:23 +0000405 install(TARGETS capstone-shared
406 RUNTIME DESTINATION bin
407 LIBRARY DESTINATION lib
408 ARCHIVE DESTINATION lib)
409endif ()