git-svn-id: svn://db.shs.com.ru/libs@912 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2020-03-26 18:51:52 +00:00
parent 64fb8d6c84
commit 46ea46d486
3 changed files with 52 additions and 10 deletions

View File

@@ -68,9 +68,27 @@ endforeach()
if(hasParent)
set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE)
endif()
if(NOT LIBPROJECT)
if(NOT QAD_VERSION)
include(CheckSymbolExists)
check_symbol_exists(QAD_VERSION_NAME "${QAD_INCLUDES}/qad_version.h" HAVE_QAD_VERSION)
if (HAVE_QAD_VERSION)
file(STRINGS "${QAD_INCLUDES}/qad_version.h" _VERSION REGEX "^[ \t]*#define[ \t]+QAD_VERSION_NAME+[ \t]+.*$")
string(REGEX MATCH "\".*\"" _VERSION ${_VERSION})
string(LENGTH ${_VERSION} SL)
math(EXPR SL ${SL}-2)
string(SUBSTRING ${_VERSION} 1 ${SL} _VERSION)
set(QAD_VERSION ${_VERSION} CACHE STRING "VERSION")
else()
message(FATAL_ERROR "Can`t find QAD version file!")
endif()
endif()
if(QAD_FIND_VERSION VERSION_GREATER QAD_VERSION)
message(FATAL_ERROR "QAD version ${QAD_VERSION} is available, but ${QAD_FIND_VERSION} requested!")
endif()
if (NOT _QAD_MSG)
set(_QAD_MSG 1 CACHE BOOL "msg_qad" FORCE)
message(STATUS "Found QAD")
message(STATUS "Found QAD (found version \"${QAD_VERSION}\")")
endif()
endif()