From 02c616b7b5444221da309af5c42b25d96b88c62c Mon Sep 17 00:00:00 2001 From: Igor Tarasov Date: Wed, 8 Jul 2020 14:59:30 +0300 Subject: [PATCH] Initial cmake support. --- CMakeLists.txt | 22 ++++++++++++++++++++++ examples/CMakeLists.txt | 0 test/CMakeLists.txt | 7 +++++++ 3 files changed, 29 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 examples/CMakeLists.txt create mode 100644 test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..51bac37 --- /dev/null +++ b/CMakeLists.txt @@ -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() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..5b6ab01 --- /dev/null +++ b/test/CMakeLists.txt @@ -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)