@@ -8,49 +8,25 @@ project("unittest")
88
99include (AppLibrary)
1010
11+ find_package (base REQUIRED CONFIG)
1112find_package (googletest REQUIRED CONFIG)
1213find_package (junit-gtest REQUIRED CONFIG)
1314
1415add_app_library(adder OBJECT adder.cpp)
1516
16- # Creates and names a library, sets it as either STATIC
17- # or SHARED, and provides the relative paths to its source code.
18- # You can define multiple libraries, and CMake builds them for you.
19- # Gradle automatically packages shared libraries with your APK.
20-
21- add_app_library( # Sets the name of the library.
17+ add_app_library(
2218 unittest
23-
24- # Sets the library as a shared library.
2519 SHARED
26-
27- # Provides a relative path to your source file(s).
2820 $<TARGET_OBJECTS:adder>
29- native-lib.cpp)
30-
31- # Searches for a specified prebuilt library and stores the path as a
32- # variable. Because CMake includes system libraries in the search path by
33- # default, you only need to specify the name of the public NDK library
34- # you want to add. CMake verifies that the library exists before
35- # completing its build.
36-
37- find_library ( # Sets the name of the path variable.
38- log -lib
39-
40- # Specifies the name of the NDK library that
41- # you want CMake to locate.
42- log )
43-
44- # Specifies libraries CMake should link to your target library. You
45- # can link multiple libraries, such as libraries you define in this
46- # build script, prebuilt third-party libraries, or system libraries.
21+ native-lib.cpp
22+ )
4723
4824target_link_libraries ( # Specifies the target library.
4925 unittest
50-
51- # Links the target library to the log library
52- # included in the NDK.
53- ${ log -lib} )
26+ PRIVATE
27+ base::base
28+ log
29+ )
5430
5531add_app_library(app_tests SHARED adder_test.cpp)
5632target_link_libraries (app_tests
0 commit comments