-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (26 loc) · 933 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cmake_minimum_required(VERSION 3.0)
include(GNUInstallDirs)
# Check for iOS (to compile with Theos)
EXECUTE_PROCESS( COMMAND uname -p COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE )
if (APPLE AND UNIX AND "${ARCHITECTURE}" STREQUAL "arm64")
SET(CMAKE_OSX_SYSROOT /usr/SDK)
endif (APPLE AND UNIX AND "${ARCHITECTURE}" STREQUAL "arm64")
# Project intialization
project(lobstr VERSION 0.1.0 LANGUAGES C)
if (UNIX)
SET(CMAKE_C_FLAGS "-Wall")
endif (UNIX)
# Get SOURCES an HEADERS (public ones)
file(GLOB SOURCES "lib/*.c")
# Add library
include_directories(include)
add_library(lobstr SHARED ${SOURCES})
set_target_properties(lobstr PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 0
PUBLIC_HEADER include/lobstr.h)
# Linking
target_link_libraries(lobstr capstone)
install(TARGETS lobstr
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})