OsmAnd/OsmAnd-java/CMakeLists.txt

57 lines
1.3 KiB
Text
Raw Normal View History

2013-08-07 21:34:30 +02:00
project(OsmAndJNI)
set(target_specific_private_includes "")
2013-08-08 07:09:04 +02:00
set(target_specific_public_libraries "")
2013-08-07 21:34:30 +02:00
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()
if(CMAKE_SHARED_LIBS_ALLOWED_ON_TARGET)
add_library(OsmAndJNI SHARED
"c-src/swig.cpp"
)
target_compile_definitions(OsmAndJNI
PRIVATE
-DOSMAND_CORE_EXPORTS
)
target_include_directories(OsmAndJNI
PRIVATE
"$ENV{JAVA_HOME}/include"
${target_specific_private_includes}
)
if(CMAKE_STATIC_LIBS_ALLOWED_ON_TARGET)
add_dependencies(OsmAndJNI
OsmAndCore_static
OsmAndCoreUtils_static
)
target_link_libraries(OsmAndJNI
LINK_PUBLIC
OsmAndCore_static
OsmAndCoreUtils_static
2013-08-08 07:11:00 +02:00
${target_specific_public_libraries}
2013-08-07 21:34:30 +02:00
)
else()
add_dependencies(OsmAndJNI
OsmAndCore_shared
OsmAndCoreUtils_shared
)
target_link_libraries(OsmAndJNI
LINK_PUBLIC
OsmAndCore_shared
OsmAndCoreUtils_shared
2013-08-08 07:09:04 +02:00
${target_specific_public_libraries}
2013-08-07 21:34:30 +02:00
)
endif()
2013-08-08 07:09:04 +02:00
endif()