0

I am trying to use this library in android using NDK. The thing is I add the library with add_subdirectory command, like this, cpp/CMakeLists.txt:

add_subdirectory(openssl)
message(CMAKE_BINARY_DIR) #for logging

And it gets build successfully but the output of message command is C:/Users/gandalf/AndroidStudioProjects/CPRTest4/app/.cxx/cmake/debug/armeabi-v7a And the directory and it's subdirectories do not contain the .a or .so files that are supposed to be generated. The mentioned .a or .so files are put in this directory C:\Users\gandalf\AndroidStudioProjects\CPRTest4\app\build\intermediates\stripped_native_libs\debug\out\lib\x86_64. How can I get the second address of bin directory using cmake variables?

I know that when you use add_library() some cmake variables like <project>_BIN_DIR is initialized. Are there any equivalent variables for when you use add_subdirectory? Can add_library instead of add_subdirectory, be used for building this library?

Gandalf
  • 2,921
  • 5
  • 31
  • 44
  • How about checking the [`OUTPUT_NAME`](https://cmake.org/cmake/help/latest/prop_tgt/OUTPUT_NAME.html#prop_tgt:OUTPUT_NAME) property of the target? – Some programmer dude Oct 31 '19 at 12:29
  • would you give an example please? – Gandalf Oct 31 '19 at 12:33
  • Example of getting library's full path using [LOCATION](https://cmake.org/cmake/help/v3.7/prop_tgt/LOCATION.html) property: https://stackoverflow.com/a/4481942/3440745. – Tsyvarev Oct 31 '19 at 13:14

0 Answers0