blob: 9147ce6ac393c7a42eed9196972d460dc76f235b (
plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# Sets the minimum version of CMake required to build your native library.
# This ensures that a certain set of CMake features is available to
# your build.
cmake_minimum_required(VERSION 3.4.1)
# Declares and names the project.
project("wind_visualization_native")
# Creates and names a library, sets it as either STATIC or SHARED, and
# specifies the source files.
# The wind_visualization_native library will be built as a shared library
# and will include the C++ source file `native-lib.cpp`.
add_library( # Sets the name of the library.
wind_visualization_native
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
native-lib.cpp ) # Corrected path
# Searches for a prebuilt static library called 'maplibre' which contains the
# MapLibre GL Native custom layer host implementation. This library is usually
# provided by the MapLibre Android SDK.
find_library( # Sets the name of the path variable.
maplibre-gl-lib
# Specifies the name of the NDK library that
# CMake should locate.
maplibre ) # Searching for libmaplibre.so
# Searches for the Android log library.
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# CMake should locate.
log )
# Specifies paths to the header files of a library.
# For example, the MapLibre GL Native SDK headers might be in a
# directory like 'src/main/cpp/maplibre-gl-native-headers'.
# You would add that path here.
# For now, let's just assume we will need JNI headers.
target_include_directories(wind_visualization_native PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
# Add JNI specific include directories if needed, typically handled by Android Gradle Plugin
)
# Specifies libraries that CMake should link to your target library.
# This includes the MapLibre GL Native library and the logging library.
target_link_libraries( # Specifies the target library.
wind_visualization_native
# Links the target library to the log library
# included in the NDK.
${maplibre-gl-lib}
${log-lib} )
|