title: Android cmake different abi
body: <p>Im using prebuilt android native library: <code>libcrypto.a</code>.
  Library is compiled for <code>armeabi, armeabi-v7a and x86</code>.
  Structure:</p>
  
  <pre><code>-app
    - CMakeLists.txt
    - libs
      - armeabi
      - armeabi-v7a
      - x86
  </code></pre>
  
  <p>Each folder (<code>armeabi, armeabi-v7a and x86</code>) contains folders <code>lib</code>(contains <code>libcrypto.a</code>) and <code>include</code> (contains header files).
  CMake code:</p>
  
  <pre><code>add_library( # Sets the name of the library.
               native-lib
  
               # Sets the library as a shared library.
               SHARED
  
               # Provides a relative path to your source file(s).
               src/main/cpp/native-lib.cpp )
  
  add_library(crypto STATIC IMPORTED)
  set_target_properties(crypto
    PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/lib/libcrypto.a)
  
  target_link_libraries( # Specifies the target library.
                         native-lib
                         crypto
                         # Links the target library to the log library
                         # included in the NDK.
                         ${log-lib})
  </code></pre>
  
  <p>In my own <code>native-lib</code> i wanna use <code>libcrypto.a</code>. But when i wanna import header file f.e. <code>#include "openssl/md5.h"</code> android studio does not see that file.
  And offer me to include one of THREE files from different abis:</p>
  
  <pre><code>"../../../libs/x86/include/openssl/md5.h"
  "../../../libs/armeabi/include/openssl/md5.h"
  "../../../libs/armeabi-v7a/include/openssl/md5.h"
  </code></pre>
  
  <p>Is there any way to create one version of my library (<code>native-lib</code>), include only 1 header and let android studio to choose abi automatically?</p>
  
  <p>Smth like:</p>
  
  <pre><code>#include "openssl/md5.h"
  </code></pre>
  
  <p>but in the same time use 3 abi version.
  Or i should use prebuilt included libraries not like that?</p>
  
  <p><strong>#EDIT1</strong></p>
  
  <pre><code>target_include_directories(crypto INTERFACE ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/include)
  </code></pre>
  
  <p>Not working, getting CMake error.</p>
  
  <p>Before that i have used </p>
  
  <pre><code>target_include_directories(${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/include/)
  </code></pre>