| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 |
| 15 | include(${CMAKE_CURRENT_LIST_DIR}/OpenSSLTargets.cmake) |
| 16 |
| 17 | # Recursively collect dependency locations for the imported targets. |
| 18 | macro(_openssl_config_libraries libraries target) |
| 19 | get_property(_DEPS TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES) |
| 20 | foreach(_DEP ${_DEPS}) |
| 21 | if(TARGET ${_DEP}) |
| 22 | _openssl_config_libraries(${libraries} ${_DEP}) |
| 23 | else() |
| 24 | list(APPEND ${libraries} ${_DEP}) |
| 25 | endif() |
| 26 | endforeach() |
| 27 | get_property(_LOC TARGET ${target} PROPERTY LOCATION) |
| 28 | list(APPEND ${libraries} ${_LOC}) |
| 29 | endmacro() |
| 30 |
| 31 | set(OPENSSL_FOUND YES) |
| 32 | get_property(OPENSSL_INCLUDE_DIR TARGET OpenSSL::SSL PROPERTY INTERFACE_INCLUDE_DIRECTORIES) |
| 33 | get_property(OPENSSL_CRYPTO_LIBRARY TARGET OpenSSL::Crypto PROPERTY LOCATION) |
| 34 | _openssl_config_libraries(OPENSSL_CRYPTO_LIBRARIES OpenSSL::Crypto) |
| 35 | list(REMOVE_DUPLICATES OPENSSL_CRYPTO_LIBRARIES) |
| 36 |
| 37 | get_property(OPENSSL_SSL_LIBRARY TARGET OpenSSL::Crypto PROPERTY LOCATION) |
| 38 | _openssl_config_libraries(OPENSSL_SSL_LIBRARIES OpenSSL::SSL) |
| 39 | list(REMOVE_DUPLICATES OPENSSL_SSL_LIBRARIES) |
| 40 |
| 41 | set(OPENSSL_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES} ${OPENSSL_SSL_LIBRARIES}) |
| 42 | list(REMOVE_DUPLICATES OPENSSL_LIBRARIES) |
| 43 |
| 44 | set(_DEP) |
| 45 | set(_DEPS) |
| 46 | set(_LOC) |
| 47 |