cmake check swig version

This commit is contained in:
James Cherry 2019-12-15 21:09:21 -07:00
parent dc08173a51
commit 7f3c4c990b
1 changed files with 5 additions and 1 deletions

View File

@ -474,7 +474,11 @@ add_flex_bison_dependency(SdfLex SdfParser)
################################################################
include(FindSWIG)
set(SWIG_REQUIRED_VERSION "2.0")
find_package(SWIG REQUIRED)
if(${SWIG_VERSION} VERSION_LESS ${SWIG_REQUIRED_VERSION})
message(FATAL_ERROR "SWIG version ${SWIG_VERSION} must be at least ${SWIG_REQUIRED_VERSION}")
endif()
set(STA_WRAP ${CMAKE_CURRENT_BINARY_DIR}/StaApp_wrap.cc)