-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
40 lines (31 loc) · 1.08 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
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project(jprimitiv VERSION 0.4.0 LANGUAGES Java CXX)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
option(PRIMITIV_USE_EIGEN "Enables the Eigen backend." OFF)
option(PRIMITIV_USE_CUDA "Enables the CUDA backend." OFF)
option(PRIMITIV_USE_OPENCL "Enables the OpenCL backend." OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Werror -fPIC")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Werror -fPIC")
else()
message(WARNING "primitiv-java may not support the detected compiler: ${CMAKE_CXX_COMPILER_ID}")
endif()
find_package(Primitiv REQUIRED)
find_package(Java COMPONENTS Development)
find_package(JNI REQUIRED)
include_directories(
${JNI_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/cpp
${PROJECT_BINARY_DIR}/src)
include(UseJava)
# core library
add_subdirectory(src)
# # tests
# if(PRIMITIV_JAVA_BUILD_TESTS)
# enable_testing()
# add_subdirectory(test)
# endif()
#