-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (36 loc) · 1.35 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
#**************************************************************************************************
# cMake的公共配置
#**************************************************************************************************
cmake_minimum_required(VERSION 2.8)
project(imgjni)
#**************************************************************************************************
# Preprocessor definitions 一些预定义设置
#**************************************************************************************************
if (CMAKE_CL_64)
add_definitions(-DWIN64)
set(PLATFORM x64)
else (CMAKE_CL_64)
set(PLATFORM x86)
endif (CMAKE_CL_64)
if(WIN32)
ADD_DEFINITIONS(-DIGTB_EXPORTS)
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
endif(WIN32)
enable_testing()
#根目录设置
SET(BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
#源文件设置
AUX_SOURCE_DIRECTORY(${BASE_DIR}/src OBJ_DIR)
#头文件包含目录
INCLUDE_DIRECTORIES(${BASE_DIR}/include)
#用$ENV{JAVA_HOME}获取 用于加载jni头文件 前提配置好JAVA_HOME
INCLUDE_DIRECTORIES($ENV{JAVA_HOME}/include)
if(WIN32)
INCLUDE_DIRECTORIES($ENV{JAVA_HOME}/include/win32)
ELSEIF(APPLE)
INCLUDE_DIRECTORIES($ENV{JAVA_HOME}/include/darwin)
ELSE()
INCLUDE_DIRECTORIES($ENV{JAVA_HOME}/include/linux)
endif()
#生成sample1动态库
add_library(imgjni SHARED ${OBJ_DIR})