find_header fix

This commit is contained in:
2020-09-07 12:59:14 +03:00
parent 0203cfe349
commit af10c4b410

View File

@@ -317,8 +317,8 @@ macro(shstk_find_header domain module filename add_find_info)
set(${domain}_INCLUDES "${_inc}" CACHE STRING "")
#endif()
include(CheckSymbolExists)
check_symbol_exists(${module}_VERSION_NAME "${${domain}_H_INCLUDE}" _version_found)
if (_version_found)
check_symbol_exists(${module}_VERSION_NAME "${${domain}_H_INCLUDE}" _${domain}_version_found)
if (_${domain}_version_found)
file(STRINGS "${${domain}_H_INCLUDE}" _version REGEX "^[ \t]*#define[ \t]+${module}_VERSION_NAME+[ \t]+.*$")
string(REGEX MATCH "\".*\"" _version ${_version})
string(LENGTH ${_version} SL)