-
Notifications
You must be signed in to change notification settings - Fork 92
/
CMakeLists.txt
33 lines (29 loc) · 1018 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
# set cross compiler options
if(APPLE)
set(CMAKE_TOOLCHAIN_FILE toolchain/mac.cmake)
else()
set(CMAKE_TOOLCHAIN_FILE toolchain/linux.cmake)
endif()
cmake_minimum_required(VERSION 2.6)
project(iOS-Kernel-Utilities)
# need ldid to sign the binaries and add the entitlements
find_program(LDIDTool ldid)
if(LDIDTool MATCHES ".*NOTFOUND")
message(FATAL_ERROR "ldid not found, make sure it is installed and in $PATH")
endif()
# build libraries
include_directories("${PROJECT_SOURCE_DIR}/lib/kernel")
include_directories("${PROJECT_SOURCE_DIR}/lib/binary")
add_subdirectory(lib/kernel)
add_subdirectory(lib/binary)
# build tools
set(TOOLS kdump kmap kmem kpatch)
foreach(tool ${TOOLS})
message("preparing ${tool}")
add_executable(${tool} tools/${tool}.c)
target_link_libraries(${tool} kernel)
target_link_libraries(${tool} binary)
add_custom_command(TARGET ${tool}
POST_BUILD
COMMAND ${LDIDTool} "-S${PROJECT_SOURCE_DIR}/misc/ent.xml" ${tool})
endforeach(tool)