From e457ca19c0a361dcc1f5585ef05b218363b34172 Mon Sep 17 00:00:00 2001 From: Alexey Pelykh Date: Fri, 27 Sep 2013 10:58:16 +0300 Subject: [PATCH] Fix darwin --- OsmAnd-java/CMakeLists.txt | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/OsmAnd-java/CMakeLists.txt b/OsmAnd-java/CMakeLists.txt index 256784ad70..700d563ebd 100644 --- a/OsmAnd-java/CMakeLists.txt +++ b/OsmAnd-java/CMakeLists.txt @@ -1,20 +1,10 @@ project(OsmAndJNI) +find_package(Java REQUIRED) +find_package(JNI REQUIRED) + set(target_specific_private_includes "") set(target_specific_public_libraries "") -if(CMAKE_TARGET_OS STREQUAL "windows") - set(target_specific_private_includes ${target_specific_private_includes} - "$ENV{JAVA_HOME}/include/win32" - ) -elseif(CMAKE_TARGET_OS STREQUAL "darwin") - set(target_specific_private_includes ${target_specific_private_includes} - "$ENV{JAVA_HOME}/include/darwin" - ) -elseif(CMAKE_TARGET_OS STREQUAL "linux") - set(target_specific_private_includes ${target_specific_private_includes} - "$ENV{JAVA_HOME}/include/linux" - ) -endif() file(GLOB_RECURSE core_includes "${OSMAND_ROOT}/core/include/*.h*") file(GLOB_RECURSE core_headers "${OSMAND_ROOT}/core/src/*.h*") @@ -76,7 +66,8 @@ if(CMAKE_SHARED_LIBS_ALLOWED_ON_TARGET) ) target_include_directories(OsmAndJNI PRIVATE - "$ENV{JAVA_HOME}/include" + ${JNI_INCLUDE_DIRS} + ${JAVA_INCLUDE_PATH} ${target_specific_private_includes} ) add_dependencies(OsmAndJNI