Skip to content

CMake support. #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.10)

project(jni.hpp VERSION 4.0.1)

option(JNI_HPP_BUILD_TESTS "Build and run tests when BUILD_TESTING is enabled." ON)
option(JNI_HPP_BUILD_EXAMPLES "Build and run examples" ON)

add_library(jni_hpp INTERFACE)
add_library(Mapbox::JNI ALIAS jni_hpp)

target_include_directories(jni_hpp INTERFACE include)
target_compile_features(jni_hpp INTERFACE cxx_std_14)

if(JNI_HPP_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()

if(JNI_HPP_BUILD_EXAMPLES)
enable_testing()
add_subdirectory(examples)
endif()
Empty file added examples/CMakeLists.txt
Empty file.
7 changes: 7 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_executable(low_level low_level.cpp)
target_link_libraries(low_level Mapbox::JNI)
target_include_directories(low_level PRIVATE android)

add_executable(high_level high_level.cpp)
target_link_libraries(high_level Mapbox::JNI)
target_include_directories(high_level PRIVATE android)